From 58156942f515f7d313b9b098156313a44f3b1e2b Mon Sep 17 00:00:00 2001 From: malaterre Date: Fri, 7 Jan 2005 22:03:30 +0000 Subject: [PATCH] ENH: First pass at removing name of function from hardcoded string from gdcmVerboseMacro. There were a lot of them that were wrong anyway... --- src/gdcmDicomDir.cxx | 44 ++++------- src/gdcmDicomDirElement.cxx | 7 +- src/gdcmDict.cxx | 10 +-- src/gdcmDictSet.cxx | 7 +- src/gdcmDocEntrySet.cxx | 16 ++-- src/gdcmDocument.cxx | 144 +++++++++++++---------------------- src/gdcmElementSet.cxx | 15 ++-- src/gdcmFile.cxx | 50 +++++++----- src/gdcmGlobal.cxx | 6 +- src/gdcmHeader.cxx | 87 +++++++++------------ src/gdcmPixelReadConvert.cxx | 61 ++++++--------- src/gdcmSQItem.cxx | 15 ++-- src/gdcmTS.cxx | 6 +- src/gdcmVR.cxx | 6 +- 14 files changed, 196 insertions(+), 278 deletions(-) diff --git a/src/gdcmDicomDir.cxx b/src/gdcmDicomDir.cxx index a68960f0..2a19043b 100644 --- a/src/gdcmDicomDir.cxx +++ b/src/gdcmDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 21:09:42 $ - Version: $Revision: 1.95 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.96 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -90,7 +90,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ): // if user passed a root directory, sure we didn't get anything if ( TagHT.begin() == TagHT.end() ) // when user passed a Directory to parse { - gdcmVerboseMacro("DicomDir::DicomDir : entry HT empty"); + gdcmVerboseMacro( "Entry HT empty"); if ( fileName == "." ) { @@ -105,8 +105,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ): { MetaElems = NewMeta(); - gdcmVerboseMacro("DicomDir::DicomDir : Parse directory" - " and create the DicomDir"); + gdcmVerboseMacro( "Parse directory and create the DicomDir"); ParseDirectory(); } else @@ -122,8 +121,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ): DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220); if ( !e ) { - gdcmVerboseMacro("DicomDir::DicomDir : NO Directory record" - " sequence (0x0004,0x1220)"); + gdcmVerboseMacro( "NO Directory record sequence (0x0004,0x1220)"); /// \todo FIXME : what do we do when the parsed file IS NOT a /// DICOMDIR file ? } @@ -425,9 +423,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path) header = new Header( it->c_str() ); if( !header ) { - gdcmVerboseMacro( "DicomDir::CreateDicomDirChainedList: " << - "failure in new Header " << - it->c_str() ); + gdcmVerboseMacro( "Failure in new Header " << it->c_str() ); continue; } @@ -435,8 +431,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path) { // Add the file header to the chained list: list.push_back(header); - gdcmVerboseMacro( "DicomDir::CreateDicomDirChainedList: readable " << - it->c_str() ); + gdcmVerboseMacro( "Readable " << it->c_str() ); } else { @@ -550,8 +545,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, si = new DicomDirImage(); if( !AddDicomDirImageToEnd(static_cast(si)) ) { - gdcmVerboseMacro("DicomDir::SetElement:" - "Add DicomDirImageToEnd failed"); + gdcmVerboseMacro( "Add DicomDirImageToEnd failed"); } break; case GDCM_DICOMDIR_SERIE: @@ -559,8 +553,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, si = new DicomDirSerie(); if( !AddDicomDirSerieToEnd(static_cast(si)) ) { - gdcmVerboseMacro("DicomDir::SetElement:" - "Add DicomDirSerieToEnd failed"); + gdcmVerboseMacro( "Add DicomDirSerieToEnd failed"); } break; case GDCM_DICOMDIR_STUDY: @@ -568,8 +561,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, si = new DicomDirStudy(); if( !AddDicomDirStudyToEnd(static_cast(si)) ) { - gdcmVerboseMacro("DicomDir::SetElement:" - "Add DicomDirStudyToEnd failed"); + gdcmVerboseMacro( "Add DicomDirStudyToEnd failed"); } break; case GDCM_DICOMDIR_PATIENT: @@ -577,8 +569,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, si = new DicomDirPatient(); if( !AddDicomDirPatientToEnd(static_cast(si)) ) { - gdcmVerboseMacro("DicomDir::SetElement:" - "Add DicomDirPatientToEnd failed"); + gdcmVerboseMacro( "Add DicomDirPatientToEnd failed"); } break; case GDCM_DICOMDIR_META: @@ -586,8 +577,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, si = new DicomDirMeta(); if( MetaElems ) { - gdcmVerboseMacro("DicomDir::SetElement:" - "MetaElements already exist, they will be destroyed"); + gdcmVerboseMacro( "MetaElements already exist, they will be destroyed"); delete MetaElems; } MetaElems = static_cast(si); @@ -637,8 +627,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type, { if( header->GetFileName().substr(0, path.length()) != path ) { - gdcmVerboseMacro("DicomDir::SetElement : the base path" - " of file name is incorrect"); + gdcmVerboseMacro( "The base path of file name is incorrect"); val = header->GetFileName(); } else @@ -729,8 +718,7 @@ void DicomDir::CreateDicomDir() DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220); if ( !e ) { - gdcmVerboseMacro("DicomDir::DicomDir : NO Directory record" - " sequence (0x0004,0x1220)"); + gdcmVerboseMacro( "NO Directory record sequence (0x0004,0x1220)"); /// \todo FIXME: what to do when the parsed file IS NOT a DICOMDIR file ? return; } @@ -738,7 +726,7 @@ void DicomDir::CreateDicomDir() SeqEntry *s = dynamic_cast(e); if ( !s ) { - gdcmVerboseMacro("DicomDir::CreateDicomDir: no SeqEntry present"); + gdcmVerboseMacro( "No SeqEntry present"); // useless : (0x0004,0x1220) IS a Sequence ! return; } @@ -761,7 +749,7 @@ void DicomDir::CreateDicomDir() } else { - gdcmVerboseMacro("DicomDir::CreateDicomDir: not a ValEntry."); + gdcmVerboseMacro( "Not a ValEntry."); continue; } diff --git a/src/gdcmDicomDirElement.cxx b/src/gdcmDicomDirElement.cxx index e2791d55..dab39844 100644 --- a/src/gdcmDicomDirElement.cxx +++ b/src/gdcmDicomDirElement.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDicomDirElement.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.25 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.26 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -40,8 +40,7 @@ DicomDirElement::DicomDirElement() std::ifstream from(filename.c_str()); if(!from) { - gdcmVerboseMacro( "DicomDirElement::DicomDirElement: can't open dictionary" - << filename.c_str()); + gdcmVerboseMacro( "Can't open dictionary" << filename.c_str()); FillDefaultDIRDict( this ); } else diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 37180fd9..4635bd22 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.59 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.60 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -44,7 +44,7 @@ Dict::Dict(std::string const &filename) std::ifstream from( filename.c_str() ); if( !from ) { - gdcmVerboseMacro("Dict::Dict: can't open dictionary" << filename.c_str()); + gdcmVerboseMacro( "Can't open dictionary" << filename.c_str()); // Using default embeded one: FillDefaultDataDict( this ); } @@ -128,7 +128,7 @@ bool Dict::AddNewEntry(DictEntry const &newEntry) if(KeyHt.count(key) == 1) { - gdcmVerboseMacro("Dict::AddNewEntry already present" << key.c_str()); + gdcmVerboseMacro( "Already present" << key.c_str()); return false; } else @@ -172,7 +172,7 @@ bool Dict::RemoveEntry (TagKey const &key) } else { - gdcmVerboseMacro("Dict::RemoveEntry unfound entry" << key.c_str()); + gdcmVerboseMacro( "Unfound entry" << key.c_str()); return false; } } diff --git a/src/gdcmDictSet.cxx b/src/gdcmDictSet.cxx index 149ecac0..787cba26 100644 --- a/src/gdcmDictSet.cxx +++ b/src/gdcmDictSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictSet.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.48 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.49 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -220,8 +220,7 @@ std::string DictSet::BuildDictPath() { resultPath += '/'; } - gdcmVerboseMacro("DictSet::BuildDictPath:" - "Dictionary path set from environnement"); + gdcmVerboseMacro( "Dictionary path set from environnement"); } else { diff --git a/src/gdcmDocEntrySet.cxx b/src/gdcmDocEntrySet.cxx index 5e3cd38e..dd7e4bd0 100644 --- a/src/gdcmDocEntrySet.cxx +++ b/src/gdcmDocEntrySet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocEntrySet.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.37 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -71,8 +71,7 @@ ValEntry *DocEntrySet::NewValEntryByNumber(uint16_t group,uint16_t elem, ValEntry *newEntry = new ValEntry(dictEntry); if (!newEntry) { - gdcmVerboseMacro("Document::NewValEntryByNumber" - "failed to allocate ValEntry"); + gdcmVerboseMacro( "Failed to allocate ValEntry"); return 0; } return newEntry; @@ -96,8 +95,7 @@ BinEntry *DocEntrySet::NewBinEntryByNumber(uint16_t group,uint16_t elem, BinEntry *newEntry = new BinEntry(dictEntry); if (!newEntry) { - gdcmVerboseMacro("Document::NewBinEntryByNumber" - "failed to allocate BinEntry"); + gdcmVerboseMacro( "Failed to allocate BinEntry"); return 0; } return newEntry; @@ -118,8 +116,7 @@ SeqEntry* DocEntrySet::NewSeqEntryByNumber(uint16_t group,uint16_t elem) SeqEntry *newEntry = new SeqEntry( dictEntry ); if (!newEntry) { - gdcmVerboseMacro("Document::NewSeqEntryByNumber" - "failed to allocate SeqEntry"); + gdcmVerboseMacro( "Failed to allocate SeqEntry"); return 0; } return newEntry; @@ -140,8 +137,7 @@ DictEntry *DocEntrySet::GetDictEntryByNumber(uint16_t group,uint16_t elem) Dict *pubDict = Global::GetDicts()->GetDefaultPubDict(); if (!pubDict) { - gdcmVerboseMacro("Document::GetDictEntry" - "we SHOULD have a default dictionary"); + gdcmVerboseMacro( "We SHOULD have a default dictionary"); } else { diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 06f7a066..c6e91310 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/01/07 19:20:38 $ - Version: $Revision: 1.165 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.166 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -106,8 +106,7 @@ Document::Document( std::string const &filename ) : ElementSet(-1) return; } - gdcmVerboseMacro("Document::Document: starting parsing of file: " << - Filename.c_str()); + gdcmVerboseMacro( "Starting parsing of file: " << Filename.c_str()); Fp->seekg( 0, std::ios::beg); Fp->seekg(0, std::ios::end); @@ -283,14 +282,13 @@ bool Document::IsReadable() { if( Filetype == Unknown) { - gdcmVerboseMacro("Document::IsReadable: wrong filetype"); + gdcmVerboseMacro( "Wrong filetype"); return false; } if( TagHT.empty() ) { - gdcmVerboseMacro("Document::IsReadable: no tags in internal" - " hash table."); + gdcmVerboseMacro( "No tags in internal hash table."); return false; } @@ -424,15 +422,13 @@ std::ifstream *Document::OpenFile() if(Fp) { - gdcmVerboseMacro( "Document::OpenFile is already opened when opening: " << - Filename.c_str()); + gdcmVerboseMacro( "Is already opened when opening: " << Filename.c_str()); } Fp = new std::ifstream(Filename.c_str(), std::ios::in | std::ios::binary); if( ! *Fp ) { - gdcmVerboseMacro( "Document::OpenFile cannot open file: " << - Filename.c_str()); + gdcmVerboseMacro( "Cannot open file: " << Filename.c_str()); delete Fp; Fp = 0; return 0; @@ -471,8 +467,7 @@ std::ifstream *Document::OpenFile() } CloseFile(); - gdcmVerboseMacro( "Document::OpenFile not DICOM/ACR (missing preamble)" << - Filename.c_str()); + gdcmVerboseMacro( "Not DICOM/ACR (missing preamble)" << Filename.c_str()); return 0; } @@ -563,8 +558,7 @@ ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value, { if (!RemoveEntry(currentEntry)) { - gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal" - " of previous DocEntry failed."); + gdcmVerboseMacro( "Removal of previous DocEntry failed."); return NULL; } @@ -578,8 +572,7 @@ ValEntry *Document::ReplaceOrCreateByNumber(std::string const &value, if ( !AddEntry(valEntry)) { - gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry" - " failed allthough this is a creation."); + gdcmVerboseMacro("AddEntry failed although this is a creation."); delete valEntry; return NULL; @@ -626,8 +619,7 @@ BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea, { if (!RemoveEntry(currentEntry)) { - gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal" - " of previous DocEntry failed."); + gdcmVerboseMacro( "Removal of previous DocEntry failed."); return NULL; } @@ -641,8 +633,7 @@ BinEntry *Document::ReplaceOrCreateByNumber(uint8_t *binArea, if ( !AddEntry(binEntry)) { - gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry" - " failed allthough this is a creation."); + gdcmVerboseMacro( "AddEntry failed allthough this is a creation."); delete binEntry; return NULL; @@ -699,8 +690,7 @@ SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) { if (!RemoveEntry(currentEntry)) { - gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal" - " of previous DocEntry failed."); + gdcmVerboseMacro( "Removal of previous DocEntry failed."); return NULL; } @@ -714,8 +704,7 @@ SeqEntry *Document::ReplaceOrCreateByNumber( uint16_t group, uint16_t elem) if ( !AddEntry(seqEntry)) { - gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry" - " failed allthough this is a creation."); + gdcmVerboseMacro( "AddEntry failed allthough this is a creation."); delete seqEntry; return NULL; @@ -838,8 +827,7 @@ bool Document::SetEntryByNumber(std::string const& content, ValEntry *entry = GetValEntryByNumber(group, element); if (!entry ) { - gdcmVerboseMacro("Document::SetEntryByNumber: no corresponding" - " ValEntry (try promotion first)."); + gdcmVerboseMacro( "No corresponding ValEntry (try promotion first)."); return false; } return SetEntry(content,entry); @@ -860,8 +848,7 @@ bool Document::SetEntryByNumber(uint8_t*content, int lgth, BinEntry *entry = GetBinEntryByNumber(group, element); if (!entry ) { - gdcmVerboseMacro( "Document::SetEntryByNumber: no corresponding" - " ValEntry (try promotion first)."); + gdcmVerboseMacro( "No corresponding ValEntry (try promotion first)."); return false; } @@ -922,7 +909,7 @@ void *Document::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem) DocEntry *entry = GetDocEntryByNumber(group, elem); if (!entry) { - gdcmVerboseMacro("Document::GetDocEntryByNumber: no entry"); + gdcmVerboseMacro( "No entry"); return 0; } if ( BinEntry *binEntry = dynamic_cast(entry) ) @@ -974,7 +961,7 @@ void Document::LoadEntryBinArea(BinEntry *element) uint8_t *a = new uint8_t[l]; if( !a ) { - gdcmVerboseMacro("Document::LoadEntryBinArea cannot allocate a"); + gdcmVerboseMacro( "Cannot allocate a"); return; } @@ -1054,7 +1041,7 @@ ValEntry *Document::GetValEntryByNumber(uint16_t group, uint16_t element) { return entry; } - gdcmVerboseMacro("Document::GetValEntryByNumber: unfound ValEntry."); + gdcmVerboseMacro( "Unfound ValEntry."); return 0; } @@ -1076,7 +1063,7 @@ BinEntry *Document::GetBinEntryByNumber(uint16_t group, uint16_t element) { return entry; } - gdcmVerboseMacro("Document::GetBinEntryByNumber: unfound BinEntry."); + gdcmVerboseMacro( "Unfound BinEntry."); return 0; } @@ -1204,8 +1191,8 @@ void Document::ParseDES(DocEntrySet *set, long offset, if ( ! Global::GetVR()->IsVROfBinaryRepresentable(vr) ) { ////// Neither ValEntry NOR BinEntry: should mean UNKOWN VR - gdcmVerboseMacro("Document::ParseDES: neither Valentry, " - "nor BinEntry. Probably unknown VR."); + gdcmVerboseMacro( "Neither Valentry, nor BinEntry." + "Probably unknown VR."); } //////////////////// BinEntry or UNKOWN VR: @@ -1567,8 +1554,7 @@ void Document::LoadDocEntry(DocEntry *entry) { if ( Fp->fail() || Fp->eof())//Fp->gcount() == 1 { - gdcmVerboseMacro("Document::LoadDocEntry" - "unread element value"); + gdcmVerboseMacro( "Unread element value"); valEntry->SetValue(GDCM_UNREAD); return; } @@ -1949,11 +1935,8 @@ void Document::FixDocEntryFoundLength(DocEntry *entry, if ( foundLength % 2) { - std::ostringstream s; - s << "Warning : Tag with uneven length " - << foundLength - << " in x(" << std::hex << gr << "," << elem <<")" << std::dec; - gdcmVerboseMacro(s.str().c_str()); + gdcmVerboseMacro( "Warning : Tag with uneven length " << foundLength + << " in x(" << std::hex << gr << "," << elem <<")"); } //////// Fix for some naughty General Electric images. @@ -2035,13 +2018,11 @@ bool Document::IsDocEntryAnInteger(DocEntry *entry) // test is useless (and might even look a bit paranoid), when we // encounter such an ill-formed image, we simply display a warning // message and proceed on parsing (while crossing fingers). - std::ostringstream s; long filePosition = Fp->tellg(); - s << "Erroneous Group Length element length on : (" \ + gdcmVerboseMacro( "Erroneous Group Length element length on : (" << std::hex << group << " , " << element << ") -before- position x(" << filePosition << ")" - << "lgt : " << length; - gdcmVerboseMacro("Document::IsDocEntryAnInteger" << s.str().c_str() ); + << "lgt : " << length ); } } @@ -2086,12 +2067,9 @@ uint32_t Document::FindDocEntryLengthOBOrOW() if ( group != 0xfffe || ( ( elem != 0xe0dd ) && ( elem != 0xe000 ) ) ) { - gdcmVerboseMacro("Document::FindDocEntryLengthOBOrOW: neither an Item " - "tag nor a Sequence delimiter tag."); + gdcmVerboseMacro( "Neither an Item tag nor a Sequence delimiter tag."); Fp->seekg(positionOnEntry, std::ios::beg); - throw FormatUnexpected("Document::FindDocEntryLengthOBOrOW()", - "Neither an Item tag nor a Sequence " - "delimiter tag."); + throw FormatUnexpected( "Neither an Item tag nor a Sequence delimiter tag."); } if ( elem == 0xe0dd ) @@ -2221,7 +2199,7 @@ bool Document::CheckSwap() char *entCur = deb + 128; if( memcmp(entCur, "DICM", (size_t)4) == 0 ) { - gdcmVerboseMacro("Document::CheckSwap:" "looks like DICOM Version3"); + gdcmVerboseMacro( "Looks like DICOM Version3" ); // Next, determine the value representation (VR). Let's skip to the // first element (0002, 0000) and check there if we find "UL" @@ -2255,27 +2233,23 @@ bool Document::CheckSwap() // instead of just checking for UL, OB and UI !? group 0000 { Filetype = ExplicitVR; - gdcmVerboseMacro( "Document::CheckSwap:" - "explicit Value Representation"); + gdcmVerboseMacro( "Explicit Value Representation"); } else { Filetype = ImplicitVR; - gdcmVerboseMacro("Document::CheckSwap:" - "not an explicit Value Representation"); + gdcmVerboseMacro( "Not an explicit Value Representation"); } if ( net2host ) { SwapCode = 4321; - gdcmVerboseMacro("Document::CheckSwap:" - "HostByteOrder != NetworkByteOrder"); + gdcmVerboseMacro( "HostByteOrder != NetworkByteOrder"); } else { SwapCode = 0; - gdcmVerboseMacro("Document::CheckSwap:" - "HostByteOrder = NetworkByteOrder"); + gdcmVerboseMacro( "HostByteOrder = NetworkByteOrder"); } // Position the file position indicator at first tag (i.e. @@ -2288,7 +2262,7 @@ bool Document::CheckSwap() // Alas, this is not a DicomV3 file and whatever happens there is no file // preamble. We can reset the file position indicator to where the data // is (i.e. the beginning of the file). - gdcmVerboseMacro("Document::CheckSwap:" "not a DICOM Version3 file"); + gdcmVerboseMacro( "Not a DICOM Version3 file"); Fp->seekg(0, std::ios::beg); // Our next best chance would be to be considering a 'clean' ACR/NEMA file. @@ -2363,8 +2337,7 @@ bool Document::CheckSwap() Filetype = ACR; return true; default : - gdcmVerboseMacro( "Document::CheckSwap:" - "ACR/NEMA unfound swap info (Really hopeless !)"); + gdcmVerboseMacro( "ACR/NEMA unfound swap info (Really hopeless !)"); Filetype = Unknown; return false; } @@ -2385,8 +2358,7 @@ bool Document::CheckSwap() */ void Document::SwitchSwapToBigEndian() { - gdcmVerboseMacro("Document::SwitchSwapToBigEndian" - "Switching to BigEndian mode."); + gdcmVerboseMacro( "Switching to BigEndian mode."); if ( SwapCode == 0 ) { SwapCode = 4321; @@ -2527,7 +2499,7 @@ DocEntry *Document::ReadNextDocEntry() std::string msg; msg = Util::Format("Falsely explicit vr file (%04x,%04x)\n", newEntry->GetGroup(), newEntry->GetElement()); - gdcmVerboseMacro("Document::FindVR: " << msg.c_str()); + gdcmVerboseMacro( msg.c_str() ); } newEntry->SetImplicitVR(); } @@ -2603,15 +2575,13 @@ bool Document::ReadTag(uint16_t testGroup, uint16_t testElement) } if ( itemTagGroup != testGroup || itemTagElement != testElement ) { - std::ostringstream s; - s << " We should have found tag ("; - s << std::hex << testGroup << "," << testElement << ")" << std::endl; - s << " but instead we encountered tag ("; - s << std::hex << itemTagGroup << "," << itemTagElement << ")" - << std::endl; - s << " at address: " << (unsigned)currentPosition << std::endl; - gdcmVerboseMacro("Document::ReadItemTagLength: wrong Item Tag found:" - << s.str().c_str()); + gdcmVerboseMacro( "Wrong Item Tag found:" + << " We should have found tag (" + << std::hex << testGroup << "," << testElement << ")" << std::endl + << " but instead we encountered tag (" + << std::hex << itemTagGroup << "," << itemTagElement << ")" + << std::endl + << " at address: " << (unsigned int)currentPosition ); Fp->seekg(positionOnEntry, std::ios::beg); return false; @@ -2647,11 +2617,9 @@ uint32_t Document::ReadTagLength(uint16_t testGroup, uint16_t testElement) long currentPosition = Fp->tellg(); uint32_t itemLength = ReadInt32(); { - std::ostringstream s; - s << "Basic Item Length is: " - << itemLength << std::endl; - s << " at address: " << (unsigned)currentPosition << std::endl; - gdcmVerboseMacro("Document::ReadItemTagLength: " << s.str().c_str()); + gdcmVerboseMacro( "Basic Item Length is: " + << itemLength << std::endl + << " at address: " << (unsigned int)currentPosition); } return itemLength; } @@ -2681,12 +2649,8 @@ void Document::ReadAndSkipEncapsulatedBasicOffsetTable() { uint32_t individualLength = str2num( &basicOffsetTableItemValue[i], uint32_t); - std::ostringstream s; - s << " Read one length: "; - s << std::hex << individualLength << std::endl; - gdcmVerboseMacro(0, - "Document::ReadAndSkipEncapsulatedBasicOffsetTable: ", - s.str().c_str()); + gdcmVerboseMacro( "Read one length: " << + std::hex << individualLength ); } #endif //GDCM_DEBUG @@ -2743,7 +2707,7 @@ void Document::ComputeRLEInfo() if ( nbRleSegments > 16 ) { // There should be at most 15 segments (refer to RLEFrame class) - gdcmVerboseMacro("Document::ComputeRLEInfo: too many segments."); + gdcmVerboseMacro( "Too many segments."); } uint32_t rleSegmentOffsetTable[16]; @@ -2786,8 +2750,7 @@ void Document::ComputeRLEInfo() // Delimiter Item': if ( !ReadTag(0xfffe, 0xe0dd) ) { - gdcmVerboseMacro("Document::ComputeRLEInfo: no sequence delimiter " - " item at end of RLE item sequence"); + gdcmVerboseMacro( "No sequence delimiter item at end of RLE item sequence"); } } @@ -2827,8 +2790,7 @@ void Document::ComputeJPEGFragmentInfo() // Delimiter Item': if ( !ReadTag(0xfffe, 0xe0dd) ) { - gdcmVerboseMacro("Document::ComputeRLEInfo: no sequence delimiter " - " item at end of JPEG item sequence"); + gdcmVerboseMacro( "No sequence delimiter item at end of JPEG item sequence"); } } diff --git a/src/gdcmElementSet.cxx b/src/gdcmElementSet.cxx index 97436d14..4338de23 100644 --- a/src/gdcmElementSet.cxx +++ b/src/gdcmElementSet.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmElementSet.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.38 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.39 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -113,8 +113,7 @@ bool ElementSet::AddEntry(DocEntry *newEntry) if( TagHT.count(key) == 1 ) { - gdcmVerboseMacro("ElementSet::AddEntry key already present: " << - key.c_str()); + gdcmVerboseMacro( "Key already present: " << key.c_str()); return false; } else @@ -136,12 +135,12 @@ bool ElementSet::RemoveEntry( DocEntry *entryToRemove) if( TagHT.count(key) == 1 ) { TagHT.erase(key); - gdcmVerboseMacro( "ElementSet::RemoveEntry: one element erased."); + gdcmVerboseMacro( "One element erased."); delete entryToRemove; return true; } - gdcmVerboseMacro("ElementSet::RemoveEntry: key not present"); + gdcmVerboseMacro( "Key not present"); return false ; } @@ -155,11 +154,11 @@ bool ElementSet::RemoveEntryNoDestroy(DocEntry *entryToRemove) if( TagHT.count(key) == 1 ) { TagHT.erase(key); - gdcmVerboseMacro("ElementSet::RemoveEntry: one element erased."); + gdcmVerboseMacro( "One element erased."); return true; } - gdcmVerboseMacro("ElementSet::RemoveEntry: key not present"); + gdcmVerboseMacro( "Key not present"); return false ; } diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index c412b4cd..9be54a01 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/01/07 19:20:38 $ - Version: $Revision: 1.185 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.186 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -255,8 +255,7 @@ size_t File::GetImageDataIntoVector (void *destination, size_t maxSize) { if ( PixelReadConverter->GetRGBSize() > maxSize ) { - gdcmVerboseMacro("File::GetImageDataIntoVector: pixel data bigger" - "than caller's expected MaxSize"); + gdcmVerboseMacro( "Pixel data bigger than caller's expected MaxSize"); return 0; } memcpy( destination, @@ -268,8 +267,7 @@ size_t File::GetImageDataIntoVector (void *destination, size_t maxSize) // Either no LUT conversion necessary or LUT conversion failed if ( PixelReadConverter->GetRawSize() > maxSize ) { - gdcmVerboseMacro("File::GetImageDataIntoVector: pixel data bigger" - "than caller's expected MaxSize"); + gdcmVerboseMacro( "Pixel data bigger than caller's expected MaxSize"); return 0; } memcpy( destination, @@ -373,16 +371,29 @@ bool File::WriteRawData(std::string const &fileName) std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary ); if (!fp1) { - gdcmVerboseMacro("Fail to open (write) file:" << fileName.c_str()); + gdcmVerboseMacro( "Fail to open (write) file:" << fileName.c_str()); return false; } - if(PixelWriteConverter->GetUserData()) - fp1.write((char*)PixelWriteConverter->GetUserData(), PixelWriteConverter->GetUserDataSize()); - else if(PixelReadConverter->GetRGB()) - fp1.write((char*)PixelReadConverter->GetRGB(), PixelReadConverter->GetRGBSize()); - else if(PixelReadConverter->GetRaw()) - fp1.write((char*)PixelReadConverter->GetRaw(), PixelReadConverter->GetRawSize()); + if( PixelWriteConverter->GetUserData() ) + { + fp1.write( (char*)PixelWriteConverter->GetUserData(), + PixelWriteConverter->GetUserDataSize() ); + } + else if ( PixelReadConverter->GetRGB() ) + { + fp1.write( (char*)PixelReadConverter->GetRGB(), + PixelReadConverter->GetRGBSize()); + } + else if ( PixelReadConverter->GetRaw() ) + { + fp1.write( (char*)PixelReadConverter->GetRaw(), + PixelReadConverter->GetRawSize()); + } + else + { + gdcmErrorMacro( "Nothing written." ); + } fp1.close(); @@ -615,18 +626,16 @@ bool File::CheckWriteIntegrity() case WMODE_RAW : if( decSize!=PixelWriteConverter->GetUserDataSize() ) { - gdcmVerboseMacro("File::CheckWriteIntegrity: Data size is incorrect (Raw)"); - //std::cerr << "File::CheckWriteIntegrity: Data size is incorrect (Raw)\n" - // << decSize << " / " << PixelWriteConverter->GetUserDataSize() << "\n"; + gdcmVerboseMacro( "Data size is incorrect (Raw)" << decSize + << " / " << PixelWriteConverter->GetUserDataSize() ); return false; } break; case WMODE_RGB : if( rgbSize!=PixelWriteConverter->GetUserDataSize() ) { - gdcmVerboseMacro( "File::CheckWriteIntegrity: Data size is incorrect (RGB)"); - //std::cerr << "File::CheckWriteIntegrity: Data size is incorrect (RGB)\n" - // << decSize << " / " << PixelWriteConverter->GetUserDataSize() << "\n"; + gdcmVerboseMacro( "Data size is incorrect (RGB)" << decSize + << " / " << PixelWriteConverter->GetUserDataSize() ); return false; } break; @@ -910,8 +919,7 @@ uint8_t *File::GetRaw() raw = PixelReadConverter->GetRaw(); if ( ! raw ) { - gdcmVerboseMacro("File::GetRaw: read/decompress of " - "pixel data apparently went wrong."); + gdcmVerboseMacro( "Read/decompress of pixel data apparently went wrong."); return 0; } } diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index 79e3962c..fdcb4181 100644 --- a/src/gdcmGlobal.cxx +++ b/src/gdcmGlobal.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmGlobal.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.9 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -67,7 +67,7 @@ Global::Global() { if (ValRes || TranSyn || Dicts || ddElem) { - gdcmVerboseMacro("Global::Global : VR or TS or Dicts already allocated"); + gdcmVerboseMacro( "VR or TS or Dicts already allocated"); return; } Dicts = new DictSet(); diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 1a5eec96..3d58185c 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:38 $ - Version: $Revision: 1.224 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.225 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -328,7 +328,7 @@ float Header::GetXSpacing() if ( strSpacing == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetXSpacing: unfound Pixel Spacing (0028,0030)"); + gdcmVerboseMacro( "Unfound Pixel Spacing (0028,0030)" ); return 1.; } @@ -355,7 +355,7 @@ float Header::GetXSpacing() if ( xspacing == 0.) { - gdcmVerboseMacro("Header::GetXSpacing: gdcmData/CT-MONO2-8-abdo.dcm problem"); + gdcmVerboseMacro("gdcmData/CT-MONO2-8-abdo.dcm problem"); // seems to be a bug in the header ... nbValues = sscanf( strSpacing.c_str(), "%f\\0\\%f", &yspacing, &xspacing); assert( nbValues == 2 ); @@ -376,7 +376,7 @@ float Header::GetYSpacing() if ( strSpacing == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetYSpacing: unfound Pixel Spacing (0028,0030)"); + gdcmVerboseMacro("Unfound Pixel Spacing (0028,0030)"); return 1.; } @@ -411,7 +411,7 @@ float Header::GetZSpacing() if ( strSpacingBSlices == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetZSpacing: unfound StrSpacingBSlices"); + gdcmVerboseMacro("Unfound StrSpacingBSlices"); const std::string &strSliceThickness = GetEntryByNumber(0x0018,0x0050); if ( strSliceThickness == GDCM_UNFOUND ) { @@ -444,8 +444,7 @@ float Header::GetRescaleIntercept() if( sscanf( strRescInter.c_str(), "%f", &resInter) != 1 ) { // bug in the element 0x0028,0x1052 - gdcmVerboseMacro("Header::GetRescaleIntercept: Rescale Slope " - "is empty"); + gdcmVerboseMacro( "Rescale Intercept is empty." ); } } @@ -466,7 +465,7 @@ float Header::GetRescaleSlope() if( sscanf( strRescSlope.c_str(), "%f", &resSlope) != 1) { // bug in the element 0x0028,0x1053 - gdcmVerboseMacro("Header::GetRescaleSlope: Rescale Slope is empty"); + gdcmVerboseMacro( "Rescale Slope is empty."); } } @@ -572,13 +571,11 @@ float Header::GetXOrigin() if ( strImPos == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetXImagePosition: unfound Image " - "Position Patient (0020,0032)"); + gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)"); strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images if ( strImPos == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetXImagePosition: unfound Image " - "Position (RET) (0020,0030)"); + gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)"); /// \todo How to tell the caller nothing was found ? return 0.; } @@ -605,13 +602,11 @@ float Header::GetYOrigin() if ( strImPos == GDCM_UNFOUND) { - gdcmVerboseMacro("Header::GetYImagePosition: unfound Image " - "Position Patient (0020,0032)"); + gdcmVerboseMacro( "Unfound Image Position Patient (0020,0032)"); strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images if ( strImPos == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetYImagePosition: unfound Image " - "Position (RET) (0020,0030)"); + gdcmVerboseMacro( "Unfound Image Position (RET) (0020,0030)"); /// \todo How to tell the caller nothing was found ? return 0.; } @@ -642,8 +637,7 @@ float Header::GetZOrigin() { if( sscanf( strImPos.c_str(), "%f\\%f\\%f", &xImPos, &yImPos, &zImPos) != 3) { - gdcmVerboseMacro("Header::GetZImagePosition: wrong Image " - "Position Patient (0020,0032)"); + gdcmVerboseMacro( "Wrong Image Position Patient (0020,0032)"); return 0.; // bug in the element 0x0020,0x0032 } else @@ -658,7 +652,7 @@ float Header::GetZOrigin() if( sscanf( strImPos.c_str(), "%f\\%f\\%f", &xImPos, &yImPos, &zImPos ) != 3 ) { - gdcmVerboseMacro("Header::GetZImagePosition: wrong Image Position (RET) (0020,0030)"); + gdcmVerboseMacro( "Wrong Image Position (RET) (0020,0030)"); return 0.; // bug in the element 0x0020,0x0032 } else @@ -672,7 +666,7 @@ float Header::GetZOrigin() { if( sscanf( strSliceLocation.c_str(), "%f", &zImPos) != 1) { - gdcmVerboseMacro("Header::GetZImagePosition: wrong Slice Location (0020,1041)"); + gdcmVerboseMacro( "Wrong Slice Location (0020,1041)"); return 0.; // bug in the element 0x0020,0x1041 } else @@ -680,14 +674,14 @@ float Header::GetZOrigin() return zImPos; } } - gdcmVerboseMacro("Header::GetZImagePosition: unfound Slice Location (0020,1041)"); + gdcmVerboseMacro( "Unfound Slice Location (0020,1041)"); std::string strLocation = GetEntryByNumber(0x0020,0x0050); if ( strLocation != GDCM_UNFOUND ) { if( sscanf( strLocation.c_str(), "%f", &zImPos) != 1) { - gdcmVerboseMacro("Header::GetZImagePosition: wrong Location (0020,0050)"); + gdcmVerboseMacro( "Wrong Location (0020,0050)"); return 0.; // bug in the element 0x0020,0x0050 } else @@ -695,7 +689,7 @@ float Header::GetZOrigin() return zImPos; } } - gdcmVerboseMacro("Header::GetYImagePosition: unfound Location (0020,0050)"); + gdcmVerboseMacro( "Unfound Location (0020,0050)"); return 0.; // Hopeless } @@ -794,8 +788,7 @@ int Header::GetBitsStored() std::string strSize = GetEntryByNumber( 0x0028, 0x0101 ); if ( strSize == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetBitsStored: this is supposed to " - "be mandatory"); + gdcmVerboseMacro("This is supposed to be mandatory"); return 0; // It's supposed to be mandatory // the caller will have to check } @@ -813,8 +806,7 @@ int Header::GetHighBitPosition() std::string strSize = GetEntryByNumber( 0x0028, 0x0102 ); if ( strSize == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetHighBitPosition: this is supposed " - "to be mandatory"); + gdcmVerboseMacro( "This is supposed to be mandatory"); return 0; } return atoi( strSize.c_str() ); @@ -831,8 +823,7 @@ bool Header::IsSignedPixelData() std::string strSize = GetEntryByNumber( 0x0028, 0x0103 ); if ( strSize == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::IsSignedPixelData: this is supposed " - "to be mandatory"); + gdcmVerboseMacro( "This is supposed to be mandatory"); return false; } int sign = atoi( strSize.c_str() ); @@ -854,8 +845,7 @@ int Header::GetBitsAllocated() std::string strSize = GetEntryByNumber(0x0028,0x0100); if ( strSize == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetBitsStored: this is supposed to " - "be mandatory"); + gdcmVerboseMacro( "This is supposed to be mandatory"); return 0; // It's supposed to be mandatory // the caller will have to check } @@ -873,8 +863,7 @@ int Header::GetSamplesPerPixel() const std::string& strSize = GetEntryByNumber(0x0028,0x0002); if ( strSize == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetBitsStored: this is supposed to " - "be mandatory"); + gdcmVerboseMacro( "This is supposed to be mandatory"); return 1; // Well, it's supposed to be mandatory ... // but sometimes it's missing : *we* assume Gray pixels } @@ -896,8 +885,7 @@ bool Header::IsMonochrome() } if ( PhotometricInterp == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::IsMonochrome: absent Photometric " - "Interpretation"); + gdcmVerboseMacro( "Absent Photometric Interpretation"); } return false; } @@ -916,8 +904,7 @@ bool Header::IsPaletteColor() } if ( PhotometricInterp == GDCM_UNFOUND ) { - gdcmVerboseMacro( "Header::IsPaletteColor: absent Photometric " - "Interpretation"); + gdcmVerboseMacro( "Absent Palette color"); } return false; } @@ -936,8 +923,7 @@ bool Header::IsYBRFull() } if ( PhotometricInterp == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::IsYBRFull: absent Photometric " - "Interpretation"); + gdcmVerboseMacro( "Absent YBR Full"); } return false; } @@ -952,6 +938,7 @@ int Header::GetPlanarConfiguration() std::string strSize = GetEntryByNumber(0x0028,0x0006); if ( strSize == GDCM_UNFOUND ) { + gdcmVerboseMacro( "Absent Planar Configuration"); return 0; } return atoi( strSize.c_str() ); @@ -986,7 +973,7 @@ int Header::GetPixelSize() { return 8; } - gdcmVerboseMacro("Header::GetPixelSize: Unknown pixel type"); + gdcmVerboseMacro( "Unknown pixel type"); return 0; } @@ -1009,7 +996,7 @@ std::string Header::GetPixelType() std::string bitsAlloc = GetEntryByNumber(0x0028, 0x0100); // Bits Allocated if ( bitsAlloc == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetPixelType: unfound Bits Allocated"); + gdcmVerboseMacro( "Unfound Bits Allocated"); bitsAlloc = "16"; } @@ -1032,7 +1019,7 @@ std::string Header::GetPixelType() if (sign == GDCM_UNFOUND ) { - gdcmVerboseMacro("Header::GetPixelType: unfound Pixel Representation"); + gdcmVerboseMacro( "Unfound Pixel Representation"); bitsAlloc = "0"; } else if ( sign == "0" ) @@ -1187,15 +1174,13 @@ std::string Header::GetTransfertSyntaxName() if ( transfertSyntax == GDCM_NOTLOADED ) { - std::cout << "Transfert Syntax not loaded. " << std::endl - << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" - << std::endl; + gdcmVerboseMacro( "Transfert Syntax not loaded. " << std::endl + << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE" ); return "Uncompressed ACR-NEMA"; } if ( transfertSyntax == GDCM_UNFOUND ) { - gdcmVerboseMacro( "Header::GetTransfertSyntaxName:" - " unfound Transfert Syntax (0002,0010)"); + gdcmVerboseMacro( "Unfound Transfert Syntax (0002,0010)"); return "Uncompressed ACR-NEMA"; } @@ -1312,8 +1297,7 @@ void Header::GetImageOrientationPatient( float iop[6] ) if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f", &iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 ) { - gdcmVerboseMacro("Header::GetImageOrientationPatient: " - "wrong Image Orientation Patient (0020,0037)"); + gdcmVerboseMacro( "Wrong Image Orientation Patient (0020,0037). Less than 6 values were found." ); } } //For ACR-NEMA @@ -1323,8 +1307,7 @@ void Header::GetImageOrientationPatient( float iop[6] ) if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f", &iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 ) { - gdcmVerboseMacro("Header::GetImageOrientationPatient: " - "wrong Image Orientation Patient (0020,0035)"); + gdcmVerboseMacro( "wrong Image Orientation Patient (0020,0035). Less than 6 values were found." ); } } } diff --git a/src/gdcmPixelReadConvert.cxx b/src/gdcmPixelReadConvert.cxx index 2a75f588..b1d7335a 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/01/07 19:20:38 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.17 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -259,8 +259,7 @@ bool PixelReadConvert::ReadAndDecompressRLEFragment( uint8_t *subRaw, if ( numberOfReadBytes > fragmentSize ) { - gdcmVerboseMacro("PixelReadConvert::ReadAndDecompressRLEFragment: we " - "read more bytes than the segment size."); + gdcmVerboseMacro( "Read more bytes than the segment size."); return false; } } @@ -332,8 +331,7 @@ void PixelReadConvert::ConvertSwapZone() } break; default: - gdcmVerboseMacro( "PixelReadConvert::ConvertSwapZone: SwapCode value " - "(16 bits) not allowed." ); + gdcmVerboseMacro("SwapCode value (16 bits) not allowed."); } } else if( BitsAllocated == 32 ) @@ -379,8 +377,7 @@ void PixelReadConvert::ConvertSwapZone() } break; default: - gdcmVerboseMacro( "PixelReadConvert::ConvertSwapZone: SwapCode value " - "(32 bits) not allowed." ); + gdcmVerboseMacro("SwapCode value (32 bits) not allowed." ); } } } @@ -738,9 +735,8 @@ bool PixelReadConvert::ConvertReArrangeBits() throw ( FormatError ) } else { - gdcmVerboseMacro("PixelReadConvert::ConvertReArrangeBits: weird image"); - throw FormatError( "PixelReadConvert::ConvertReArrangeBits()", - "weird image !?" ); + gdcmVerboseMacro("Weird image"); + throw FormatError( "Weird image !?" ); } } return true; @@ -836,16 +832,14 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) //// First stage: get our hands on the Pixel Data. if ( !fp ) { - gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: " - "unavailable file pointer." ); + gdcmVerboseMacro( "Unavailable file pointer." ); return false; } fp->seekg( PixelOffset, std::ios::beg ); - if( fp->fail() || fp->eof()) //Fp->gcount() == 1 + if( fp->fail() || fp->eof()) { - gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: " - "unable to find PixelOffset in file." ); + gdcmVerboseMacro( "Unable to find PixelOffset in file." ); return false; } @@ -865,8 +859,7 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) // variable). But RawSize is the right size of the image ! if( PixelDataLength != RawSize) { - gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: " - "Mismatch between PixelReadConvert and RawSize." ); + gdcmVerboseMacro( "Mismatch between PixelReadConvert and RawSize." ); } if( PixelDataLength > RawSize) { @@ -877,10 +870,9 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) fp->read( (char*)Raw, PixelDataLength); } - if ( fp->fail() || fp->eof())//Fp->gcount() == 1 + if ( fp->fail() || fp->eof()) { - gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: " - "reading of Raw pixel data failed." ); + gdcmVerboseMacro( "Reading of Raw pixel data failed." ); return false; } } @@ -888,8 +880,7 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) { if ( ! ReadAndDecompressRLEFile( fp ) ) { - gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: " - "RLE decompressor failed." ); + gdcmVerboseMacro( "RLE decompressor failed." ); return false; } } @@ -898,8 +889,7 @@ bool PixelReadConvert::ReadAndDecompressPixelData( std::ifstream *fp ) // Default case concerns JPEG family if ( ! ReadAndDecompressJPEGFile( fp ) ) { - gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: " - "JPEG decompressor failed." ); + gdcmVerboseMacro( "JPEG decompressor failed." ); return false; } } @@ -1104,8 +1094,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) LutRedData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1201 ); if ( ! LutRedData ) { - gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: " - "unable to read red LUT data" ); + gdcmVerboseMacro( "Unable to read red LUT data" ); } ////// Green round: @@ -1113,8 +1102,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) LutGreenData = (uint8_t*)header->GetEntryBinAreaByNumber(0x0028, 0x1202 ); if ( ! LutGreenData) { - gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: " - "unable to read green LUT data" ); + gdcmVerboseMacro( "Unable to read green LUT data" ); } ////// Blue round: @@ -1122,8 +1110,7 @@ void PixelReadConvert::GrabInformationsFromHeader( Header *header ) LutBlueData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1203 ); if ( ! LutBlueData ) { - gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: " - "unable to read blue LUT data" ); + gdcmVerboseMacro( "Unable to read blue LUT data" ); } } @@ -1176,7 +1163,7 @@ void PixelReadConvert::BuildLUTRGBA() &lengthR, &debR, &nbitsR ); if( nbRead != 3 ) { - gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong red LUT descriptor"); + gdcmVerboseMacro( "Wrong red LUT descriptor" ); } int lengthG; // Green LUT length in Bytes @@ -1187,7 +1174,7 @@ void PixelReadConvert::BuildLUTRGBA() &lengthG, &debG, &nbitsG ); if( nbRead != 3 ) { - gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong green LUT descriptor"); + gdcmVerboseMacro( "Wrong green LUT descriptor" ); } int lengthB; // Blue LUT length in Bytes @@ -1198,7 +1185,7 @@ void PixelReadConvert::BuildLUTRGBA() &lengthB, &debB, &nbitsB ); if( nbRead != 3 ) { - gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong blue LUT descriptor"); + gdcmVerboseMacro( "Wrong blue LUT descriptor" ); } //////////////////////////////////////////////////////// @@ -1336,8 +1323,7 @@ void PixelReadConvert::Print( std::string indent, std::ostream &os ) } else { - gdcmVerboseMacro("PixelReadConvert::Print: set as RLE file " - "but NO RLEinfo present."); + gdcmVerboseMacro("Set as RLE file but NO RLEinfo present."); } } @@ -1349,8 +1335,7 @@ void PixelReadConvert::Print( std::string indent, std::ostream &os ) } else { - gdcmVerboseMacro("PixelReadConvert::Print: set as JPEG file " - "but NO JPEGinfo present."); + gdcmVerboseMacro("Set as JPEG file but NO JPEGinfo present."); } } } diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index d5a1bd21..f64d2b14 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:39 $ - Version: $Revision: 1.47 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.48 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -235,16 +235,15 @@ bool SQItem::RemoveEntry( DocEntry* entryToRemove) if( *it == entryToRemove) { DocEntries.erase(it); - gdcmVerboseMacro( "SQItem::RemoveEntry: one element erased."); + gdcmVerboseMacro( "One element erased."); delete entryToRemove; return true; } } - - gdcmVerboseMacro( "SQItem::RemoveEntry: value not present "); + gdcmVerboseMacro( "Value not present."); return false ; } - + /** * \brief Clear the hash table from given entry BUT keep the entry. * @param entryToRemove Entry to remove. @@ -258,12 +257,12 @@ bool SQItem::RemoveEntryNoDestroy(DocEntry* entryToRemove) if( *it == entryToRemove) { DocEntries.erase(it); - gdcmVerboseMacro( "SQItem::RemoveEntry: one element erased."); + gdcmVerboseMacro( "One element erased."); return true; } } - gdcmVerboseMacro( "SQItem::RemoveEntry: value not present "); + gdcmVerboseMacro( "Value not present."); return false ; } diff --git a/src/gdcmTS.cxx b/src/gdcmTS.cxx index d898be75..0c64dcb4 100644 --- a/src/gdcmTS.cxx +++ b/src/gdcmTS.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmTS.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:39 $ - Version: $Revision: 1.32 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.33 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -42,7 +42,7 @@ TS::TS() std::ifstream from(filename.c_str()); if( !from ) { - gdcmVerboseMacro("TS::TS: can't open dictionary" << filename.c_str()); + gdcmVerboseMacro("Can't open dictionary" << filename.c_str()); FillDefaultTSDict( TsMap ); } else diff --git a/src/gdcmVR.cxx b/src/gdcmVR.cxx index bc2a39ec..703178c5 100644 --- a/src/gdcmVR.cxx +++ b/src/gdcmVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmVR.cxx,v $ Language: C++ - Date: $Date: 2005/01/07 19:20:39 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/01/07 22:03:30 $ + Version: $Revision: 1.30 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,7 +37,7 @@ VR::VR() std::ifstream from(filename.c_str()); if(!from) { - gdcmVerboseMacro("VR::VR: can't open dictionary" << filename.c_str()); + gdcmVerboseMacro("Can't open dictionary" << filename.c_str()); FillDefaultVRDict(vr); } else -- 2.48.1