Skip to content
3D airway mesh modelling and projection onto 2D
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Mesh and Principal Component Silhouette Projection

This is the demo code for the following paper,

Benjamin Irving, Tania Douglas, Paul Taylor. 2D X-ray airway tree segmentation by 3D deformable model projection and registration

To be presented at the Fifth International Workshop on Pulmonary Image Analysis (

Note that only the mesh operations and not the optimisation method is included at the moment due to the challenge of finding 2D x-ray data that can be released. Please contact me if you would like the remainder of the code.


Python libraries:

  • time, copy, os
  • pickle
  • matplotlib
  • numpy
  • scipy
  • mayavi


The c++ component needs to first be compiled for your os and wrapped for python using swig. (Only tested on linux so far)

  • Requirements: swig

Using linux:

cd mesh3D_mod
swig -c++ -python -o sc_wrap.cpp sc.i
gcc -fPIC $(python-config --includes) -c sc_wrap.cpp sc.cpp
g++ -shared sc_wrap.o sc.o -o

sc.i - Settings that define the swig compilation sc.cpp -c++ class code. - Automatically created. Provides the link between the two languages.

This c++ object is now callable from the python 3D processing class.

##Running Examples Example 1 - Finding a mesh silhouette: python (this example is slow because silhouette detection is applied to a very large mesh)

Example 2 - Plotting example variation of the statistical shape model: python

Example 3 - Projecting the mean statistical shape model along with landmark points and centreline: python

Example 4 - Rigid alignment

Example 5 - Shape optimisation


##Example Outputs

Example 1:

alt text

Example 2 - Example variation 3 standard deviations along the 2nd mode of variation:

alt text alt text

Example 3:

alt text

You can’t perform that action at this time.