[vtkusers] creating masks from contours ?

Simon DROUIN sdrouin at bic.mni.mcgill.ca
Thu Mar 11 17:26:52 EST 2004


Hi,

In which format are the contours and in which format do you want your
mask?

I suppose you have contours in vtkPolyData and want to mask a
vtkImageData.

If this is the case, use vtkPolyDataToImageStencil. This class will take a
vtkPolyData as its input and will generate a vtkImageStencilData on its
output. This is the mask. If you then want to mask an image, use
vtkImageStencil. Pass the vtkImageStencilData to its SetStencil function
and the image you want to mask as its input. The output of the
vtkImageStencil will be the masked image.

He's an ascii representation of the pipeline:

vtkPolyData(your contour) ---> vtkPolyDataToImageStencil
                                                   |
vtkImageData(image to mask) ---> vtkImageStencil <--
                                      |
                                      ---> the masked image

Hope I answered the right question.

-Simon


On Thu, 11 Mar 2004, Pallavi Joshi wrote:

>   Hi,
>   I would like to know how can I create binary masks from contours using vtk.
>   Anybody, any suggestions ?
>   I wud really appreciate any help on this.
>   thanks,
>   Pallavi
>
>   -------------------------------------------------------------------
>   Pallavi Joshi
>   Graduate Student
>   Medical Image Processing Lab
>   Vanderbilt University
>   Phone: 615-343-6259
>   --------------------------------------------------------------------
>




More information about the vtkusers mailing list