Problem in extracting centerlines

Hello All,

I am trying to extract centerlines of vessel segments present in an stl file . When I use this model in the extract centerline module all the endpoints are not detected after hitting Auto-detect.

I also tried the same on a smaller subset of the vessels present in the stl file shared above. The network extraction and centerline extraction didn’t find the properties of all the branches. Many endpoints are undetected in “Auto detect”.

Suggestions on how to get this working will be really helpful.

This is a kind reminder.

This is a kind reminder. I’d like to know if the centerline extraction will work on geometries like this

These file contains a so badly corrupted mesh that it is really hard to make any sense of it. It is tricky because visually it looks OK. However, it has duplicate triangles all over the mesh (it looks like all the tubes are double-walled) and it self-intersects at hundreds of locations. If you got this from an attachment of a paper then I would suggest to contact the journal and/or the authors and ask for a corrected mesh. Or ask for the centerline that it was generated from.

I was able to make the mesh somewhat usable by using ParaView’s “Clean to grid” filter followed by “Extract surface”. However, it is still not perfect and VMTK can only process a single vessel tree at a time, so you need to tune mesh clearing further and to split the mesh to independent trees before attempting centerline analysis.

Thanks a lot for looking into this.

The centerline data of multiple trees are available in xml file.
Each <vessel version="3" color="#6080FF" type="directed"> corresponds a single tree.
I have parsed this data in Python. However, I am not sure how to compute the centerline lengths and diameter / generate stl file from this data. Any help will be greatly appreciated.

The 3D object file of a single tree is also available here

I will try if this works on the single tree object.

EDIT: I used “Clean to grid” filter followed by “Extract surface” and generated this file
The endpoints weren’t detected for this too

Having a tree in XML makes things very simple. Centerline length computation is trivial (sum of Euclidean distances between points that make up a branch).

As I wrote above, you need to split the forest and process each tree separately. There is a problem also with self-intersections. Fortunately, you don’t need any of this, as you can already get the tree from the XML file.


Since you already have a clear definition of the vessel tree in the XML file, you don’t need to use VMTK (which would provide end result very similar to the information in the XML file). I don’t think there is anything more I could help you with. You should be able to do the rest of the analysis by yourself, using various Python packages.

Thank you, this helps a lot. May I know how the diameter can be computed?

As you can see in the XML file, vessel diameter is available for each point:

...
<point x="124.54" y="-421.36" z="-16.00" d="2.94"/>
...
`

Hi @lassoan Yes, I mean to ask if it would be right to simply compute the average diameter, using the diameter of each point, for finding out the diameter of a branch.

I had tried this before and the values were different. So I am not sure what’s right approach

This decision is up to you, whatever you find the most appropriate for your application.

This case is going hopeless :yawning_face: