Skip to content

Commit 3f11cfb

Browse files
committed
Handle junk recognition code
1 parent 03c80e4 commit 3f11cfb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Source/MediaStorageAndFileFormat/gdcmPixmapReader.cxx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,17 @@ bool PixmapReader::ReadImageInternal(MediaStorage const &ms, bool handlepixeldat
631631
{
632632
// PHILIPS_Gyroscan-12-MONO2-Jpeg_Lossless.dcm
633633
// PHILIPS_Gyroscan-12-Jpeg_Extended_Process_2_4.dcm
634-
gdcmDebugMacro( "Mixture of ACR NEMA and DICOM file" );
635-
isacrnema = true;
636634
const char *str = ds.GetDataElement( trecognitioncode ).GetByteValue()->GetPointer();
637-
gdcm_assert( strncmp( str, "ACR-NEMA", strlen( "ACR-NEMA" ) ) == 0 ||
638-
strncmp( str, "ACRNEMA", strlen( "ACRNEMA" ) ) == 0 ||
639-
strncmp( str, "MIPS 2.0", strlen( "MIPS 2.0" ) ) == 0 );
640-
(void)str;//warning removal
635+
if( strncmp( str, "ACR-NEMA", strlen( "ACR-NEMA" ) ) == 0 ||
636+
strncmp( str, "ACRNEMA", strlen( "ACRNEMA" ) ) == 0 ||
637+
strncmp( str, "MIPS 2.0", strlen( "MIPS 2.0" ) ) == 0) {
638+
gdcmDebugMacro("Mixture of ACR NEMA and DICOM file");
639+
isacrnema = true;
640+
} else {
641+
Attribute<0x0008, 0x0010> at;
642+
at.SetFromDataSet(ds);
643+
gdcmWarningMacro("Junk recognition code: " + at.GetValue());
644+
}
641645
}
642646

643647
std::vector<unsigned int> vdims = ImageHelper::GetDimensionsValue(*F);

0 commit comments

Comments
 (0)