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?
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).