# DICOM export from Slicer

**URL:** <https://discourse.slicer.org/t/dicom-export-from-slicer/36337>\
**Category:** Support\
**Tags:** dicom, python\
**Created:** [May 23, 2024, 3:04am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337 "2024-05-23T03:04:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![khajta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/khajta/32/76581_2.png) [@khajta](https://discourse.slicer.org/u/khajta)\
**Post date:** [May 23, 2024, 3:04am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/1 "2024-05-23T03:04:06Z")

</div>

Dear experts,

I use 3D Slicer for registering SPECT images at different time points. However, the exported DICOM files of all series show different voxel sizes between Python code (which shows the voxel size as 1.95313, 1.95313, 1) and DICOM viewer tools such as Slicer, MicroDICOM, and ImageJ (which show the voxel size as 1.95313, 1.95313, 1.95313). However, when I use this code and DICOM viewer tool with original DICOM images, they show the voxel dimensions as 1.95313, 1.95313, 1.95313."

My python code to extract pixel dimension is

> > img.SetSpacing(dicom\_images.GetSpacing())  
> > print(img.GetSpacing())

Best regards,  
Khajonsak

---

<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:** [May 23, 2024, 3:18am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/2 "2024-05-23T03:18:28Z")

</div>

Spacing between slices is determined from “Image Position Patient” values.

---

<div class="post-metadata">

**Author:** ![khajta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/khajta/32/76581_2.png) [@khajta](https://discourse.slicer.org/u/khajta)\
**Post date:** [May 23, 2024, 3:24am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/3 "2024-05-23T03:24:38Z")

</div>

Thank you for your response.

I want to clarify my understanding that the thickness should be get from dicom header of export file right?

Morover, which kind of export should be exported for SPECT, scalar volume or RT? What is the difference between both?

Best regard.

---

<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:** [May 23, 2024, 3:27am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/4 "2024-05-23T03:27:26Z")

</div>

> [@khajta](#):
>
> I want to clarify my understanding that the thickness should be get from dicom header of export file right?

Slice thickness value is irrelevant. It must not be used for determining the image geometry (origin, spacing, axis directions).

> [@khajta](#):
>
> Morover, which kind of export should be exported for SPECT, scalar volume or RT?

I don’t know what you mean by “RT”.

---

<div class="post-metadata">

**Author:** ![khajta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/khajta/32/76581_2.png) [@khajta](https://discourse.slicer.org/u/khajta)\
**Post date:** [May 23, 2024, 3:31am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/5 "2024-05-23T03:31:11Z")

</div>

RT is the second one of DICOM export option.

 ![Screenshot 2567-05-23 at 12.29.40](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/3/73c0bcc3437d56dda0a25402aa6fa03f33cc9947.png)

---

<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:** [May 23, 2024, 12:33pm UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/6 "2024-05-23T12:33:51Z")

</div>

I see, OK. RT is for radiationntherapy export (export of segmentation as RT structure set, transform as spatial registration object, and associated images). It is not relevant for SPECT.

Note that the exported SPECT image may need some additional fields - check the generated files if they contain all required fields described in the DICOM standard for this information object type; or use [David Clunie’s DICOM verifier](https://www.dclunie.com/dicom3tools/dciodvfy.html).

---

<div class="post-metadata">

**Author:** ![khajta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/khajta/32/76581_2.png) [@khajta](https://discourse.slicer.org/u/khajta)\
**Post date:** [May 24, 2024, 4:01am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/7 "2024-05-24T04:01:45Z")

</div>

Thank you for your kind suggestion.

I have one more error that I tried to export the SPECT as scalar volume, but it has error as attached images.

 ![Screenshot 2567-05-24 at 12.57.54](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c29fa5786628065b22d74dbf33e1ce29af565851.jpeg)  
 ![Screenshot 2567-05-24 at 13.01.03](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/e/1e655273443639534ef786fd57796af604d76488.png)  
 ![Screenshot 2567-05-24 at 13.00.56](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/7/07c97e8fc27495fbf75d32e7d4d25546257ef623.png)

---

<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:** [May 24, 2024, 10:56am UTC](https://discourse.slicer.org/t/dicom-export-from-slicer/36337/8 "2024-05-24T10:56:44Z")

</div>

I don’t see any error message that tells why export failed. Could you please provide the full application log as text (menu: help / report a bug, so not delete any lines from it, but if there are any details you dont want to ahare then replace them by ` ***** `).

You could also try first with `Export to folder` option disabled.
