# Does Slicer support the batch processing?

**URL:** https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529
**Category:** Support
**Tags:** extensions-manager
**Created:** [April 6, 2018, 5:40pm UTC](https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529 "2018-04-06T17:40:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![glhfgg1024](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/glhfgg1024/32/947_2.png) [@glhfgg1024](https://discourse.slicer.org/u/glhfgg1024)
#### Post date: [April 6, 2018, 5:40pm UTC](https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529/1 "2018-04-06T17:40:23Z")

</div>

Operating system: Windows 10  
Slicer version: 4.8.0  
Expected behavior: batch processing  
Actual behavior: Not sure

Hi there,

I’m on these things: first import the DICOM files into Slicer, then for each patient, I need to save the PET/CT and the RT Structure Set to Nifti format for subsequent processing. Current I need to handle this data case by case. I was wondering if the Slicer can support the batch processing. After we defined a pipeline based on Slicer and the extensions, the batch processing module could repeat the processing automatically and also could record the cases with failure.

Thanks.

---

<div class="post-metadata">

### Author: ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)
#### Post date: [April 6, 2018, 6:08pm UTC](https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529/2 "2018-04-06T18:08:34Z")

</div>

Hello,

This question has been asked many times in the mailing list, for example

> [@RTstruct to Label map](https://discourse.slicer.org/t/rtstruct-to-label-map/2437):
>
> Hi, I have 200 dicom datapoints that contain a image and a RTstruct for the segmentations. I need to convert all RTstructs to Label volumes (maps) and can do this with the segmentations module. However, I have to perform every step manually and I am thus looking for a way to do it batch-wise. Since the segmentations module does not have a CLI, I was wondering if there is another solution that would allow me to access the module without the GUI. Best regards, Alain

and

> [@Slicer batch processing question (--no-main-window --python-script)](https://discourse.slicer.org/t/slicer-batch-processing-question-no-main-window-python-script/1863):
>
> Hi everyone, I am trying to find the best way to quickly batch process a number of folders containing head MRI dicom files to .nii files. Basically the pipeline should work like this: import the dicom files \> load them as a volume \> save the volume as a .nii file. I am trying to do this using the slicer from terminal: Slicer --no-main-window --python-script (as is described in here [https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python\_scripting#How\_to\_access\_a\_scripted\_module\_fro…](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#How_to_access_a_scripted_module_from_python_scripts)

I hope this helps.

---

<div class="post-metadata">

### Author: ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)
#### Post date: [April 6, 2018, 6:15pm UTC](https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529/3 "2018-04-06T18:15:11Z")

</div>

Also you can have a look at the CaseIterator extension. It is currently geared for interactive work, but it would be great to see it extended to also work with batch pipelines.

> **[GitHub - JoostJM/SlicerCaseIterator: Simple Scripted Module to batch process...](https://github.com/JoostJM/SlicerCaseIterator)**
>
> Simple Scripted Module to batch process patients in 3D Slicer - GitHub - JoostJM/SlicerCaseIterator: Simple Scripted Module to batch process patients in 3D Slicer

[https://www.slicer.org/wiki/Documentation/Nightly/Extensions/SlicerCaseIterator](https://www.slicer.org/wiki/Documentation/Nightly/Extensions/SlicerCaseIterator)

---

<div class="post-metadata">

### Author: ![glhfgg1024](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/glhfgg1024/32/947_2.png) [@glhfgg1024](https://discourse.slicer.org/u/glhfgg1024)
#### Post date: [April 6, 2018, 6:36pm UTC](https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529/4 "2018-04-06T18:36:31Z")

</div>

Hi @cpinter and @pieper, thank you very much for your kind reply and suggestions! Very helpful!

---

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [December 24, 2019, 11:50am UTC](https://discourse.slicer.org/t/does-slicer-support-the-batch-processing/2529/5 "2019-12-24T11:50:26Z")

</div>

I installed SlicerCaseIterator and was confused by this wiki. The .csv table should be created including the dir of all volume and segment before load them? Can I save/write a loaded volume and mask segmentation in slicer by this module? I tried to do that but nothing happen even clicking the batch buttom for an empty table.
