We have several datasets with poorly formatted DICOM images. These datasets come from the same source and have the same problem. The first file in the series slightly differs in several DICOM tags from the rest files.
Here is an example of differences between first and second files:
As you can see, the main difference is the addition of trailing zeros only in the first file in the following tags: SliceThickness, SpacingBetweenSlices, ReconstructionDiameter, GantryDetectorTilt, ImageOrientationPatient and RescaleSlope.
Since ITK-SNAP uses tag SliceThickness for computation of unique ID for image series, the whole dataset is split in two parts: the first sole file, and all remaining files. This behavior is acceptable when we work with a static 3D image, we can ignore the first slice and just work with slightly shorter image. However, it is impossible to open 4D images, since the first missing slice breaks the dimensions. A possible workaround is to manually delete all first slices from all time frames, which is not very user-friendly and quite tedious.
I propose to add several workarounds to allow loading of such malformed 4D CTA DICOM files. At first, we remove the trailing zeros from fractional part of SliceThickness tag, thus combining all files in one dataset. Next, we add a fallback sorting to MFOrderByIPPStrategy in case IPPSorter fails. The last change is needed since IPPSorter will fail if Gantry/Detector Tilt tag is not unique, resulting in wrong orientation of the first frame in the dynamic dataset.
We have several datasets with poorly formatted DICOM images. These datasets come from the same source and have the same problem. The first file in the series slightly differs in several DICOM tags from the rest files. Here is an example of differences between first and second files:
The difference between the second file and the third file is quite small:
As you can see, the main difference is the addition of trailing zeros only in the first file in the following tags:
SliceThickness
,SpacingBetweenSlices
,ReconstructionDiameter
,GantryDetectorTilt
,ImageOrientationPatient
andRescaleSlope
.Since ITK-SNAP uses tag
SliceThickness
for computation of unique ID for image series, the whole dataset is split in two parts: the first sole file, and all remaining files. This behavior is acceptable when we work with a static 3D image, we can ignore the first slice and just work with slightly shorter image. However, it is impossible to open 4D images, since the first missing slice breaks the dimensions. A possible workaround is to manually delete all first slices from all time frames, which is not very user-friendly and quite tedious.I propose to add several workarounds to allow loading of such malformed 4D CTA DICOM files. At first, we remove the trailing zeros from fractional part of
SliceThickness
tag, thus combining all files in one dataset. Next, we add a fallback sorting toMFOrderByIPPStrategy
in caseIPPSorter
fails. The last change is needed sinceIPPSorter
will fail ifGantry/Detector Tilt
tag is not unique, resulting in wrong orientation of the first frame in the dynamic dataset.