Skip to content

Commit

Permalink
BUG: Regression for scans with negative spacing in DICOM
Browse files Browse the repository at this point in the history
Fixes Slicer#7937

See original report here about a dataset being scrambled that loaded well
in the 5.6.2 release:

https://discourse.slicer.org/t/regression-in-the-dicom-data-base/37913

This corresponds to the change in behavior described here, where spacing
from ITK that used to be 1 is now, for example 5 or -1:

InsightSoftwareConsortium/ITK#4794

Which is believed to be due to the changes here, which was
added so that for Secondary Capture files the spacing would
be respected if present:

InsightSoftwareConsortium/ITK#4521

However adding this code in GDCM meant that if the SpacingBetweenSlices
tag is present, even in a CT, it is being used by ITK to calculate
spacing, and also ITKToRAS transforms when trying to orthogonalize
the transform.

Since Slicer doesn't rely on orthogonal IJKToRAS transforms, this change
tells ITK to skip that step and instead it relies on the positions
and orientations of the slices to calculate the IJKToRAS transform, which
is compatible with what Slicer expects.

This code was tested on both the CT scan with the negative spacing that
was reported in the original issue, and on other CT cans without that
tag and the geometry matches what was obtained in 5.6.2.

This change was discussed in the Slicer developer meeting 2024-10-08 and
determined to be the best course of action.  Further fixes in GDCM or
ITK were not pursued because it was unclear whta the correct behavior
should be at the library level considering that a negative spacing
between slices is technically invalid for CT scans according to
the DICOM standard.
  • Loading branch information
pieper committed Oct 8, 2024
1 parent 56edfa2 commit b1d4e1c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libs/vtkITK/vtkITKArchetypeImageSeriesReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ int vtkITKArchetypeImageSeriesReader::RequestInformation(
itk::ImageSeriesReader<ImageType>::New();
seriesReader->SetFileNames(this->FileNames);
seriesReader->SetImageIO(imageIO);
seriesReader->SetForceOrthogonalDirection(false);
if (this->UseNativeCoordinateOrientation)
{
filter = seriesReader;
Expand Down

0 comments on commit b1d4e1c

Please sign in to comment.