Script Python - Automatization using several extensions.

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.

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, but there are many more on youtube), you can have a look at examples in the script repository and self-tests in VMTK and other extensions and ask here if you have any specific questions.

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.