# Script Python - Automatization using several extensions.

**URL:** <https://discourse.slicer.org/t/script-python-automatization-using-several-extensions/26170>\
**Category:** Development\
**Tags:** extensions-manager, python\
**Created:** [November 9, 2022, 5:18pm UTC](https://discourse.slicer.org/t/script-python-automatization-using-several-extensions/26170 "2022-11-09T17:18:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucas\_sd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lucas_sd/32/17087_2.png) [@lucas\_sd](https://discourse.slicer.org/u/lucas_sd)\
**Post date:** [November 9, 2022, 5:18pm UTC](https://discourse.slicer.org/t/script-python-automatization-using-several-extensions/26170/1 "2022-11-09T17:18:05Z")

</div>

Hi everyone,

Currently, Im using the modules Extract Centerline and Curved Planar Reformat, in order to obtain a straightened volume from a data set DICOM.

I have to do that for several examples, so I wondering if is possible to create a python script to automate the process; just charge the segmentation and points like the imput of the script, and obtain a straightened volume like the output.

Its possible this? Which is the way/syntax to interact with the input and output of each module? There are some examples about that? Or maybe an anorher way?

The workflow is:  
inputs\_1 (points and segmentation)  
Center line code  
Output\_1(center line)  
Inputs\_2(center line and data)  
Straightened volume  
Output\_2(Straightened volume)

Thanks, Lucas.

---

<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:** [December 1, 2022, 7:25am UTC](https://discourse.slicer.org/t/script-python-automatization-using-several-extensions/26170/2 "2022-12-01T07:25:26Z")

</div>

Yes, this should not be too hard, even if you are completely new to Slicer. After you completed the Slicer programming tutorial (I would recommend [this one](https://www.slicer.org/wiki/Documentation/Nightly/Training#PerkLab.27s_Slicer_bootcamp_training_materials), but there are many more on youtube), you can have a look at examples in the [script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html) and self-tests in VMTK and other extensions and ask here if you have any specific questions.

---

<div class="post-metadata">

**Author:** ![lucas\_sd](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lucas_sd/32/17087_2.png) [@lucas\_sd](https://discourse.slicer.org/u/lucas_sd)\
**Post date:** [December 2, 2022, 6:49pm UTC](https://discourse.slicer.org/t/script-python-automatization-using-several-extensions/26170/3 "2022-12-02T18:49:39Z")

</div>

Thanks! Finally, I could understand how to call or work with other modules from my script.

In the case of the module _curved planar reformat_, I imported the module and then I copied and edited the test case in terms of my variables and preferences. This also allowed me to understand precisely the importance of the logical class.
