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

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:

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, I think that ImageDirection can reflect the view so I try to observe this attribute:

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?

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) method. It can be use like:

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

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

1 Like

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 for details).

2 Likes