vmtkcenterlines openprofiles issue

I am trying to use vmtkcenterlines, but even on the test data aorta-surface-open-ends.stl when I run

vmtksurfacereader -ifile aorta-surface-open-ends.stl --pipe vmtkcenterlines -seedselector openprofiles -endpoints 1 -ofile aorta-ctl.vtk

I get an error after closing the GUI (not sure why it shows up in the first place). Am I using this wrong? I’d expect it to find centerlines connecting each opening to the others. I have installed version 1.5 from conda-forge on Fedora 34.

Please input list of inlet profile ids: Traceback (most recent call last):
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/pypeserver.py", line 48, in RunPypeProcess
    pipe.Execute()
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/pype.py", line 324, in Execute
    scriptObject.Execute()
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/vmtkcenterlines.py", line 601, in Execute
    self.SeedSelector.Execute()
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/vmtkcenterlines.py", line 312, in Execute
    self._SourceSeedIds.InsertNextId(int(seedIdString.strip()))
ValueError: invalid literal for int() with base 10: ''

Full output

Automatic piping vmtksurfacereader
Parsing options vmtksurfacereader
    InputFileName = aorta-surface-open-ends.stl
Explicit piping vmtksurfacereader
Input vmtksurfacereader members:
    Id = 0
    Disabled = 0
    Format = 
    GuessFormat = 1
    Surface = 0
    InputFileName = aorta-surface-open-ends.stl
    SurfaceOutputFileName = 
Executing vmtksurfacereader ...
Reading STL surface file.
Done executing vmtksurfacereader.
Output vmtksurfacereader members:
    Id = 0
    Surface = vtkPolyData

Automatic piping vmtkcenterlines
    Surface = vmtksurfacereader-0.Surface
Parsing options vmtkcenterlines
    SeedSelectorName = openprofiles
    AppendEndPoints = 1
    AppendEndPoints = 1
    CenterlinesOutputFileName = aorta-ctl.vtk
Explicit piping vmtkcenterlines
Input vmtkcenterlines members:
    Id = 0
    Disabled = 0
    Surface = vtkPolyData
    SurfaceInputFileName = 
    SeedSelectorName = openprofiles
    SourceIds = []
    TargetIds = []
    SourcePoints = []
    TargetPoints = []
    AppendEndPoints = 1
    CheckNonManifold = 0
    FlipNormals = 0
    CapDisplacement = 0.0
    DelaunayTolerance = 0.001
    RadiusArrayName = MaximumInscribedSphereRadius
    AppendEndPoints = 1
    Resampling = 0
    ResamplingStepLength = 1.0
    DelaunayTessellation = None
    SimplifyVoronoi = 0
    UseTetGen = 0
    TetGenDetectInter = 1
    CostFunction = 1/R
    vmtkRenderer = None
    PoleIds = None
    VoronoiDiagram = None
    VoronoiDiagramInputFileName = 
    StopFastMarchingOnReachingTarget = 0
    CenterlinesOutputFileName = aorta-ctl.vtk
    DelaunayTessellationOutputFileName = 
    VoronoiDiagramOutputFileName = 
Executing vmtkcenterlines ...
Cleaning surface.
Triangulating surface.
Capping surface.
Quit renderer
Please input list of inlet profile ids: Traceback (most recent call last):
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/pypeserver.py", line 48, in RunPypeProcess
    pipe.Execute()
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/pype.py", line 324, in Execute
    scriptObject.Execute()
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/vmtkcenterlines.py", line 601, in Execute
    self.SeedSelector.Execute()
  File "/home/user/anaconda3/envs/vmtkcf/lib/python3.7/site-packages/vmtk/vmtkcenterlines.py", line 312, in Execute
    self._SourceSeedIds.InsertNextId(int(seedIdString.strip()))
ValueError: invalid literal for int() with base 10: ''

openprofiles isn’t automated, it opens the GUI so you can manually select the inlets and outlets.

Have a look at the options available (vmtk - the Vascular Modelling Toolkit), in most cases you’d need to provide the Ids or points for the inlets/outlets yourself. carotidprofiles would be the only as far as I know to select them automatically.

Thanks @ramtingh for the tips. What happens is the display pops up to show the geometry and open profiles. With no prompt, but after hitting q, the selection prompt briefly shows up and the immediately closes before I am able to enter the inlet id. I have reproduced this on Ubuntu 20.04 as well.

I see, that’s not supposed to behave that way. I’m not sure yet if it is a vmtk problem (probably caused by moving to vtk 9) or a conda packaging problem, but the renderer doesn’t seem to be waiting for inputs and just accepting empty strings. I’ll look into it.

Vessel segmentation and centerline extraction is an interactive process. The scripts that come with VMTK and implement some interactions are very extremely limited. I always use 3D Slicer as GUI for doing any interactive operations with VMTK.

For centerline extraction there is a very convenient, full-featured module: it can detect automatic vessel endpoints automatically, then each can be interactively moved/deleted/toggled between inflow/outflow. It can check errors in the input mesh, optimize the input mesh so that extraction becomes magnitudes faster, and then it uses network and/or centerline extraction method to get the centerlines.

There are other modules with convenient GUI that can use the computed centerline for exploring, reslicing the input image, quantify the curve, straighten the curve, etc.