I have a dataset with multiple structures which are shaped like irregular 3d tubes, I was wondering if it is possible to fit a spline through the approximate center of such structures (I have both isosurfaces and volume data) … Here is an example:
Like transforming the isosurfaces to solids and then calculate the centerline based on an the middle point for each coordinate
Is there any way to do so or any example that can be reutilized?
Thanks in advance
The operation you need is called skeletonization. I don’t believe VTK has a mesh skeletonizer or even a raster skeletonizer. Still, you can do it with its sister library, ITK, and you have, as you already guessed, to raster your mesh into a 3D volume: https://vtk.org/pipermail/vtkusers/2018-January/100722.html .
Alternatively, you can try CGAL for direct-from-mesh skeletonization: https://doc.cgal.org/latest/Surface_mesh_skeletonization/index.html .