Automate loading, editing and exporting with no user interaction


I want to help a doctor friend to achieve what the title says. I have no idea from medical argot but I know about software development.

Basically what I need is to know the easiest way to automate a few steps:

  • Import and Load DICOM from a specified folder.
  • Use Editor module with ThresholdEffect (submodule?) to adjust the lower threshold with a specified number.
  • Again, use Editor module now with MakeModelEffect to generate 3d model
  • Export model generated in .stl

I see I can open Slicer from command line but don’t know if is possible to execute all I described before from command line.

Other way I see is developing a new custom module with Python that ‘calls’ the others modules (load DICOM, ThresholdEffect, MakeModelEffect, Export). I found an API ( but I could not find any like ThresholdEffect method or something.

So… command line? new python module? other way?

Hope you can point me the right direction.


This is described in this topic: Load DICOM series using python - #2 by cpinter

Use Segment Editor module instead (the legacy Editod module is being phased out). See example for simple thresholding and model generation here (in particular, skin surface extraction example shows everything you need):

Probably the simplest is to specify a Python script that Slicer will execute.

1 Like