Automate import-segmentation-export process for bronchial tree


I have used 3DSlicer for a few years now, but have not attempted to automate any processes.

My group is interested in segmenting air-filled structures and cavities, which ends-up becoming a very simple and consistent task with thresholding.

Therefore, we would like to know if there is a way of;

  • Automating the tasks of: (1) importing DICOM, (2) segmenting using threshold, (3) exporting .STL


  • If said automated operation can be triggered externally via command line, perhaps execute a script that tells slicer to perform these operations?

What is your current workflow? What cavities you segment? Can you post a few screenshots?

What do you do with the exported STL? Have you considered doing automating further processing steps (identification of structures, measuring volumes, etc.) in Slicer?


Thank you for the response!

First of all, our “semi-automated workflow” uses Slicer and Houdini. All of the segmentation and clean-up is done in Slicer, the rest is done in Houdini.

  1. Import CT [Slicer]

  2. Create Region of Interest [Slicer]
    2.1. This is one of the parts the we are most interesting in automating
    2.2. We are creating this region of interest to segment most of the airway without the external components (air outside of the model), but also most of the trachea and lungs
    2.3. The model on these pictures is not representative of an amazing result, as some of the external air and lungs are still present – I just wanted you to see what I mean

  1. Crop Volume using ROI [Slicer]
    3.1. Crop volume using ROI and generate an isotropic volume (pixelwise)

  2. Segment Airway [Slicer]
    4.1. Segment airway using threshold tool and defaults for airway under CT

  1. Export as STL

------------------------------------------- The next steps are done in Houdini -------------------------------------------

It is a little harder to explain the following steps without using the Houdini terminology but, in a nutshell;

  1. Import .STL
  2. Create a point-cloud from the volume enclosed by the .STL
  3. Select a starting and end point (mouth, epiglottis)
  4. Automatically determine a path between the starting and end point
  5. Extrude a part that follows said path

--------------------------------------------------- What are we looking for? --------------------------------------------------

  1. How much of Slicer process can be automated? Scripted?
  2. Can this process be executed through a terminal?


  1. How much of what is done in Houdini can be done in Slicer? (open to this)
  2. Could it be scripted, automated, perhaps made into a plugin? (very open to this)

Sorry for the wait and thank you for your help!
P.S. I could only add 3 images because I am a N00B

All the tools that are needed to fully automate this processing workflow are already available in Slicer.

  • Extract airways using Chest Imaging Platform or Segment Editor tools (such as Fast Marching or Local thresholding)
  • Extract bronchial tree centerline using VMTK extension’s “Centerline extraction” module
  • Use this centerline model to get shortest path between two points by using the markups curve module (Curve settings / Curve type -> Shortest distance on surface; Model node -> CenterlinComputationModel)
  • Use a vtkTubeFilter to create a tube model around the selected curve

See a short video of the how shortest path is found in real-time in the bronchial tree:

1 Like


Thank you!
We will look over this and see if we have any additional questions

1 Like