<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><font size="3">I mean the size in in three dimensions of the output of the stencil is still the same as the input, for example, if the original size of the image data is 512x512x312,
 the output of the stencil is still 512x512x312. However, I only need the region that has been extracted from the original image data. Is there any method to minimize the size of the output to the extracted region?</font>
<div><font size="3"><br>
</font></div>
<div><font size="3">Fantasy<br>
</font>
<div>
<div style="font-family: 'Times New Roman'; color: rgb(0, 0, 0);">
<hr tabindex="-1">
<div id="divRpF968117" style="font-size: 16px; direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>发件人:</b> David Gobbi [david.gobbi@gmail.com]<br>
<b>发送时间:</b> 2016年1月27日 14:39<br>
<b>收件人:</b> Chen, Lifan<br>
<b>抄送:</b> vtkusers@vtk.org<br>
<b>主题:</b> Re: 答复: [vtkusers] How to select a polygon region in a vtkImageData<br>
</font><br>
</div>
<div style="font-size: 16px;"></div>
<div style="font-size: 16px;">
<div dir="ltr">Hi Fantasy,
<div><br>
</div>
<div>I don't know what you mean by "dimension index".</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div> - David</div>
<div><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jan 27, 2016 at 12:22 PM, Chen, Lifan <span dir="ltr">
<<a href="mailto:LCHEN41@mgh.harvard.edu" target="_blank">LCHEN41@mgh.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hey David,
<div><br>
</div>
<div>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?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Fantasy<br>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>发件人:</b> David Gobbi [<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>]<br>
<b>发送时间:</b> 2016年1月26日 16:47<br>
<b>收件人:</b> Chen, Lifan<br>
<b>抄送:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>主题:</b> Re: [vtkusers] How to select a polygon region in a vtkImageData<br>
</font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>
<div dir="ltr">Hi Fantasy,
<div><br>
</div>
<div>VTK has "stencil" operations for extracting regions from vtkImageData.  For example:</div>
<div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData</a><br>
</div>
<div><br>
</div>
<div>There are a few VTK test samples that show different ways to use stencils:</div>
<div><br>
</div>
<div>
<div>Imaging/Core/Testing/Cxx/TestStencilWithLasso.cxx</div>
<div>Imaging/Core/Testing/Cxx/TestStencilWithPolyDataContour.cxx</div>
<div>Imaging/Core/Testing/Cxx/TestStencilWithPolyDataSurface.cxx</div>
</div>
<div><br>
</div>
<div>
<div>Imaging/Core/Testing/Python/TestBlendStencil.py</div>
<div>Imaging/Core/Testing/Python/TestLassoStencil.py</div>
<div>Imaging/Core/Testing/Python/TestROIStencil.py</div>
<div>Imaging/Core/Testing/Python/TestStencilToImage.py</div>
<div>Imaging/Core/Testing/Python/TestStencilWithFunction.py</div>
<div>Imaging/Core/Testing/Python/TestStencilWithImage.py</div>
</div>
<div><br>
</div>
<div>Extraction of a polygonal region can be done with vtkLassoStencilSource</div>
<div>or with vtkPolyDataToImageStecil.</div>
<div><br>
</div>
<div>Cheers,</div>
<div> - David</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jan 26, 2016 at 2:22 PM, Chen, Lifan <span dir="ltr">
<<a href="mailto:LCHEN41@mgh.harvard.edu" target="_blank">LCHEN41@mgh.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:rgb(0,0,0); font-size:10pt">
Hey all,
<div><br>
</div>
<div>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 (<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SelectPolyData" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SelectPolyData</a>)<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SelectPolyData" style="font-size:10pt" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/SelectPolyData</a></div>
<div>However, it doesn't work for vtkImageData. Is there any method to solve this problem?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Fantasy Chen</div>
</div>
<p></p>
<p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>