Skip to content

GDCM ignores image geometry in secondary captures #4109

Closed
@pieper

Description

@pieper

Description

Secondary capture images can optionally have ImageOrientationPatient and PixelSpacing fields, but GDCM currently forces the orientation to identity and looks for NominalScannedPixelSpacing instead of PixelSpacing, so otherwise valid images are loaded incorrectly.

There is more information in the discussion at this PR:

Slicer/Slicer#7089

Steps to Reproduce

The data available from the idc-open-data set on aws is the Visible Human Project male dataset converted to dicom by @dclunie.

You can get one file with this command:

aws s3 cp --no-sign-request s3://idc-open-data/4aaf9181-fb6a-4a4c-bf49-d1eb9ed4a385/fbc89e1c-29c4-48cf-89fd-53b7c1dc1488.dcm .

Or the whole dataset using this command (about 13 gigabytes).

s5cmd --no-sign-request --endpoint-url https://s3.amazonaws.com cp 's3://idc-open-data/4aaf9181-fb6a-4a4c-bf49-d1eb9ed4a385/*' .

Expected behavior

The index to physical transform should be correctly populated.

Actual behavior

The direction cosines are explicitly set of identity:

https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx#L731-L740

The PixelSpacing is ignored, and the NominalScannedPixelSpacing is looked for, but is typically absent.

https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx#L1265-L1273

Reproducibility

Always

Versions

Tested on current main branch, but I suspect the code has been around for decades.

Environment

Any

Additional Information

I'll probably fix this, although it may not be a high priority if we fix #4108 instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:BugInconsistencies or issues which will cause an incorrect result under some or all circumstances

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions