[vtkusers] Re: centerline calculation

Goodwin Lawlor goodwin.lawlor at ucd.ie
Tue Aug 3 12:44:27 EDT 2004


Hi Matt,

The easiest way would be to use:

            void vtkOBBTree::ComputeOBB  (  vtkDataSet *    input,
            float    corner[3],
            float    max[3],
            float    mid[3],
            float    min[3],
            float    size[3]
           )


If its a tube, then max[3] will be your center line vector. You can use the
centroid as a point for the vector
to pass through.

Another more involved way is
1. Calculate some cross sections
2. Calculate the centroid of these (polygons)
3. Fit a 3d line to these centroid using some orthogonal regression
algorithm.

hth

Goodwin

"Matthew Seier" <mattie_seier at hotmail.com> wrote in message
news:BAY12-F20cGXWz8hb1C0004ccdf at hotmail.com...
> Hey,
>
> Does anyone know how to calculate a centerline given a set of PolyData in
> C++?  The data represents a tubelike object, and the line would need to
pass
> through the center of the tube, which was obtained using vtkImageReader.
> Any help would be appreciated.
>
> Thanks,
> Matt
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>






More information about the vtkusers mailing list