# Volume orientation (dcm vs nii.gz)

**URL:** <https://discourse.slicer.org/t/volume-orientation-dcm-vs-nii-gz/44697>\
**Category:** Support\
**Created:** [October 8, 2025, 8:58am UTC](https://discourse.slicer.org/t/volume-orientation-dcm-vs-nii-gz/44697 "2025-10-08T08:58:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [October 8, 2025, 8:58am UTC](https://discourse.slicer.org/t/volume-orientation-dcm-vs-nii-gz/44697/1 "2025-10-08T08:58:28Z")

</div>

Hi all,

I am working with cardiac CT data in two formats: **DICOM** and **NIfTI (.nii.gz)**.

I am trying to automate some processes related to the placement of fiducials, but I’ve noticed an unexpected behavior:

- When I load a **DICOM volume** , the largest **K index (IJK axial coordinate)** corresponds to the superior end of the body (closest to the neck).
- When I load a **NIfTI (.nii.gz) volume**, the superior slice has index **0** instead.

My question is: **How can I reliably determine the slice order in the K (axial) dimension, regardless of the input format?**

Thanks in advance!

---

<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:** [October 8, 2025, 9:09am UTC](https://discourse.slicer.org/t/volume-orientation-dcm-vs-nii-gz/44697/2 "2025-10-08T09:09:07Z")

</div>

They are in a different orientation (RAS vs LPS). I suggest reading this page:

> **[Coordinate systems — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/coordinate_systems.html)**

There is a section about nifti on the bottom.

Let us know if you have further questions.

---

<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:** [October 9, 2025, 2:24am UTC](https://discourse.slicer.org/t/volume-orientation-dcm-vs-nii-gz/44697/3 "2025-10-09T02:24:07Z")

</div>

> How can I reliably determine the slice order in the K (axial) dimension, regardless of the input format?

You cannot do this independently from the input format, because for DICOM images this may be impossible. Each slice in a DICOM series has arbitrary orientation: they don’t have to be parallel, they can intersect each other, you can even have many slices at the same spatial position.

Many software packages can reconstruct regularly spaced 3D Cartesian volumes from the arbitrarily set of DICOM image slices. This operation may be a simple ordering of the slices, or it can be a complex non-linear reconstruction if the slices are irregularly spaced, tilted, or not parallel. The result of the 3D reconstruction is a voxel array and a homogeneous transformation matrix that maps between IJK indices of the array and the anatomical coordinate system. All you need to interpret the image data is this transformation matrix.
