I had the tolerance set to 0, and setting it to 1e-6 didn't fix the problem. How did you come up with that number? What'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'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"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></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'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 <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>> wrote:<br>
> I am currently using vtkPolyDataToImageStencil to successfully convert<br>
> contours represented as vtkPolyData to binary vtkImageData's. However, I'm<br>
> noticing a problem with the output sometimes. Sometimes the resulting<br>
> binary images are slightly smaller or slightly bigger than the poly data<br>
> they were made from. I assume this is the result of partial volume effects.<br>
> I would like to know 2 things<br>
> 1. How does vtkPolyDataToImageStencil handle partial volume.<br>
> 2. Is there a way to tune partial volume in vtkPolyDataToImageStencil? For<br>
> instance, a parameter which says if the contour includes less than x<br>
> percentage of the pixel then that pixel is 0.<br>
> Thanks,<br>
> Jon<br>
> PS If my assumption about partial volume effects is wrong, please let me<br>
> know.<br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br>