[vtk-developers] Re: vtkOBBTree sqrt domain err

David Gobbi dgobbi at atamai.com
Mon Nov 28 15:39:22 EST 2005


Hi Dean,

I think that your best option is to view this as a vtkOBBTree bug, and fix
the OBB tree code so that it doesn't choke on your data.  Either that,
or if you do apply a check to your data, it is probably easiest to apply
some sort of check to the contours rather than to the extruded data.

Also, I used to use OBB tree to with raster scan lines as you describe
(that's what my vtkPolyDataToImageStencil class does) but I found it
was unreliable.  Sometimes the OBB tree misses an intersection of a
scan line with the polydata.  Right now I use some code that one of my
employees wrote that directly rasterizes closed 2D polydata contours.
Are your contours closed?

 - David

dean.inglis at camris.ca wrote:

>David,
>
>what I am doing is segmenting a 2D image of trabecular bone,
>shifting the range to [0,1], using vtkContourFilter to pull
>out all boundaries at isolevel 0.5.  The isolines are clipped
>to a central circular region of interest using vtkSphere and
>vtkClipPolyData. The clipped 2D polydata is transformed into 
>surfaces using vtkLinearExtrusionFilter to extrude the polylines 
>to an out-of-plane height of 1, and then translating the resulting 
>polygonal data back -0.5 so that is straddles the image plane.  
>I then use vtkOBBTree to generate a search tree so that I can
>efficiently run scan lines defined by point pairs in the image plane 
>at different orientations (stereology stuff).
>How might I check the polydata going into vtkOBBTree: vtkMeshQuality?
>Should I make sure that any of the clipped polylines are not reduced
>to isolated points (and then extruded as a line)?
>
>Dean
>
>
>  
>
>>The ComputeOBB() method on line 270 computes a value called
>>"tot_mass" and then divides a bunch of values by it. It looks like
>>"tot_mass" is zero if no triangles can be generated from the data
>>set, or if the triangles are degenerate.
>>
>>So apparently vtkOBBTree will crash and burn if it is given data sets
>>that cannot be turned into triangles. Dean, do you think that any
>>of the data sets that you are giving to OBBTree might not have
>>any polygons?
>>    
>>
>
>
>
>  
>




More information about the vtk-developers mailing list