The Vascular Modeling Toolkit

Supported by Orobix srl

vmtk is a collection of libraries and tools for 3D reconstruction, geometric analysis, mesh generation and surface data analysis for image-based modeling of blood vessels.

Learn More

vmtk 1.3 released!

Get a free trial of VMTKLab


Segmentation of vascular segments (or other anatomical structures) from medical images


Compute centerlines and maximal inscribed sphere radius of branching tubular structures given their polygonal surface representation

Geometric analysis

Geometric analysis and surface data processing of 3D models of blood vessels

Mesh generation

Surface remeshing, volume meshing and generation of boundary layers of prismatic elements with varying thickness for Computational Fluid Dynamics.

Post processing

Mapping and patching of fluid dynamics variables, particle tracing and more...

Pyping system

PypeS is the glue among vmtk scripts. It allows new scripts to be written easily, to have a common interface and to interact with each other.

Support and consulting

 Custom development and training courses 

Orobix logo

Need support for vmtk? Please use the vmtk official support group.

Need to develop problem-specific algorithms, custom pipelines or dedicated user interfaces?

Orobix srl offers professional support around (but not limited to):

  • automated image segmentation
  • geometric characterization
  • mesh generation
  • computational hemodynamics
  • post processing
  • visualization
  • machine learning
  • data engineering

Contact us

or visit the Orobix website

Gradient-based 3D level sets segmentation

Take a look into the Level Set Segmentation tutorial to learn how to reconstruct the 3D surface of a vascular segment from CT or MR images using level sets.

// Image segmentation
vmtklevelsetsegmentation -ifile image_volume_voi.vti -ofile level_sets.vti
//You can specify different parameters, for example:
-levelsetsfile in order to start from an existing levelset segmentation
-featureimagetype to change featureimage, for example the upwind modality
-featurederivativesigma to use a Gaussian derivative convolution

A new gradient computation modality based on upwind finite differences allows the segmentation of small (down to 1.2 pixels/diameter) vessels. Interactive level sets initialization based on the Fast Marching Method. This includes a brand new method for selecting a vascular segment comprised between two points automatically ignoring side branches, no parameters involved. Segmenting a complex vascular tract comes down to selecting the endpoints of a branch, letting level sets by attracted to gradient peaks with the sole advection term turned on, repeating the operation for all the branches and merging everything in a single model.

Computing centerlines

Take a look into the Computing Centerlines tutorial to learn how to compute centerlines of a vascular segment.

// Computing centerlines
vmtkcenterlines -ifile foo.vtp -ofile foo_centerlines.vtp
//Look the resulting centerlines
vmtksurfacereader -ifile foo.vtp --pipe vmtkcenterlines --pipe vmtkrenderer --pipe vmtksurfaceviewer -opacity 0.25 --pipe vmtksurfaceviewer -i @vmtkcenterlines.o -array MaximumInscribedSphereRadius
//Inspect the voronoi diagram
vmtksurfacereader -ifile foo.vtp --pipe vmtkcenterlines --pipe vmtkrenderer --pipe vmtksurfaceviewer -opacity 0.25 --pipe vmtksurfaceviewer -i @vmtkcenterlines.voronoidiagram -array MaximumInscribedSphereRadius --pipe vmtksurfaceviewer -i @vmtkcenterlines.o
Figure 1

Centerlines are powerful descriptors of the shape of vessels and are determined as weighted shortest paths traced between two extremal points. In order to ensure that the final lines are in fact central, the paths cannot lie anywhere in space, but are bound to run on the Voronoi diagram of the vessel model, considered as the place where the centers of maximal inscribed spheres are defined. Centerlines are determined as the paths defined on Voronoi diagram sheets that minimize the integral of the radius of maximal inscribed spheres along the path, which is equivalent to finding the shortest paths in the radius metric.

Geometric analysis

Take a look into the Geometric analysis tutorial to learn how to analyze the 3D geometry of a vascular segment and into the Preparing a Surface for Meshing tutorial to learn how to prepare a surface for mesh generation.

// Generate a vtp file containing the data on the bifurcation vectors
vmtksurfacereader -ifile foo.vtp --pipe vmtkcenterlines -seedselector openprofiles --pipe vmtkbranchextractor --pipe vmtkbifurcationreferencesystems --pipe vmtkbifurcationvectors -ofile foo_bv.vtp
//Compute curvature and torsion
vmtkcenterlinegeometry -ifile foo_cl.vtp -smoothing 1 -ofile foo_clgm.vtp
//Smoothing a surface
vmtksurfacesmoothing -ifile foo.vtp -passband 0.1 -iterations 30 -ofile foo_sm.vtp 
//Adding flow extensions
vmtksurfacereader -ifile foo.vtp --pipe vmtkcenterlines -seedselector openprofiles --pipe vmtkflowextensions -adaptivelength 1 -extensionratio 20 -normalestimationratio 1 -interactive 0 --pipe vmtksurfacewriter -ofile foo_ex.vtp 
Figure 1

Quantifying geometric features of the vascular segment, those associated to bifurcations, such as bifurcation planes and bifurcation angles, and those associated to branches, such as curvature and torsion. Curvature and torsion are tightly linked to the definition of the Frenet line frame, constituted by a tangent, a normal and the binormal.

Increase surface smoothness prior to building the mesh. Image segmentation can result in bumpy surfaces, especially if the image quality is not high and one didn’t use any curvature term in level sets evolution. Flow extensions are cylindrical extensions added to the inlets and outlets of a model. They are important for ensuring that the flow entering and leaving the computational domain is fully developed, so that fully developed boundary conditions aren’t forcing the solution in the actual vessel.

Generating a mesh

Take a look into the Generating a Mesh tutorial to learn how to generate a mesh from a surface and into Meshing based on centerlines (vmtk+gmsh) tutorial to learn how to generate tetrahedral or mixed hexahedral meshes using vmtk coupled to Gmsh. Contributed by Emilie Marchandise, U. Louvain

// generating a uniform element mesh
vmtkmeshgenerator -ifile foo.vtp -ofile foo.vtu -edgelength 0.5
//Generating a radius-adaptive element mesh
vmtksurfacereader -ifile foo.vtp --pipe vmtkcenterlines -endpoints 1 -seedselector openprofiles --pipe vmtkdistancetocenterlines -useradius 1 --pipe vmtkmeshgenerator -elementsizemode edgelengtharray -edgelengtharray DistanceToCenterlines -edgelengthfactor 0.3 -ofile foo.vtu 
//Adding a boundary layer
vmtksurfacereader -ifile foo.vtp --pipe vmtkcenterlines -endpoints 1 -seedselector openprofiles --pipe vmtkdistancetocenterlines -useradius 1 --pipe vmtkmeshgenerator -elementsizemode edgelengtharray -edgelengtharray DistanceToCenterlines -edgelengthfactor 0.3 -boundarylayer 1 -ofile foo.vtu 
Figure 1

Surface remeshing is performed under the assumption that the surface requires improvement before being used for CFD. After the surface has been remeshed the volume is filled with a combination of tetrahedral and prismatic elements.
We can heighten the density of the mesh near the wall by generating the boundary layer.

Mapping and patching

Take a look into the Mapping and patching tutorial to learn how to map the surface of a population of vessels onto the same parametric space and enable statistical analyses of surface-based quantities

// Longitudinal and circumferential metrics
vmtkbranchmetrics -ifile aorta_clipped.vtp -centerlinesfile aorta_cl.vtp -abscissasarray Abscissas -normalsarray ParallelTransportNormals -groupidsarray GroupIds -centerlineidsarray CenterlineIds -tractidsarray TractIds -blankingarray Blanking -radiusarray MaximumInscribedSphereRadius -ofile aorta_clipped_metrics.vtp
//Metrics mapping to branches
vmtkbranchmapping -ifile aorta_clipped_metrics.vtp -centerlinesfile aorta_cl.vtp -referencesystemsfile aorta_cl_rs.vtp -normalsarray ParallelTransportNormals -abscissasarray Abscissas -groupidsarray GroupIds -centerlineidsarray CenterlineIds -tractidsarray TractIds -referencesystemsnormalarray Normal -radiusarray MaximumInscribedSphereRadius -blankingarray Blanking -angularmetricarray AngularMetric -abscissametricarray AbscissaMetric -ofile aorta_clipped_mapping.vtp
//Patching of surface mesh and attributes
vmtkbranchpatching -ifile aorta_clipped_mapping.vtp -groupidsarray GroupIds -longitudinalmappingarray StretchedMapping -circularmappingarray AngularMetric -longitudinalpatchsize 0.5 -circularpatches 12 -ofile aorta_clipped_patching.vtp
Figure 1

A common application is mapping and patching of fluid dynamics variables, such as wall shear stress (WSS) or oscillatory shear index (OSI), obtained on the surface mesh typically by means of a CFD simulation.
By construction of a harmonic function over each vascular segment, vmtkbranchmapping maps and stretches the longitudinal metric to correctly account for the presence of insertion regions at bifurcations; the additional StretchedMapping array is added to the surface.


Take a look into the Basic PypeS tutorial to learn how to effectively pipe vmtk scripts together, the Use PypeS Programmatically tutorial to learn how to interactively work with PypeS objects and into the Advanced PypeS tutorial to learn how to write your own PypeS modules

vmtkmarchingcubes --help
Creating vmtkMarchingCubes instance.
Automatic piping vmtkmarchingcubes
Parsing options vmtkmarchingcubes
vmtkmarchingcubes : generate an isosurface of given level from a 3D image
Input arguments:
	-id Id(int,1); default=0: script id
	-handle Self (self,1): handle to self
	-disabled Disabled (bool,1); default=0: disable execution and piping
	-i Image (vtkImageData,1): the input image
	-ifile ImageInputFileName(str,1): filename for the default Image Reader
	-array ArrayName (str,1): name of the array to work with
	-l Level(float,1); default=0.0: graylevel to generate the isosurface at
	-connectivity Connectivity (bool,1); default=0: only output the largest connected region of the isosurface
	-ofile SurfaceOutputFileName (str,1): filename for the default Surface writer
Output arguments:
	-id Id (int,1); default= 0: script id
	-handle Self (self,1): handle to self
	-o Surface (vtkPolyData,1): the output surface
// We can use vmtkmarchingcubes as a stand-alone script by using the built-in I/O functionality
vmtkmarchingcubes -ifile foo.vti -ofile foo.vtp
//or we can build a pype that does the same thing
vmtkimagereader -ifile foo.vti --pipe vmtkmarchingcubes --pipe vmtksurfacewriter -ofile foo.vtp @vmtkcenterlines.o -array MaximumInscribedSphereRadius
//Say we want to read two images and extract a surface with Marching Cubes with a level of 20 for both. We can either write
vmtkmarchingcubes -ifile foo1.vti -l 20 --pipe vmtkmarchingcubes -ifile foo2.vti -l 20
//or push the input argument -l along to the second vmtkmarchingcubes this way
vmtkmarchingcubes -ifile foo1.vti -l@ 20 --pipe vmtkmarchingcubes -ifile foo2.vti

Writing classes implementing algorithms and writing actual tools to be used for everyday work are two distinct tasks.
Very often a well-designed object-oriented library ends up to be used in ever-growing collections of shell, Python or Tcl scripts or small C programs, each with its own argument parsing and I/O sections. Very often high-level code is duplicated to provide slightly different functionality. On the other side, writing a GUI is a time-consuming task, and adding new functionality requires time, which might deter experimentation. PypeS goes in the direction of providing a flexible framework for high-level code, both from the user’s and from the developer’s points of view. The user wants to get things done minimizing the work required and the amount of intermediate data generated. The coder wants to limit the amount of code, she/he has to cut and paste (and maintain), and to quickly add new functionality and make it interact with what she/he’s ever written before.

What's New

date icon Monday, November 13, 2017

EPFL has developed an add-on for Blender that loads centerlines generated by VMTK into Blender, and writes meshes from Blender so that they can be easily read by VMTK. The add-on includes a simple mesh-cleaning routine that helps the VMTK tool function better on Blender meshes. There are also a couple tools that perform useful functions using the centerlines in Blender, including generating cross-sectional surfaces, projecting objects (for example vesicle spheres) onto the centerline, and detecting swellings (for example boutons) in the mesh.

The tool is available free for download from GitHub, full instructions with example images are available here:

The tool has been developed part of the NeuroMorph project at EPFL.

Thanks to Anne Jorstad and her team for the effort and contribution.


date-icon Tuesday, October 31, 2017 announcement
vmtk 1.4 for OSX has been released on Oct 31, 20187. We currently distribute vmtk for OSX using conda. Releases for Windows and Linux will...
date-icon Friday, January 22, 2016 announcement
vmtk 1.3 has been released on Jan 22, 2016. We currently distribute vmtk as python egg file for Linux. For Windows7/8 we provide a windows...
date-icon Monday, December 22, 2014 announcement
From Orobix official blog: Today marks an important milestone for Orobix. We release our first product, VMTKLab, an application for image-based modeling of the cardiovascular...
For more, visit our
News archive