# Automate loading, editing and exporting with no user interaction

**URL:** <https://discourse.slicer.org/t/automate-loading-editing-and-exporting-with-no-user-interaction/4129>\
**Category:** Development\
**Created:** [September 17, 2018, 4:20am UTC](https://discourse.slicer.org/t/automate-loading-editing-and-exporting-with-no-user-interaction/4129 "2018-09-17T04:20:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![javi0unavailable](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@javi0unavailable](https://discourse.slicer.org/u/javi0unavailable)\
**Post date:** [September 17, 2018, 4:20am UTC](https://discourse.slicer.org/t/automate-loading-editing-and-exporting-with-no-user-interaction/4129/1 "2018-09-17T04:20:18Z")

</div>

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/](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!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [September 17, 2018, 4:27am UTC](https://discourse.slicer.org/t/automate-loading-editing-and-exporting-with-no-user-interaction/4129/2 "2018-09-17T04:27:11Z")

</div>

> [@javi0unavailable](#):
>
> Import and Load DICOM from a specified folder.

This is described in this topic: [Load DICOM series using python - #2 by cpinter](https://discourse.slicer.org/t/load-dicom-series-using-python/3257/2)

> [@javi0unavailable](#):
>
> - 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

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](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script)

> [@javi0unavailable](#):
>
> I see I can open Slicer from command line

Probably the simplest is to [specify a Python script that Slicer will execute](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#How_can_I_run_slicer_operations_from_a_batch_script.3F).
