From e9a711266d34e33b482edbe241b2e40db7d9915a Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 9 Nov 2005 10:18:43 +0000 Subject: [PATCH] Debug vs Warning --- src/gdcmDocument.cxx | 10 +++++----- src/gdcmFile.cxx | 33 ++++++++++++++++++--------------- src/gdcmPixelReadConvert.cxx | 14 ++++++++------ src/gdcmRLEFrame.cxx | 7 ++++--- 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 0d6396c9..6fcc7ac1 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -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(docEntry); if ( !dataEntry ) { gdcmWarningMacro(std::hex << group << "|" << elem - << "is NOT a DataEntry"); + << " is NOT a DataEntry"); return; } LoadEntryBinArea(dataEntry); diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index b21463b0..917ef615 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -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; } diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index bb8d4e7f..67431bfc 100644 --- a/src/gdcmPixelReadConvert.cxx +++ b/src/gdcmPixelReadConvert.cxx @@ -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(); } diff --git a/src/gdcmRLEFrame.cxx b/src/gdcmRLEFrame.cxx index 7bfde04b..972f6a81 100644 --- a/src/gdcmRLEFrame.cxx +++ b/src/gdcmRLEFrame.cxx @@ -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; } } -- 2.45.1