# Does SimpleITK image read from dicom series reflect the view of a 3D-object (axial, coronal and sagital)?

**URL:** https://discourse.itk.org/t/does-simpleitk-image-read-from-dicom-series-reflect-the-view-of-a-3d-object-axial-coronal-and-sagital/3569
**Category:** Uncategorized
**Tags:** python, dicom, simpleitk
**Created:** [October 24, 2020, 10:05am UTC](https://discourse.itk.org/t/does-simpleitk-image-read-from-dicom-series-reflect-the-view-of-a-3d-object-axial-coronal-and-sagital/3569 "2020-10-24T10:05:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nguyenhoa93](https://discourse.itk.org/user_avatar/discourse.itk.org/nguyenhoa93/32/1760_2.png) [@nguyenhoa93](https://discourse.itk.org/u/nguyenhoa93)
#### Post date: [October 24, 2020, 10:05am UTC](https://discourse.itk.org/t/does-simpleitk-image-read-from-dicom-series-reflect-the-view-of-a-3d-object-axial-coronal-and-sagital/3569/1 "2020-10-24T10:05:42Z")

</div>

Hi,  
I am using SimpleITK to read 3D-CT scans from DICOM folders. My scans can belong to any of 3 views: axial, coronal, and sagittal. I did like this:

```auto
import SimpleITK as sitk
dicom_names = sitk.ImageSeriesReader().GetGDCMSeriesFileNames(<path_to_dcom_folder>)
img = sitk.ReadImage(dicom_names)

```

I would like to know the view of the image to standardize them into the axial view. When I read this [Fundamental Concepts](https://simpleitk.readthedocs.io/en/master/fundamentalConcepts.html), I think that ImageDirection can reflect the view so I try to observe this attribute:

```auto
img.GetDirection()

```

In most of the cases, the corresponding direction of:

- Axial: (1,0,0,0,1,0,0,0,1)
- Coronal: (1,0,0,0,0,1,0,-1,0)
- Sagittal: (0,0,-1,1,0,0,0,-1,0)  
However, it is not consistent. Sometimes, Sagittal view has direction of `(1,0,0,0,1,0,0,0,1)` as well.  
Is there any attribute from ITK image read from dicom series reflecting the view of the image?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [October 24, 2020, 10:56am UTC](https://discourse.itk.org/t/does-simpleitk-image-read-from-dicom-series-reflect-the-view-of-a-3d-object-axial-coronal-and-sagital/3569/2 "2020-10-24T10:56:00Z")

</div>

Please see the`[DICOMOrientImageFitler](https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1DICOMOrientImageFilter.html)`. Specifically the `[GetOrientationFromDirectionCosines`]([https://simpleitk.org/doxygen/latest/html/classitk\_1\_1simple\_1\_1DICOMOrientImageFilter.html#acaf19fac35023e3da9ba3eb56190ada0](https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1DICOMOrientImageFilter.html#acaf19fac35023e3da9ba3eb56190ada0)) method. It can be use like:

```auto
In [9]: sitk.DICOMOrientImageFilter_GetOrientationFromDirectionCosines(np.ravel(np.eye(3)))
Out[9]: 'LPS'

```

---

<div class="post-metadata">

### Author: ![nguyenhoa93](https://discourse.itk.org/user_avatar/discourse.itk.org/nguyenhoa93/32/1760_2.png) [@nguyenhoa93](https://discourse.itk.org/u/nguyenhoa93)
#### Post date: [October 24, 2020, 11:53am UTC](https://discourse.itk.org/t/does-simpleitk-image-read-from-dicom-series-reflect-the-view-of-a-3d-object-axial-coronal-and-sagital/3569/3 "2020-10-24T11:53:11Z")

</div>

> [@blowekamp](#):
>
> `sitk.DICOMOrientImageFilter_GetOrientationFromDirectionCosines(np.ravel(np.eye(3)))`

Thanks, I am using SimpleITK version 1.2.4 and it doesn’t have `DICOMOrientImageFilter_GetOrientationFromDirectionCosines`. Which version are you using?

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [October 24, 2020, 1:53pm UTC](https://discourse.itk.org/t/does-simpleitk-image-read-from-dicom-series-reflect-the-view-of-a-3d-object-axial-coronal-and-sagital/3569/4 "2020-10-24T13:53:36Z")

</div>

Hello @nguyenhoa93,

This functionality is available in the current version of simpleitk, 2.0.1. I highly recommend updating your version as there have been many upgrades and bug fixes to the toolkit. There were also API changes so you may have to modify your existing code base (see [migration guide](https://simpleitk.readthedocs.io/en/master/migrationGuide2.0.html) for details).
