[vtkusers] Clipping image data with polygon data.
David Gobbi
david.gobbi at gmail.com
Fri Jan 15 09:03:04 EST 2010
Hi SuperZZ,
One way that I've done this is with vtkImplicitSelectionLoop, which is
a vtkImplicitFunction that takes a vtkPoints list that defines a
polygon. Then vtkImplicitFunctionToImageStencil can create an image
stencil, and vtkImageStencil can apply the stencil to the image and
black out everything outside the polygon.
There are two simple testing examples for stenciling images (both of
these examples are for 3D images and 3D selection regions, though):
VTK/Imaging/Testing/Tcl/TestStencilWithFunction.tcl
VTK/Hybrid/Testing/Tcl/TestImageStencilWithPolydata.tcl
It's probably also possible to use vtkProbeFilter to create a "mask"
image from your polygon.
David
On Fri, Jan 15, 2010 at 2:46 AM, superzz <jxdw_zlf at yahoo.com.cn> wrote:
>
> Hello
> I wanna know does VTK support clipping image data with specified polygon
> data.
>
> I am developping a segmentation program. What I want to implement is, first
> user pick some connected polygons, then the program keeps the regions of
> image data covered by picked polygons. Erase other regions of image data to
> black.
>
> Thanks!
>
> superZZ
> --
> View this message in context: http://old.nabble.com/Clipping-image-data-with-polygon-data.-tp27173364p27173364.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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