Automate loading, editing and exporting with no user interaction

Greetings.

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 (http://apidocs.slicer.org/master/) 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.

Thanks!

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):

https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script

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

1 Like