vtkImageStencilData returns random bad lines
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I have a mitk::Mesh which I know is a well-defined closed surface because I can see it and, as intructed in [1], vtkFeatureEdges returns 0 bad feature. This mesh looks like http://i.imgur.com/1HWqmmy.jpg. It may be hard to see, but it's a heart countour, with no bottom. The middle volume is empty, the mesh only defines the contour.
So, here's the pipeline
- A vtkPolyData that I'm pretty sure is valid because in [1], David Gobbi advises to use vtkFeatureEdges and vtkCleanPolyData, both of which return what I want.
- vtkImageStencilData using vtkPolyDataToImageStencil with tolerance = 1.0
- Create a binary image with this stencilData using vtkImageStencil
Like the guy in [1], I obtain random lines at the bottom of my polyData. You can see them here http://i.imgur.com/k9jXgg7.jpg. I don't understand where these lines come from. They dissapear when tolerance = 0.0, but I can't set tolerance to 0 because sometime the countour is really thin, so it will dissapear.
Another advice in [1] is to recompile vtk using double in vtkPolyDataToImageStencil, but this is not an option for us. So, what can I do to get rid of these lines?
[1] http://vtk.1045678.n5.nabble.com/Problem-with-vtkPolyDataToImageStencil-td5714947.html