Using vmtk scripts within Slicer with vmtk-extension

Hi, I have a vessel modelling workflow written in python which makes use of vmtk to convert a surface file (.vtk) to a mesh file (.vtu). I would like to migrate the workflow to use the Slicer environment as well as replace some of the scripts (e.g. vmtkcenterlines, vmtkcenterlinesnetwork) with those used in the slicer vmtk-extension.

The workflow makes use of the following vmtk scripts: vmtksurfacereader, vmtksurfacekiteremoval, vmtksurfacesmoothing, vmtkvmtkcenterlines, vmtkcenterlinesnetwork, vmtksurfaceclipper, vmtkbranchclipper, vmtksurfaceconnectivity, vmtkflowextensions, vmtkdistancetocenterlines, vmtksurfaceremeshing, vmtkmeshgenerator, vmtksurfacewriter, vmtkmeshwriter. Apart from the above vmtk rendering scripts like vmtksurfaceviewer, etc… were used as well. Visualization can be handled by Slicer so I did not include those to the list.

May I confirm that all the vmtk scripts are contained within slicer when I install the extension, or is access limited to those used for the functions present within the extension? (e.g. Can I use vmtkmeshgenerator from within the slicer python interactor?)

Additionally, how to access vmtk from slicer? I can’t import vmtk within the slicer python interactor. I get the following error when I input import vmtk

Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'vmtk'
1 Like

I believe the packaging is different in the extension. Have a look in the scripted modules to see how they access the vmtk filters and you should be able to do the same.

Doodads, did you have any success. I’m struggling with the same problem.