[vtkusers] 答复: How to select a polygon region in a vtkImageData
David Gobbi
david.gobbi at gmail.com
Wed Jan 27 14:39:44 EST 2016
Hi Fantasy,
I don't know what you mean by "dimension index".
When you display in the 3D viewer, make sure the window/level are set
correctly in the viewer. The outside of the region is given a value of
zero, but zero can show as gray depending on how the window/level is set.
- David
On Wed, Jan 27, 2016 at 12:22 PM, Chen, Lifan <LCHEN41 at mgh.harvard.edu>
wrote:
> 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>
> 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/a2ec1826/attachment.html>
More information about the vtkusers
mailing list