How vmtkboundaryreferencesystems works?

Hi all,

I am trying to implement a non-interactive clipping and meshing of an aneurysm geometry and I have problems with understanding what vmtkboundaryreferencesystems does. More specifically, I need to control that my inlet goes to the first line so that the centerlines can be computed correctly (and also because of the labelling). How does the function decide what’s first? Is there a possibility to specify the order of lines in the output file (corresponding to inlet/outlets reference systems)?

Thank you,
Best wishes,

Jana Trdlicová

Hello @Jana_Trdlicova, the job of vmtkboundaryreferencesystems is to create a dataset with as many vertices as there are open boundaries, with each vertex placed at the barycenter of each open boundary. For each boundary, the script computes the average radius, the outward normal (or an approximation if the boundary is not planar), as well as two points so that (n+o, o), (p1, o) and (p2, o) are orthogonal (see

Now, regarding the issue of having inlets on the first line, the order of reference systems coincides with the order of the open boundaries that are found on the mesh, which is not easily predicted (

Your best bet with the current algorithms is try to match the reference system coordinates (the coordinates of the vertices of the output poly data) to your inlet/outlet specifications after the fact.

For instance, if you had a vtkPolyData with a PointData integer for inlet/outlet points (e.g. 0 for inlet, 1 for outlet), you could use vmtksurfaceprojection to bring that information into the output of vmtkboundaryeferencesystems.

Hope this helps.

Hi Luca,

thank you for your quick response. It seems to me that the code is quite complicated and I’m glad that I can just use it. :slight_smile:

In my code, I compute the reference systems first, then I use these points as source and target points to compute centerlines and finally, I generate (and label) the mesh. So, the easiest solution is probably to read the vmtk-computed reference system file and test what’s my input (because I can see the approximate coordinates in ParaView).

Have a nice day,