Description
While reading a DICOM instance whose tag (0008,0010) equals WINRADSTORE, GDCM v3.2.2 aborts with
The offending code is gdcm/Source/MediaStorageAndFileFormat/gdcmPixmapReader.cxx#L629-L640, where gdcm_assert enforces that the Recognition Code is exactly “ACR-NEMA”, “ACRNEMA” or “MIPS 2.0”. The file I’m processing uses WINRADSTORE, which is perfectly valid given that (0008,0010) is a retired free-text field in DICOM. As a result, the reader throws gdcm::Exception even though the dataset is otherwise fine.
Steps to reproduce
Load any DICOM file where (0008,0010) = WINRADSTORE.
Call gdcm::PixmapReader::Read().
Expected behavior
GDCM should tolerate unknown recognition codes (perhaps log a warning) and continue parsing.
Proposed fix
Replace the assert with a runtime check that only enables ACR/NEMA compatibility for known strings, without throwing exception for other values.
To complete the first sentence: The caught exception is : "An invalid logic behavior occurredstrncmp( str, "ACR-NEMA", strlen( "ACR-NEMA" ) ) == 0 || strncmp( str, "ACRNEMA", strlen( "ACRNEMA" ) ) == 0 || strncmp( str, "MIPS 2.0", strlen( "MIPS 2.0" ) ) == 0"