[vtkusers] vtkImageStencilData to vtkImageData

Luis Cordova cordoval at gmail.com
Thu Jul 31 11:26:21 EDT 2008


I am confused since I have

/* convert poly to image data */
  vtkPolyDataToImageStencil *imagedata = vtkPolyDataToImageStencil::New();
  imagedata->SetInput(decimate->GetOutput());

  /* second step needed applies the stencil to an image */
  vtkImageStencil *stencil = vtkImageStencil::New();
  stencil->SetInput(imagedata->GetOutput());
  stencil->SetStencil(imagedata->GetOutput());
  stencil->ReverseStencilOn();
  stencil->SetBackgroundValue(500);

And SetInput and SetStencil are provided the same input. I am
missunderstanding something serious.

On Thu, Jul 31, 2008 at 8:14 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Luis,
>
> Two steps are required.  First vtkPolyDataToImageStencil, and then
> vtkImageStencil to apply the stencil to an image.  See the following
> example:
>
> Hybrid/Testing/Tcl/TestImageStencilWithPolydata.tcl
>
> If you just want to create a binary image, then you will have to
> replace the "reader" in the example with something that will
> create a blank image.
>
>    David
>
>
> On Thu, Jul 31, 2008 at 1:43 AM, Luis Cordova <cordoval at gmail.com> wrote:
>> I am getting a runtime error of "type vtkImageStencilData, but a
>> vtkImageData is required."
>>
>> I was before needing to convert from PolyData to ImageData, then I use
>> vtkPolyDataToImageStencil, but now this error from Stencil to Image.
>>
>> Anyone hints?
>>
>> Thanks,
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>



More information about the vtkusers mailing list