ImageSeries Reader reads dicom series in reverse order by default?

Hi I am trying to read CT scan dicom series using Simple ITK ImageSeriesReader() In order verify each image slice I also load the CT scan in osirix image viewer. After reading from series reader when I load sample slices from 3D image I observed that slice 0 actually represents last Image in Osirix image viewer. Is the reading order reversed? Thanks Jiten

Slices in ITK are ordered by their image position patient tags. I don’t know how OsiriX orders them.

1 Like

You might also be interested in this explanation.


Here is an example on how to read a DICOM image series in SimpleITK:

If you have more than one DICOM series in the directory you may need to use sitk:ImageFileReader:: GetGDCMSeriesIDs.


Thanks @dzenanz this is great information. Once the information is read by ITK series reader, Can we sort the order by Z of the image and then rewrite it? Thanks, Jiten.

Thanks @blowekamp I did write the code to read the series from the link you sent. In the use case I am solving we will get only one series, but I will keep note of this info when I bump into use case that would have multiple series. Thanks Jiten.

Note that one of the voxel (IJK) coordinates often looks similar to DICOM slice (instance) number (for example, you may find that instance number = k+1 or N-k+1), but you cannot rely on this. Each application can decide how it defines voxel coordinates. Only physical (LPS) coordinates and DICOM slice numbers are guaranteed to be consistent between applications.

If you need to compute DICOM slice number then you can read image position, image orientation, and instance number tags for each DICOM slice and use this to find a slice corresponding to a a physical (LPS) point position.

1 Like

Thanks @lassoan. Based on given information, I would not mess with the image that is read by simpleITK from series. Instead I can easlily tweak my logic to read it the way ITK has read the series into image. Thanks, Jiten