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.2 released!

Segmentation

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

Centerlines

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 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.

Pypes

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

news
date icon Thursday, September 04, 2014
  • vmtkmeshreader now supports VTK XML parallel file format ( .pvtu files ).

  • vmtkmeshmergetimesteps can handle mesh files with velocity component arrays or velocity vector.

Those features are available in the vmtk development version and they will be added in the next binary release of vmtk (1.3).

Recently...

date-icon Wednesday, February 19, 2014 news
A new set of color maps has been added to vmtk development version. Check out the new tutorial and learn how to handle different color...
date-icon Friday, January 24, 2014 announcement
vmtk 1.2 has been released! This release includes binaries for all platforms. We currently distribute vmtk as python egg file for Linux, MacOSX 10.9 and...
date-icon Thursday, December 19, 2013 announcement
As you have properly noticed we just released our brand new vmtk website. We hope you like it and please let us know about improvements...
For more, visit our
News archive