itkDCMTKFileReader Spacing Issue
Description
We recently received an MRI volume, saved as MRExtendedStorage, which has this tag structure (reduced to only those tags relevant to spacing):
# Dicom-Data-Set
SpacingBetweenSlices [1.3]
PerFrameFunctionalGroupsSequence
| Item
| | MREchoSequence
| | PixelMeasuresSequence
| | | Item
| | | | PixelSpacing [0.55000001192092\0.55000001192092]
| | Unknown Tag & Data
| | | Item
| | | | SpacingBetweenSlices [1.3]
PerFrameFunctionalGroupsSequence
| Item
| | MREchoSequence
| | PixelMeasuresSequence
| | | Item
| | | | PixelSpacing [0.55000001192092\0.55000001192092]
| | Unknown Tag & Data
| | | Item
| | | | SpacingBetweenSlices [1.3]
PerFrameFunctionalGroupsSequence
| Item
| | MREchoSequence
| | PixelMeasuresSequence
| | | Item
| | | | PixelSpacing [0.55000001192092\0.55000001192092]
| | Unknown Tag & Data
| | | Item
| | | | SpacingBetweenSlices [1.3]
...
We are trying to read this file with itk DCMTKFileReader, and in GetSpacing, the spacing values are not decoded properly. The global SpacingBetweenSlices tag is ignored since there is no global PixelSpacing tag, and the per-slice SpacingBetweenSlices is not used because it is not located in the PixelMeasuredSequence. As a result, the spacing [0.55, 0.55, 1.0] is returned, which is clearly not correct.
Steps to Reproduce
See above. I can supply the file if needed.
Expected behavior
Spacing [0.55, 0.55, 1.3] should be returned.
Actual behavior
Spacing [0.55, 0.55, 1.0] is returned, which is not correct.
Reproducibility
100%
Versions
Release 5.3.0, but the relevant portion of itkDCMTKFileReader.cpp is unchanged since.
Environment
Windows, VS2022, 64bit.
Additional Information
I have implemented a fix which I would like to share, but I would ask someone with a deeper knowledge of DICOM to review.
Thank you for contributing an issue! 🙏
Welcome to the ITK community! 🤗👋☀️
We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜 Also, please check existing open issues and consider discussion on the ITK Discourse. 📖
@hossbach-cgm thanks for the report. Could you please create a PR with your patch, which will help facilitate discussion.
@hossbach-cgm thank you!
# Dicom-Data-Set SpacingBetweenSlices [1.3] PerFrameFunctionalGroupsSequence | Item | | MREchoSequence | | PixelMeasuresSequence | | | Item | | | | PixelSpacing [0.55000001192092\0.55000001192092] | | Unknown Tag & Data | | | Item | | | | SpacingBetweenSlices [1.3]
Do you have this data set?
ftp://medical.nema.org/MEDICAL/Dicom/DataSets/WG16/Philips/
eg in the folder Philips MR Spectroscopy/DICOM, eg the file IM_0001
There is in fact SpacingBetweenSlices at the top level and not in the PixelMeasuresSequence in a functional group sequence.
And private sequence 0x2005, 0x140f, there are probably tags from original "classic series", also SpacingBetweenSlices.
This private attribute may be Acquisition Parameters (Philips) Sequence (creator Philips MR Imaging DD 005 ).
It is not ideal, SpacingBetweenSlices at the top level doesn't belong to Enhanced MR Image Storage, it should be in PixelMeasuresSequence, at least with the current standard. I don't know if Philips always does this, as far as I know, in real life "enhanced" CT/MR are rare, usually there are still classic series.
I am facing the same issue with simpleItk where the spacing should be [0.125,0.125,0.125] but [0.125,0.125,1.0] is returned.
Closing via #4134