]> Creatis software - gdcm.git/commitdiff
Debug vs Warning
authorjpr <jpr>
Wed, 9 Nov 2005 10:18:43 +0000 (10:18 +0000)
committerjpr <jpr>
Wed, 9 Nov 2005 10:18:43 +0000 (10:18 +0000)
src/gdcmDocument.cxx
src/gdcmFile.cxx
src/gdcmPixelReadConvert.cxx
src/gdcmRLEFrame.cxx

index 0d6396c93f7926917038e9655672a720cf378a04..6fcc7ac145fe28979cea4af532d148d5d06bdbb9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/05 13:23:30 $
-  Version:   $Revision: 1.325 $
+  Date:      $Date: 2005/11/09 10:18:43 $
+  Version:   $Revision: 1.326 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -708,15 +708,15 @@ void Document::LoadEntryBinArea(uint16_t group, uint16_t elem)
    DocEntry *docEntry = GetDocEntry(group, elem);
    if ( !docEntry )
    {
-      gdcmWarningMacro(std::hex << group << "|" << elem 
-                       <<  "doesn't exist" );
+      gdcmDebugMacro(std::hex << group << "|" << elem 
+                       <<  " doesn't exist" );
       return;
    }
    DataEntry *dataEntry = dynamic_cast<DataEntry *>(docEntry);
    if ( !dataEntry )
    {
       gdcmWarningMacro(std::hex << group << "|" << elem 
-                       <<  "is NOT a DataEntry");
+                       <<  " is NOT a DataEntry");
       return;
    }
    LoadEntryBinArea(dataEntry);
index b21463b038b616c13f9afe77a69684ef461a12db..917ef615ab0c75f04fc0a750964554ac78928868 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/05 13:24:39 $
-  Version:   $Revision: 1.302 $
+  Date:      $Date: 2005/11/09 10:18:44 $
+  Version:   $Revision: 1.303 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -803,7 +803,7 @@ int File::GetBitsStored()
    DataEntry *entry = GetDataEntry(0x0028,0x0101);
    if( !entry )
    {
-      gdcmWarningMacro("(0028,0101) is supposed to be mandatory");
+      gdcmWarningMacro("BitsStored (0028,0101) is supposed to be mandatory");
       return 0;
    }
    return (int)entry->GetValue(0);
@@ -820,7 +820,7 @@ int File::GetBitsAllocated()
    DataEntry *entry = GetDataEntry(0x0028,0x0100);
    if( !entry )
    {
-      gdcmWarningMacro("(0028,0100) is supposed to be mandatory");
+      gdcmWarningMacro("BitsAllocated (0028,0100) is supposed to be mandatory");
       return 0;
    }
    return (int)entry->GetValue(0);
@@ -837,7 +837,7 @@ int File::GetHighBitPosition()
    DataEntry *entry = GetDataEntry(0x0028,0x0102);
    if( !entry )
    {
-      gdcmWarningMacro("(0028,0102) is supposed to be mandatory");
+      gdcmWarningMacro("HighBitPosition (0028,0102) is supposed to be mandatory");
       return 0;
    }
    return (int)entry->GetValue(0);
@@ -854,7 +854,7 @@ int File::GetSamplesPerPixel()
    DataEntry *entry = GetDataEntry(0x0028,0x0002);
    if( !entry )
    {
-      gdcmWarningMacro("(0028,0002) is supposed to be mandatory");
+      gdcmWarningMacro("SamplesPerPixel (0028,0002) is supposed to be mandatory");
       return 1; // Well, it's supposed to be mandatory ...
                 // but sometimes it's missing : *we* assume Gray pixels
    }
@@ -928,7 +928,7 @@ std::string File::GetPixelType()
    std::string bitsAlloc = GetEntryString(0x0028, 0x0100); // Bits Allocated
    if ( bitsAlloc == GDCM_UNFOUND )
    {
-      gdcmWarningMacro( "Missing  Bits Allocated (0028,0100)");
+      gdcmWarningMacro( "Bits Allocated (0028,0100) supposed to be mandatory");
       bitsAlloc = "16"; // default and arbitrary value, not to polute the output
    }
 
@@ -972,7 +972,8 @@ bool File::IsSignedPixelData()
    DataEntry *entry = GetDataEntry(0x0028, 0x0103);//"Pixel Representation"
    if( !entry )
    {
-      gdcmWarningMacro( "Missing Pixel Representation (0028,0103)");
+      gdcmWarningMacro( "Pixel Representation (0028,0103) supposed to be "
+                      << "mandatory");
       return false;
    }
    return entry->GetValue(0) != 0;
@@ -993,7 +994,8 @@ bool File::IsMonochrome()
    }
    if ( PhotometricInterp == GDCM_UNFOUND )
    {
-      gdcmWarningMacro( "Not found : Photometric Interpretation (0028,0004)");
+      gdcmWarningMacro( "Photometric Interpretation (0028,0004) supposed to be "
+                         << "mandatory");
    }
    return false;
 }
@@ -1012,7 +1014,8 @@ bool File::IsMonochrome1()
    }
    if ( PhotometricInterp == GDCM_UNFOUND )
    {
-      gdcmWarningMacro( "Not found : Photometric Interpretation (0028,0004)");
+      gdcmWarningMacro( "Photometric Interpretation (0028,0004) : supposed to"
+      << " be mandatory! ");
    }
    return false;
 }
@@ -1031,7 +1034,7 @@ bool File::IsPaletteColor()
    }
    if ( PhotometricInterp == GDCM_UNFOUND )
    {
-      gdcmWarningMacro( "Not found : Palette color (0028,0004)");
+      gdcmDebugMacro( "Not found : Palette color (0028,0004)");
    }
    return false;
 }
@@ -1050,7 +1053,7 @@ bool File::IsYBRFull()
    }
    if ( PhotometricInterp == GDCM_UNFOUND )
    {
-      gdcmWarningMacro( "Not found : YBR Full (0028,0004)");
+      gdcmDebugMacro( "Not found : YBR Full (0028,0004)");
    }
    return false;
 }
@@ -1161,7 +1164,7 @@ float File::GetRescaleSlope()
    DataEntry *entry = GetDataEntry(0x0028, 0x1053);
    if( !entry )
    {
-      gdcmWarningMacro( "Missing Rescale Slope (0028,1053)");
+      gdcmDebugMacro( "Missing Rescale Slope (0028,1053)");
       return 1.0f;
    }
    return (float)entry->GetValue(0);
@@ -1251,7 +1254,7 @@ size_t File::GetPixelOffset()
    }
    else
    {
-      gdcmDebugMacro( "Big trouble : Pixel Element ("
+      gdcmWarningMacro( "Big trouble : Pixel Element ("
                       << std::hex << GrPixel<<","<< NumPixel<< ") NOT found" );
       return 0;
    }
@@ -1273,7 +1276,7 @@ size_t File::GetPixelAreaLength()
    }
    else
    {
-      gdcmDebugMacro( "Big trouble : Pixel Element ("
+      gdcmWarningMacro( "Big trouble : Pixel Element ("
                       << std::hex << GrPixel<<","<< NumPixel<< ") NOT found" );
       return 0;
    }
index bb8d4e7f4fe83e06f6c5e95a2b0cd860c15360c8..67431bfc6858b620d4e3d7f9df49d4ee8f4e241b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/08 16:35:54 $
-  Version:   $Revision: 1.97 $
+  Date:      $Date: 2005/11/09 10:18:44 $
+  Version:   $Revision: 1.98 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -309,7 +309,8 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp )
       // Default case concerns JPEG family
       if ( ! ReadAndDecompressJPEGFile( fp ) )
       {
-         gdcmWarningMacro( "JPEG decompressor failed." );
+         gdcmWarningMacro( "JPEG decompressor ( ReadAndDecompressJPEGFile()"
+                        << " method ) failed." );
          return false;
       }
    }
@@ -493,6 +494,7 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp )
          return true;
       }
       // wow what happen, must be an error
+      gdcmWarningMacro( "gdcm_read_JPEG2000_file() failed "); 
       return false;
    }
    else if ( IsJPEGLS )
@@ -1256,13 +1258,13 @@ void PixelReadConvert::ConvertHandleColor()
       if ( IsYBRFull )
       {
          // [Planar 1] AND [Photo C] (remember YBR_FULL_422 acts as RGB)
-         gdcmWarningMacro("--> YBRFull");
+         gdcmDebugMacro("--> YBRFull");
          ConvertYcBcRPlanesToRGBPixels();
       }
       else
       {
          // [Planar 1] AND [Photo C]
-         gdcmWarningMacro("--> YBRFull");
+         gdcmDebugMacro("--> YBRFull");
          ConvertRGBPlanesToRGBPixels();
       }
       return;
@@ -1273,7 +1275,7 @@ void PixelReadConvert::ConvertHandleColor()
 
    if (IsRLELossless)
    { 
-     gdcmWarningMacro("--> RLE Lossless");
+     gdcmDebugMacro("--> RLE Lossless");
      ConvertRGBPlanesToRGBPixels();
    }
 
index 7bfde04bfacc782aec248c8530db196551ff68eb..972f6a8190498c09ad9cc9eb1ecc35a3744d8224 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmRLEFrame.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/17 12:27:52 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/11/09 10:18:44 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -119,7 +119,8 @@ bool RLEFrame::ReadAndDecompressRLEFragment( uint8_t *subRaw,
                                                                                 
       if ( numberOfReadBytes > fragmentSize )
       {
-         gdcmWarningMacro( "Read more bytes than the segment size.");
+         gdcmWarningMacro( "Read more bytes (" << numberOfReadBytes
+              << " ) than the segment size. (" << fragmentSize << ")" );
          return false;
       }
    }