[vtkusers] Clipping image data with polygon data.

superzz jxdw_zlf at yahoo.com.cn
Sun Jan 17 23:55:12 EST 2010


Hello David Gobbi
Thank you for your response.
The example works fine. I can see the result in ImageViewer. I want to
export stencil image to raw file now. However, if I call
imageStencil.Update() manually, Update() never returns. Why this happens? 

Thanks

superZZ


David Gobbi-3 wrote:
> 
> 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
>>
> _______________________________________________
> 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
> 
> 

-- 
View this message in context: http://old.nabble.com/Clipping-image-data-with-polygon-data.-tp27173364p27206195.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list