# How to open multiple DICOM series using python script

**URL:** https://discourse.slicer.org/t/how-to-open-multiple-dicom-series-using-python-script/27861
**Category:** Development
**Tags:** dicom, python
**Created:** [February 16, 2023, 11:56am UTC](https://discourse.slicer.org/t/how-to-open-multiple-dicom-series-using-python-script/27861 "2023-02-16T11:56:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anhhtmsc](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/anhhtmsc/32/18426_2.png) [@anhhtmsc](https://discourse.slicer.org/u/anhhtmsc)
#### Post date: [February 16, 2023, 11:56am UTC](https://discourse.slicer.org/t/how-to-open-multiple-dicom-series-using-python-script/27861/1 "2023-02-16T11:56:50Z")

</div>

Hello everyone,  
I want to use the WebServer module of 3D Slicer to make a WADO Server. I can load DICOM files into the scene from a folder. I need to open multiple DICOM series simultaneously, then control the volumes to return a slice corresponding to a request. How can I do this?  
Thank you, everyone!

---

<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: [February 16, 2023, 2:53pm UTC](https://discourse.slicer.org/t/how-to-open-multiple-dicom-series-using-python-script/27861/2 "2023-02-16T14:53:56Z")

</div>

The WebServer already has a basic WADO mode (enough to support the OHIF viewer anyway, but not fully standards compliant). Code contributions to improve this mode would be welcome!

For full flexibility, it might be more efficient to use the `exec` API to run python code in Slicer to do all your dicom operations. There are lots of ways to accomplish what you describe so please post any example code you develop and let us know if you run into roadblocks.

---

<div class="post-metadata">

### Author: ![anhhtmsc](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/anhhtmsc/32/18426_2.png) [@anhhtmsc](https://discourse.slicer.org/u/anhhtmsc)
#### Post date: [February 17, 2023, 9:58am UTC](https://discourse.slicer.org/t/how-to-open-multiple-dicom-series-using-python-script/27861/3 "2023-02-17T09:58:19Z")

</div>

For now, I can load multiple volumes, and get the arrays from them to return a slice corresponding to a request. (I need the array to return slices for different directions - axial, sagittal, coronal). For example:

```auto
volumeNode1 = slicer.util.loadVolume("path_to_series_1", {"singleFile": False, "show": False})
volumeArray1 = slicer.util.arrayFromVolume(volumeNode1)

```

With a volume loaded, I can render a 3D image for a volume with the following code, but I don’t know how to render multiple 3D images in different threeDView for different volumes. Can I do this or it’s only possible to render a 3D image for only one volume with one Slicer instance?

```auto
volRenLogic = slicer.modules.volumerendering.logic()
volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode1)

```

Thank you very much for your response!

---

<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: [February 17, 2023, 3:09pm UTC](https://discourse.slicer.org/t/how-to-open-multiple-dicom-series-using-python-script/27861/4 "2023-02-17T15:09:06Z")

</div>

You have pretty much full control through the python api in terms of which volumes to show in which 3D views or even create new views of arbitrary size. Maybe the best is to browse the [script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#volumes) to get a sense of what’s possible and let us know if you get stuck.
