[vtkusers] VTKpolydata (2D polygon) to VTKimagedata

David Doria daviddoria at gmail.com
Wed Jul 4 19:11:17 EDT 2012


On Wed, Jul 4, 2012 at 7:03 PM, Neda <neda.marvasti at gmail.com> wrote:

> Dear all,
>
> I searched a lot in the google but I could not solve my problem. I hope
> some
> one helps me here.
>
> what I want to do is creating the corresponding binary image of a polygon
> (vtkPolydata) in a 2D image.
> To do this I found a function called "vtkPolyDataToImageStencil" but it
> gives me a totally black image.
> I do not know what is wrong in my code (I attached my code here)
>
> I will appreciate if some one tells me how can I solve this problem.
> Did I choose a correct function to do this?
>

Have you looked at this example?

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataContourToImageData

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120704/c056b751/attachment.htm>


More information about the vtkusers mailing list