]> Creatis software - gdcm.git/commitdiff
Bug fix for old ACR-NEMA images :
authorjpr <jpr>
Tue, 3 Jul 2007 08:17:24 +0000 (08:17 +0000)
committerjpr <jpr>
Tue, 3 Jul 2007 08:17:24 +0000 (08:17 +0000)
When entry 0x0028, 0x0004 (photochromatic interpretation) was missing,
IsMonochrome() always said FALSE, even when the was no PALETTE
and number of scalar components =1.

src/gdcmFile.cxx

index 91a9f8c69d7ae673fa6c737446b5c6e64a3bd9b4..e108dfdb73add8c7418c99fcd688d8f9d42a7a20 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/05/24 10:41:25 $
-  Version:   $Revision: 1.332 $
+  Date:      $Date: 2007/07/03 08:17:24 $
+  Version:   $Revision: 1.333 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -1423,6 +1423,9 @@ bool File::IsMonochrome()
    {
       gdcmWarningMacro( "Photometric Interpretation (0028,0004) supposed to be "
                          << "mandatory");
+      // to deal with old ACR-NEMA images
+      if (GetNumberOfScalarComponents() == 1)
+         return true;
    }
    return false;
 }