Skip to content

DCMTK reader fails for valid files #4108

@pieper

Description

@pieper

Description

Valid dicom files are rejected.

Steps to Reproduce

Use the itkDCMTKImageIO to read a file that has a dicom preamble and it is incorrectly rejected.

Expected behavior

File should be accepted.

Actual behavior

The readNoPreambleDicom implements a heuristic to see if the file starts with valid group/element tags.

https://github.com/InsightSoftwareConsortium/ITK/blame/master/Modules/IO/DCMTK/src/itkDCMTKImageIO.cxx#L231

But it fails when there is a preamble (which is often the case) there are 128 bytes and then the letters DICM.

https://dicom.nema.org/medical/dicom/current/output/html/part10.html#chapter_7

Reproducibility

Always

Versions

It appears to have been introduced by this commit:

19fa58f

Environment

All platforms.

Additional Information

I have a fix and will submit a PR.

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