# DICOM to NIFTI conversion

**URL:** <https://discourse.slicer.org/t/dicom-to-nifti-conversion/11124>\
**Category:** Support\
**Tags:** segmentation, dicom\
**Created:** [April 15, 2020, 12:15pm UTC](https://discourse.slicer.org/t/dicom-to-nifti-conversion/11124 "2020-04-15T12:15:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickychen](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@rickychen](https://discourse.slicer.org/u/rickychen)\
**Post date:** [April 15, 2020, 12:15pm UTC](https://discourse.slicer.org/t/dicom-to-nifti-conversion/11124/1 "2020-04-15T12:15:21Z")

</div>

Operating system: Windows 10  
Slicer version: 4.10.2

Hi guys,

I’m wondering if someone knows how Slicer deals with the DICOM to NIFTI conversion? More specifically, what packages or tools do they use to achieve this? Is there any source code online on Slicer repo?

I know in Slicer, the DICOM file can be loaded into the scene and saved as various formats like .nrrd or NIFTI.

Best regards,  
Ricky

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [April 15, 2020, 3:45pm UTC](https://discourse.slicer.org/t/dicom-to-nifti-conversion/11124/2 "2020-04-15T15:45:36Z")

</div>

Slicer loads from DICOM into its internal representation (vtkImageData) using a number of libraries. mostly GDCM and DCMTK. It then uses ITK file writers to create the NIFTI image.

---

<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 15, 2020, 3:47pm UTC](https://discourse.slicer.org/t/dicom-to-nifti-conversion/11124/3 "2020-04-15T15:47:34Z")

</div>

> [@rickychen](#):
>
> More specifically, what packages or tools do they use to achieve this? Is there any source code online on Slicer repo?

The code with DICOM in the name here is a place to start, but this code itself relies on multiple libraries:

> <https://github.com/Slicer/Slicer/tree/main/Modules/Scripted>
>
> //github.com/Slicer/Slicer/tree/main/Modules/Scripted

Also this thread may help you:

> [@How to convert dicom files to nrrd](https://discourse.slicer.org/t/how-to-convert-dicom-files-to-nrrd/540/12):
>
> You can also consider one of the many tools out there that are much easier to use than Slicer for batch volume reconstruction (faster, easier to use, possibly more robust). You can find a list of some of the most popular ones (incomplete, I am sure) here: [https://na-mic.github.io/ProjectWeek/PW27\_2018\_Boston/Projects/DICOMVolumeReconstruction/](https://na-mic.github.io/ProjectWeek/PW27_2018_Boston/Projects/DICOMVolumeReconstruction/). A number of them (including Slicer converters) are set up in this dockerfile: [https://github.com/QIICR/dcmheat/blob/master/docker/Dockerfile](https://github.com/QIICR/dcmheat/blob/master/docker/Dockerfile) (just noti…
