[vtkusers] 答复: How to select a polygon region in a vtkImageData
Chen, Lifan
LCHEN41 at mgh.harvard.edu
Wed Jan 27 14:22:48 EST 2016
Hey David,
I use stencil and it works well, however, the dimension index of the output of stencil remain unchanged which I supposed to change according to the size of region I choose and there is a gray part around the region I choose when displaying in the 3-D viewer. Do you what is the problem?
Thanks,
Fantasy
________________________________
发件人: David Gobbi [david.gobbi at gmail.com]
发送时间: 2016年1月26日 16:47
收件人: Chen, Lifan
抄送: vtkusers at vtk.org
主题: Re: [vtkusers] How to select a polygon region in a vtkImageData
Hi Fantasy,
VTK has "stencil" operations for extracting regions from vtkImageData. For example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData
There are a few VTK test samples that show different ways to use stencils:
Imaging/Core/Testing/Cxx/TestStencilWithLasso.cxx
Imaging/Core/Testing/Cxx/TestStencilWithPolyDataContour.cxx
Imaging/Core/Testing/Cxx/TestStencilWithPolyDataSurface.cxx
Imaging/Core/Testing/Python/TestBlendStencil.py
Imaging/Core/Testing/Python/TestLassoStencil.py
Imaging/Core/Testing/Python/TestROIStencil.py
Imaging/Core/Testing/Python/TestStencilToImage.py
Imaging/Core/Testing/Python/TestStencilWithFunction.py
Imaging/Core/Testing/Python/TestStencilWithImage.py
Extraction of a polygonal region can be done with vtkLassoStencilSource
or with vtkPolyDataToImageStecil.
Cheers,
- David
On Tue, Jan 26, 2016 at 2:22 PM, Chen, Lifan <LCHEN41 at mgh.harvard.edu<mailto:LCHEN41 at mgh.harvard.edu>> wrote:
Hey all,
I am working on a project that requires to manually extract a region from a 3D vtkImageData. I read the example on how to select a region in a vtkPolyData in VTK/Examples/Cxx/PolyData/SelectPolyData (http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SelectPolyData)http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SelectPolyData
However, it doesn't work for vtkImageData. Is there any method to solve this problem?
Thanks,
Fantasy Chen
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160127/ce0b1bf9/attachment.html>
More information about the vtkusers
mailing list