[vtkusers] Fixing vtkPolyDataToImageStencil

David Gobbi david.gobbi at gmail.com
Mon Oct 6 15:48:25 EDT 2014

Also, just in case you are using the patch that was attached to
the bug report, that patch is no longer up to date.  The most
recent code can always be found on the gerrit submission page:

On Mon, Oct 6, 2014 at 1:44 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> I suspect there are problems with the way that the tolerance is
> applied during the rasterization part of the algorithm, and the larger
> the tolerance, the more likely it is that problems will occur. For
> best results you should use a tolerance of zero.
> The patch is still sitting in the queue because I haven't had time to
> test it properly.  If it is at all possible for you to provide data
> sets or test code, that would be a big help.
>  - David
> On Mon, Oct 6, 2014 at 12:05 PM, Ricardo A Corredor
> <ra.corredor at gmail.com> wrote:
>> Hi David,
>> I just made a test using my data and your patch. It seems it is working
>> well, but I still don't get how the tolerance should be selected. I explain
>> myself with the following image and description:
>> <http://vtk.1045678.n5.nabble.com/file/n5728996/PolyDataRasterization.jpeg>
>> I'm using a very simple modified version of the VTK Cxx example,
>> PolyDataToImageData (code and data are here: http://git.io/s49TIA). I used
>> two polydata (the cells of both polydata are polylines, i.e. closed contours
>> along Z axis, that could be seen in the image in white), one reasonably
>> bigger than the other one (in the image you will see the body and a
>> structure inside), but keeping same properties. When using the Tolerance
>> (0.001) by default in the big polydata (the body), the 'raster' image is
>> generated correctly. When using the same code in the small structure, the
>> output image still has strange blank lines (left part of the image).
>> However, if I decrease considerably the Tolerance (0.00001), the result is
>> correct (right part of the image).
>> Does it makes sense to you? Is that normal?
>> Thanks!
>> Regards,
>> Ricardo
>> RaC

More information about the vtkusers mailing list