I had the tolerance set to 0, and setting it to 1e-6 didn&#39;t fix the problem.  How did you come up with that number?  What&#39;s wrong with setting it to 0?  In my case usually the left and top side of the vtkImageData is being eroded, such that if I call the filter many times, the vtkImageData will eventually be blank because it will all be eroded.   However, sometimes the bottom and right grow in size, I haven&#39;t figured out which situations cause which.<br>
<br><div class="gmail_quote">On Wed, Feb 23, 2011 at 10:54 AM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jonathan,<br>
<br>
Whether a pixel is set depends on whether the center of the pixel<br>
is inside or outside the contour, irregardless of what proportion of<br>
the pixel&#39;s volume is inside or outside.<br>
<br>
The only adjustment is the Tolerance, which should be set to<br>
around 1e-6 so that pixels right on the edge of the contour<br>
are considered to be inside.  The tolerance cannot be negative.<br>
<br>
 - David<br>
<div><div></div><div class="h5"><br>
<br>
On Wed, Feb 23, 2011 at 11:22 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt; I am currently using vtkPolyDataToImageStencil to successfully convert<br>
&gt; contours represented as vtkPolyData to binary vtkImageData&#39;s.  However, I&#39;m<br>
&gt; noticing a problem with the output sometimes.  Sometimes the resulting<br>
&gt; binary images are slightly smaller or slightly bigger than the poly data<br>
&gt; they were made from.  I assume this is the result of partial volume effects.<br>
&gt;  I would like to know 2 things<br>
&gt; 1.  How does vtkPolyDataToImageStencil handle partial volume.<br>
&gt; 2.  Is there a way to tune partial volume in vtkPolyDataToImageStencil?  For<br>
&gt; instance, a parameter which says if the contour includes less than x<br>
&gt; percentage of the pixel then that pixel is 0.<br>
&gt; Thanks,<br>
&gt; Jon<br>
&gt; PS If my assumption about partial volume effects is wrong, please let me<br>
&gt; know.<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>