Program: gdcm
Module: $RCSfile: TestFromScratch.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:11 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/01/07 19:20:37 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
// Doesn't seems to do anything:
- gdcm::Debug::SetDebugLevel(-1);
+ gdcm::Debug::SetDebugOn();
// Doesn't link properly:
//gdcm::Debug::GetReference().SetDebug(1);
Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
/// warning message level to be displayed
-static int DebugLevel = -1;
+static int DebugFlag = 0;
//-----------------------------------------------------------------------------
/**
* \brief Accessor
* @param level Set the debug level
*/
-void Debug::SetDebugLevel (int level)
+void Debug::SetDebugFlag (int flag)
{
- DebugLevel = level;
+ DebugFlag = flag;
}
/**
- * \brief Verbose
- * @param level level
- * @param msg1 first message part
- * @param msg2 second message part
- */
-void Debug::Verbose(int level, const char *msg1, const char *msg2)
-{
- if (level > DebugLevel)
- {
- return ;
- }
- std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
-}
-
-/**
- * \brief Error
- * @param test test
- * @param msg1 first message part
- * @param msg2 second message part
- */
-void Debug::Error(bool test, const char *msg1, const char *msg2)
-{
- if (!test)
- {
- return;
- }
- std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
- Exit(1);
-}
-
-/**
- * \brief Error
- * @param msg1 first message part
- * @param msg2 second message part
- * @param msg3 Third message part
- */
-void Debug::Error(const char *msg1, const char *msg2,
- const char *msg3)
+ * \brief Accessor
+ * @param level Get the debug level
+ */
+int Debug::GetDebugFlag ()
{
- std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3
- << std::endl;
- Exit(1);
+ return DebugFlag;
}
-/**
- * \brief Assert
- * @param level level
- * @param test test
- * @param msg1 first message part
- * @param msg2 second message part
- */
-void Debug::Assert(int level, bool test, const char *msg1,
- const char *msg2)
-{
- if (level > DebugLevel)
- {
- return ;
- }
- if (!test)
- {
- std::cerr << "gdcm::" << msg1 << ' ' << msg2
- << std::endl;
- }
-}
+} // end namespace gdcm
-/**
- * \brief Exit
- * @param a return code
- */
-void Debug::Exit(int a)
-{
- exit(a); // Found in #include <stdlib.h>
-}
-} // end namespace gdcm
Program: gdcm
Module: $RCSfile: gdcmDebug.h,v $
Language: C++
- Date: $Date: 2005/01/07 16:39:59 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
/// This is a global flag that controls whether any debug, warning
/// messages are displayed.
- static void SetDebugLevel (int level);
- static int GetDebugLevel ();
-
- static void Verbose(int level, const char *msg1, const char *msg2 = "") ;
- static void Error (bool test, const char *msg1, const char *msg2 = "");
- static void Error (const char *msg1, const char *msg2 = "", const char *msg3 = "");
-
- static void Assert(int level, bool test, const char *msg1, const char *msg2);
- static void Exit (int a);
+ static int GetDebugFlag ();
+ static void SetDebugFlag (int flag);
+ static void SetDebugOn () { SetDebugFlag(1); };
+ static void SetDebugOff () { SetDebugFlag(0); };
};
} // end namespace gdcm
+// Here we define function this is the only way to be able to pass
+// stuff with indirection like:
+// gdcmDebug( "my message:" << i << '\t' );
+// You cannot use function unless you use vnsprintf ...
+
+// __FUNCTION is not always defined by preprocessor
+#ifndef __FUNCTION__
+# define __FUNCTION__ ""
+#endif
+
+/**
+ * \brief Verbose
+ * @param level level
+ * @param msg1 first message part
+ * @param msg2 second message part
+ */
+#define gdcmDebugMacro(x) \
+{ \
+ if( gdcm::Debug::GetDebugFlag() ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Debug: In " __FILE__ ", line " << __LINE__ \
+ << ", function " << __FUNCTION__ << '\n' \
+ << x << "\n\n"; \
+ std::cerr << osmacro.str() << std::endl; \
+ } \
+}
+
+/**
+ * \brief Verbose
+ * @param level level
+ * @param msg1 first message part
+ * @param msg2 second message part
+ */
+#define gdcmVerboseMacro(x) \
+{ \
+ if( gdcm::Debug::GetDebugFlag() ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Verbose: In " __FILE__ ", line " << __LINE__ \
+ << ", function " __FUNCTION__ "\n" \
+ << x << "\n\n"; \
+ std::cerr << osmacro.str() << std::endl; \
+ } \
+}
+
+/**
+ * \brief Error
+ * @param test test
+ * @param msg1 first message part
+ * @param msg2 second message part
+ */
+#define gdcmErrorMacro(x) \
+{ \
+ if( gdcm::Debug::GetDebugFlag() ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Error: In " __FILE__ ", line " << __LINE__ \
+ << ", function " << __FUNCTION__ << '\n' \
+ << x << "\n\n"; \
+ std::cerr << osmacro.str() << std::endl; \
+ exit(1); \
+ } \
+}
+
+/**
+ * \brief Assert
+ * @param level level
+ * @param test test
+ * @param msg1 first message part
+ * @param msg2 second message part
+ */
+#define gdcmAssertMacro(x) \
+{ \
+ if( x ) \
+ { \
+ std::ostringstream osmacro; \
+ osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
+ << ", function " << __FUNCTION__ \
+ << "\n\n"; \
+ std::cerr << osmacro.str() << std::endl; \
+ assert ( x ); \
+ } \
+}
+
#endif
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.93 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.94 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// if user passed a root directory, sure we didn't get anything
if ( TagHT.begin() == TagHT.end() ) // when user passed a Directory to parse
{
- Debug::Verbose(0, "DicomDir::DicomDir : entry HT empty");
+ gdcmVerboseMacro("DicomDir::DicomDir : entry HT empty");
- if ( fileName.size() == 1 && fileName[0] == '.' )
+ if ( fileName == "." )
{
// user passed '.' as Name
// we get current directory name
{
MetaElems = NewMeta();
- Debug::Verbose(0, "DicomDir::DicomDir : Parse directory"
- " and create the DicomDir");
+ gdcmVerboseMacro("DicomDir::DicomDir : Parse directory"
+ " and create the DicomDir");
ParseDirectory();
}
else
DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220);
if ( !e )
{
- Debug::Verbose(0, "DicomDir::DicomDir : NO Directory record"
+ gdcmVerboseMacro("DicomDir::DicomDir : NO Directory record"
" sequence (0x0004,0x1220)");
/// \todo FIXME : what do we do when the parsed file IS NOT a
/// DICOMDIR file ?
std::ios::out | std::ios::binary);
if( !fp )
{
- Debug::Verbose(2, "Failed to open(write) File: ", fileName.c_str());
+ gdcmVerboseMacro("Failed to open(write) File: " << fileName.c_str());
return false;
}
header = new Header( it->c_str() );
if( !header )
{
- Debug::Verbose( 1,
- "DicomDir::CreateDicomDirChainedList: "
- "failure in new Header ",
+ gdcmVerboseMacro( "DicomDir::CreateDicomDirChainedList: " <<
+ "failure in new Header " <<
it->c_str() );
continue;
}
{
// Add the file header to the chained list:
list.push_back(header);
- Debug::Verbose( 1,
- "DicomDir::CreateDicomDirChainedList: readable ",
+ gdcmVerboseMacro( "DicomDir::CreateDicomDirChainedList: readable " <<
it->c_str() );
}
else
si = new DicomDirImage();
if( !AddDicomDirImageToEnd(static_cast<DicomDirImage *>(si)) )
{
- Debug::Verbose(0,"DicomDir::SetElement:",
+ gdcmVerboseMacro("DicomDir::SetElement:"
"Add DicomDirImageToEnd failed");
}
break;
si = new DicomDirSerie();
if( !AddDicomDirSerieToEnd(static_cast<DicomDirSerie *>(si)) )
{
- Debug::Verbose(0,"DicomDir::SetElement:",
+ gdcmVerboseMacro("DicomDir::SetElement:"
"Add DicomDirSerieToEnd failed");
}
break;
si = new DicomDirStudy();
if( !AddDicomDirStudyToEnd(static_cast<DicomDirStudy *>(si)) )
{
- Debug::Verbose(0,"DicomDir::SetElement:",
+ gdcmVerboseMacro("DicomDir::SetElement:"
"Add DicomDirStudyToEnd failed");
}
break;
si = new DicomDirPatient();
if( !AddDicomDirPatientToEnd(static_cast<DicomDirPatient *>(si)) )
{
- Debug::Verbose(0,"DicomDir::SetElement:",
+ gdcmVerboseMacro("DicomDir::SetElement:"
"Add DicomDirPatientToEnd failed");
}
break;
si = new DicomDirMeta();
if( MetaElems )
{
- Debug::Verbose(0,"DicomDir::SetElement:",
+ gdcmVerboseMacro("DicomDir::SetElement:"
"MetaElements already exist, they will be destroyed");
delete MetaElems;
}
{
if( header->GetFileName().substr(0, path.length()) != path )
{
- Debug::Verbose(0, "DicomDir::SetElement : the base path"
- " of file name is incorrect");
+ gdcmVerboseMacro("DicomDir::SetElement : the base path"
+ " of file name is incorrect");
val = header->GetFileName();
}
else
DocEntry *e = GetDocEntryByNumber(0x0004, 0x1220);
if ( !e )
{
- Debug::Verbose(0, "DicomDir::DicomDir : NO Directory record"
- " sequence (0x0004,0x1220)");
+ gdcmVerboseMacro("DicomDir::DicomDir : NO Directory record"
+ " sequence (0x0004,0x1220)");
/// \todo FIXME: what to do when the parsed file IS NOT a DICOMDIR file ?
return;
}
SeqEntry *s = dynamic_cast<SeqEntry *>(e);
if ( !s )
{
- Debug::Verbose(0, "DicomDir::CreateDicomDir: no SeqEntry present");
+ gdcmVerboseMacro("DicomDir::CreateDicomDir: no SeqEntry present");
// useless : (0x0004,0x1220) IS a Sequence !
return;
}
}
else
{
- Debug::Verbose(0, "DicomDir::CreateDicomDir: not a ValEntry.");
+ gdcmVerboseMacro("DicomDir::CreateDicomDir: not a ValEntry.");
continue;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from(filename.c_str());
if(!from)
{
- Debug::Verbose(2,
- "DicomDirElement::DicomDirElement: can't open dictionary",
- filename.c_str());
+ gdcmVerboseMacro( "DicomDirElement::DicomDirElement: can't open dictionary"
+ << filename.c_str());
FillDefaultDIRDict( this );
}
else
Program: gdcm
Module: $RCSfile: gdcmDict.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.58 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.59 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from( filename.c_str() );
if( !from )
{
- Debug::Verbose(2,"Dict::Dict: can't open dictionary", filename.c_str());
+ gdcmVerboseMacro("Dict::Dict: can't open dictionary" << filename.c_str());
// Using default embeded one:
FillDefaultDataDict( this );
}
if(KeyHt.count(key) == 1)
{
- Debug::Verbose(1, "Dict::AddNewEntry already present", key.c_str());
+ gdcmVerboseMacro("Dict::AddNewEntry already present" << key.c_str());
return false;
}
else
}
else
{
- Debug::Verbose(1, "Dict::RemoveEntry unfound entry", key.c_str());
+ gdcmVerboseMacro("Dict::RemoveEntry unfound entry" << key.c_str());
return false;
}
}
Program: gdcm
Module: $RCSfile: gdcmDictEntry.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:33:07 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
else
{
- Debug::Error(true, "DictEntry::SetVR",
- "Overwriting VR might compromise a dictionary");
+ gdcmErrorMacro("DictEntry::SetVR"
+ "Overwriting VR might compromise a dictionary");
}
}
}
else
{
- Debug::Error(true, "DictEntry::SetVM",
- "Overwriting VM might compromise a dictionary");
+ gdcmErrorMacro( "DictEntry::SetVM"
+ "Overwriting VM might compromise a dictionary");
}
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDictSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ 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
{
resultPath += '/';
}
- Debug::Verbose(1, "DictSet::BuildDictPath:",
- "Dictionary path set from environnement");
+ gdcmVerboseMacro("DictSet::BuildDictPath:"
+ "Dictionary path set from environnement");
}
else
{
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
ValEntry *newEntry = new ValEntry(dictEntry);
if (!newEntry)
{
- Debug::Verbose(1, "Document::NewValEntryByNumber",
+ gdcmVerboseMacro("Document::NewValEntryByNumber"
"failed to allocate ValEntry");
return 0;
}
BinEntry *newEntry = new BinEntry(dictEntry);
if (!newEntry)
{
- Debug::Verbose(1, "Document::NewBinEntryByNumber",
+ gdcmVerboseMacro("Document::NewBinEntryByNumber"
"failed to allocate BinEntry");
return 0;
}
SeqEntry *newEntry = new SeqEntry( dictEntry );
if (!newEntry)
{
- Debug::Verbose(1, "Document::NewSeqEntryByNumber",
+ gdcmVerboseMacro("Document::NewSeqEntryByNumber"
"failed to allocate SeqEntry");
return 0;
}
Dict *pubDict = Global::GetDicts()->GetDefaultPubDict();
if (!pubDict)
{
- Debug::Verbose(0, "Document::GetDictEntry",
- "we SHOULD have a default dictionary");
+ gdcmVerboseMacro("Document::GetDictEntry"
+ "we SHOULD have a default dictionary");
}
else
{
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:45:51 $
- Version: $Revision: 1.164 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.165 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return;
}
- Debug::Verbose(0, "Document::Document: starting parsing of file: ",
+ gdcmVerboseMacro("Document::Document: starting parsing of file: " <<
Filename.c_str());
Fp->seekg( 0, std::ios::beg);
{
if( Filetype == Unknown)
{
- Debug::Verbose(0, "Document::IsReadable: wrong filetype");
+ gdcmVerboseMacro("Document::IsReadable: wrong filetype");
return false;
}
if( TagHT.empty() )
{
- Debug::Verbose(0, "Document::IsReadable: no tags in internal"
- " hash table.");
+ gdcmVerboseMacro("Document::IsReadable: no tags in internal"
+ " hash table.");
return false;
}
if(Fp)
{
- Debug::Verbose( 0,
- "Document::OpenFile is already opened when opening: ",
+ gdcmVerboseMacro( "Document::OpenFile is already opened when opening: " <<
Filename.c_str());
}
Fp = new std::ifstream(Filename.c_str(), std::ios::in | std::ios::binary);
if( ! *Fp )
{
- Debug::Verbose( 0,
- "Document::OpenFile cannot open file: ",
+ gdcmVerboseMacro( "Document::OpenFile cannot open file: " <<
Filename.c_str());
delete Fp;
Fp = 0;
}
CloseFile();
- Debug::Verbose( 0,
- "Document::OpenFile not DICOM/ACR (missing preamble)",
+ gdcmVerboseMacro( "Document::OpenFile not DICOM/ACR (missing preamble)" <<
Filename.c_str());
return 0;
{
if (!RemoveEntry(currentEntry))
{
- Debug::Verbose(0, "Document::ReplaceOrCreateByNumber: removal"
- " of previous DocEntry failed.");
+ gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal"
+ " of previous DocEntry failed.");
return NULL;
}
if ( !AddEntry(valEntry))
{
- Debug::Verbose(0, "Document::ReplaceOrCreateByNumber: AddEntry"
- " failed allthough this is a creation.");
+ gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry"
+ " failed allthough this is a creation.");
delete valEntry;
return NULL;
{
if (!RemoveEntry(currentEntry))
{
- Debug::Verbose(0, "Document::ReplaceOrCreateByNumber: removal"
- " of previous DocEntry failed.");
+ gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal"
+ " of previous DocEntry failed.");
return NULL;
}
if ( !AddEntry(binEntry))
{
- Debug::Verbose(0, "Document::ReplaceOrCreateByNumber: AddEntry"
- " failed allthough this is a creation.");
+ gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry"
+ " failed allthough this is a creation.");
delete binEntry;
return NULL;
{
if (!RemoveEntry(currentEntry))
{
- Debug::Verbose(0, "Document::ReplaceOrCreateByNumber: removal"
- " of previous DocEntry failed.");
+ gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: removal"
+ " of previous DocEntry failed.");
return NULL;
}
if ( !AddEntry(seqEntry))
{
- Debug::Verbose(0, "Document::ReplaceOrCreateByNumber: AddEntry"
+ gdcmVerboseMacro("Document::ReplaceOrCreateByNumber: AddEntry"
" failed allthough this is a creation.");
delete seqEntry;
ValEntry *entry = GetValEntryByNumber(group, element);
if (!entry )
{
- Debug::Verbose(0, "Document::SetEntryByNumber: no corresponding",
+ gdcmVerboseMacro("Document::SetEntryByNumber: no corresponding"
" ValEntry (try promotion first).");
return false;
}
BinEntry *entry = GetBinEntryByNumber(group, element);
if (!entry )
{
- Debug::Verbose(0, "Document::SetEntryByNumber: no corresponding",
+ gdcmVerboseMacro( "Document::SetEntryByNumber: no corresponding"
" ValEntry (try promotion first).");
return false;
}
DocEntry *entry = GetDocEntryByNumber(group, elem);
if (!entry)
{
- Debug::Verbose(1, "Document::GetDocEntryByNumber: no entry");
+ gdcmVerboseMacro("Document::GetDocEntryByNumber: no entry");
return 0;
}
if ( BinEntry *binEntry = dynamic_cast<BinEntry*>(entry) )
uint8_t *a = new uint8_t[l];
if( !a )
{
- Debug::Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
+ gdcmVerboseMacro("Document::LoadEntryBinArea cannot allocate a");
return;
}
{
return entry;
}
- Debug::Verbose(0, "Document::GetValEntryByNumber: unfound ValEntry.");
+ gdcmVerboseMacro("Document::GetValEntryByNumber: unfound ValEntry.");
return 0;
}
{
return entry;
}
- Debug::Verbose(0, "Document::GetBinEntryByNumber: unfound BinEntry.");
+ gdcmVerboseMacro("Document::GetBinEntryByNumber: unfound BinEntry.");
return 0;
}
break;
default :
//std::cout << "swapCode= " << SwapCode << std::endl;
- Debug::Error(" Document::SwapLong : unset swap code");
+ gdcmErrorMacro(" Document::SwapLong : unset swap code");
a = 0;
}
return a;
if ( ! Global::GetVR()->IsVROfBinaryRepresentable(vr) )
{
////// Neither ValEntry NOR BinEntry: should mean UNKOWN VR
- Debug::Verbose(0, "Document::ParseDES: neither Valentry, "
+ gdcmVerboseMacro("Document::ParseDES: neither Valentry, "
"nor BinEntry. Probably unknown VR.");
}
if( length % 2 )
{
newValue = Util::DicomString(str, length+1);
- //Debug::Verbose(0, "Warning: bad length: ", length );
- Debug::Verbose(0, "For string :", newValue.c_str());
+ gdcmVerboseMacro("Warning: bad length: " << length );
+ gdcmVerboseMacro("For string :" << newValue.c_str());
// Since we change the length of string update it length
//entry->SetReadLength(length+1);
}
{
if ( Fp->fail() || Fp->eof())//Fp->gcount() == 1
{
- Debug::Verbose(1, "Document::LoadDocEntry",
+ gdcmVerboseMacro("Document::LoadDocEntry"
"unread element value");
valEntry->SetValue(GDCM_UNREAD);
return;
}
else
{
- Debug::Error(true, "Document::LoadDocEntry"
+ gdcmErrorMacro("Document::LoadDocEntry"
"Should have a ValEntry, here !");
}
}
s << "Warning : Tag with uneven length "
<< foundLength
<< " in x(" << std::hex << gr << "," << elem <<")" << std::dec;
- Debug::Verbose(0, s.str().c_str());
+ gdcmVerboseMacro(s.str().c_str());
}
//////// Fix for some naughty General Electric images.
// Allthough not recent many such GE corrupted images are still present
// on Creatis hard disks. Hence this fix shall remain when such images
- // are no longer in user (we are talking a few years, here)...
+ // are no longer in use (we are talking a few years, here)...
// Note: XMedCom probably uses such a trick since it is able to read
// those pesky GE images ...
if ( foundLength == 13)
<< std::hex << group << " , " << element
<< ") -before- position x(" << filePosition << ")"
<< "lgt : " << length;
- Debug::Verbose(0, "Document::IsDocEntryAnInteger", s.str().c_str() );
+ gdcmVerboseMacro("Document::IsDocEntryAnInteger" << s.str().c_str() );
}
}
if ( group != 0xfffe || ( ( elem != 0xe0dd ) && ( elem != 0xe000 ) ) )
{
- Debug::Verbose(1, "Document::FindDocEntryLengthOBOrOW: neither an Item "
+ gdcmVerboseMacro("Document::FindDocEntryLengthOBOrOW: neither an Item "
"tag nor a Sequence delimiter tag.");
Fp->seekg(positionOnEntry, std::ios::beg);
throw FormatUnexpected("Document::FindDocEntryLengthOBOrOW()",
char *entCur = deb + 128;
if( memcmp(entCur, "DICM", (size_t)4) == 0 )
{
- Debug::Verbose(1, "Document::CheckSwap:", "looks like DICOM Version3");
+ gdcmVerboseMacro("Document::CheckSwap:" "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"
// instead of just checking for UL, OB and UI !? group 0000
{
Filetype = ExplicitVR;
- Debug::Verbose(1, "Document::CheckSwap:",
+ gdcmVerboseMacro( "Document::CheckSwap:"
"explicit Value Representation");
}
else
{
Filetype = ImplicitVR;
- Debug::Verbose(1, "Document::CheckSwap:",
+ gdcmVerboseMacro("Document::CheckSwap:"
"not an explicit Value Representation");
}
if ( net2host )
{
SwapCode = 4321;
- Debug::Verbose(1, "Document::CheckSwap:",
+ gdcmVerboseMacro("Document::CheckSwap:"
"HostByteOrder != NetworkByteOrder");
}
else
{
SwapCode = 0;
- Debug::Verbose(1, "Document::CheckSwap:",
+ gdcmVerboseMacro("Document::CheckSwap:"
"HostByteOrder = NetworkByteOrder");
}
// 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).
- Debug::Verbose(1, "Document::CheckSwap:", "not a DICOM Version3 file");
+ gdcmVerboseMacro("Document::CheckSwap:" "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.
Filetype = ACR;
return true;
default :
- Debug::Verbose(0, "Document::CheckSwap:",
+ gdcmVerboseMacro( "Document::CheckSwap:"
"ACR/NEMA unfound swap info (Really hopeless !)");
Filetype = Unknown;
return false;
*/
void Document::SwitchSwapToBigEndian()
{
- Debug::Verbose(1, "Document::SwitchSwapToBigEndian",
+ gdcmVerboseMacro("Document::SwitchSwapToBigEndian"
"Switching to BigEndian mode.");
if ( SwapCode == 0 )
{
std::string msg;
msg = Util::Format("Falsely explicit vr file (%04x,%04x)\n",
newEntry->GetGroup(), newEntry->GetElement());
- Debug::Verbose(1, "Document::FindVR: ", msg.c_str());
+ gdcmVerboseMacro("Document::FindVR: " << msg.c_str());
}
newEntry->SetImplicitVR();
}
s << std::hex << itemTagGroup << "," << itemTagElement << ")"
<< std::endl;
s << " at address: " << (unsigned)currentPosition << std::endl;
- Debug::Verbose(0, "Document::ReadItemTagLength: wrong Item Tag found:");
- Debug::Verbose(0, s.str().c_str());
+ gdcmVerboseMacro("Document::ReadItemTagLength: wrong Item Tag found:"
+ << s.str().c_str());
Fp->seekg(positionOnEntry, std::ios::beg);
return false;
s << "Basic Item Length is: "
<< itemLength << std::endl;
s << " at address: " << (unsigned)currentPosition << std::endl;
- Debug::Verbose(0, "Document::ReadItemTagLength: ", s.str().c_str());
+ gdcmVerboseMacro("Document::ReadItemTagLength: " << s.str().c_str());
}
return itemLength;
}
std::ostringstream s;
s << " Read one length: ";
s << std::hex << individualLength << std::endl;
- Debug::Verbose(0,
+ gdcmVerboseMacro(0,
"Document::ReadAndSkipEncapsulatedBasicOffsetTable: ",
s.str().c_str());
}
if ( nbRleSegments > 16 )
{
// There should be at most 15 segments (refer to RLEFrame class)
- Debug::Verbose(0, "Document::ComputeRLEInfo: too many segments.");
+ gdcmVerboseMacro("Document::ComputeRLEInfo: too many segments.");
}
uint32_t rleSegmentOffsetTable[16];
// Delimiter Item':
if ( !ReadTag(0xfffe, 0xe0dd) )
{
- Debug::Verbose(0, "Document::ComputeRLEInfo: no sequence delimiter ");
- Debug::Verbose(0, " item at end of RLE item sequence");
+ gdcmVerboseMacro("Document::ComputeRLEInfo: no sequence delimiter "
+ " item at end of RLE item sequence");
}
}
// Delimiter Item':
if ( !ReadTag(0xfffe, 0xe0dd) )
{
- Debug::Verbose(0, "Document::ComputeRLEInfo: no sequence delimiter ");
- Debug::Verbose(0, " item at end of JPEG item sequence");
+ gdcmVerboseMacro("Document::ComputeRLEInfo: no sequence delimiter "
+ " item at end of JPEG item sequence");
}
}
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.38 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if( TagHT.count(key) == 1 )
{
- Debug::Verbose(1, "ElementSet::AddEntry key already present: ",
+ gdcmVerboseMacro("ElementSet::AddEntry key already present: " <<
key.c_str());
return false;
}
if( TagHT.count(key) == 1 )
{
TagHT.erase(key);
- Debug::Verbose(0, "ElementSet::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "ElementSet::RemoveEntry: one element erased.");
delete entryToRemove;
return true;
}
- Debug::Verbose(0, "ElementSet::RemoveEntry: key not present");
+ gdcmVerboseMacro("ElementSet::RemoveEntry: key not present");
return false ;
}
if( TagHT.count(key) == 1 )
{
TagHT.erase(key);
- Debug::Verbose(0, "ElementSet::RemoveEntry: one element erased.");
+ gdcmVerboseMacro("ElementSet::RemoveEntry: one element erased.");
return true;
}
- Debug::Verbose(0, "ElementSet::RemoveEntry: key not present");
+ gdcmVerboseMacro("ElementSet::RemoveEntry: key not present");
return false ;
}
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.184 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.185 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( PixelReadConverter->GetRGBSize() > maxSize )
{
- Debug::Verbose(0, "File::GetImageDataIntoVector: pixel data bigger"
+ gdcmVerboseMacro("File::GetImageDataIntoVector: pixel data bigger"
"than caller's expected MaxSize");
return 0;
}
// Either no LUT conversion necessary or LUT conversion failed
if ( PixelReadConverter->GetRawSize() > maxSize )
{
- Debug::Verbose(0, "File::GetImageDataIntoVector: pixel data bigger"
+ gdcmVerboseMacro("File::GetImageDataIntoVector: pixel data bigger"
"than caller's expected MaxSize");
return 0;
}
std::ofstream fp1(fileName.c_str(), std::ios::out | std::ios::binary );
if (!fp1)
{
- Debug::Verbose(2, "Fail to open (write) file:", fileName.c_str());
+ gdcmVerboseMacro("Fail to open (write) file:" << fileName.c_str());
return false;
}
case WMODE_RAW :
if( decSize!=PixelWriteConverter->GetUserDataSize() )
{
- Debug::Verbose(0, "File::CheckWriteIntegrity: Data size is incorrect (Raw)");
+ gdcmVerboseMacro("File::CheckWriteIntegrity: Data size is incorrect (Raw)");
//std::cerr << "File::CheckWriteIntegrity: Data size is incorrect (Raw)\n"
// << decSize << " / " << PixelWriteConverter->GetUserDataSize() << "\n";
return false;
case WMODE_RGB :
if( rgbSize!=PixelWriteConverter->GetUserDataSize() )
{
- Debug::Verbose(0, "File::CheckWriteIntegrity: Data size is incorrect (RGB)");
+ gdcmVerboseMacro( "File::CheckWriteIntegrity: Data size is incorrect (RGB)");
//std::cerr << "File::CheckWriteIntegrity: Data size is incorrect (RGB)\n"
// << decSize << " / " << PixelWriteConverter->GetUserDataSize() << "\n";
return false;
raw = PixelReadConverter->GetRaw();
if ( ! raw )
{
- Debug::Verbose(0, "File::GetRaw: read/decompress of "
+ gdcmVerboseMacro("File::GetRaw: read/decompress of "
"pixel data apparently went wrong.");
return 0;
}
Program: gdcm
Module: $RCSfile: gdcmGlobal.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:12 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ 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
{
if (ValRes || TranSyn || Dicts || ddElem)
{
- Debug::Verbose(0, "Global::Global : VR or TS or Dicts already allocated");
+ gdcmVerboseMacro("Global::Global : VR or TS or Dicts already allocated");
return;
}
Dicts = new DictSet();
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:13 $
- Version: $Revision: 1.223 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.224 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ios::out | std::ios::binary);
if (*fp == NULL)
{
- Debug::Verbose(2, "Failed to open (write) File: " , fileName.c_str());
+ gdcmVerboseMacro("Failed to open (write) File: " << fileName.c_str());
return false;
}
if ( strSpacing == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetXSpacing: unfound Pixel Spacing (0028,0030)");
+ gdcmVerboseMacro("Header::GetXSpacing: unfound Pixel Spacing (0028,0030)");
return 1.;
}
if ( xspacing == 0.)
{
- Debug::Verbose(0, "Header::GetXSpacing: gdcmData/CT-MONO2-8-abdo.dcm problem");
+ gdcmVerboseMacro("Header::GetXSpacing: 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 );
if ( strSpacing == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetYSpacing: unfound Pixel Spacing (0028,0030)");
+ gdcmVerboseMacro("Header::GetYSpacing: unfound Pixel Spacing (0028,0030)");
return 1.;
}
if ( strSpacingBSlices == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetZSpacing: unfound StrSpacingBSlices");
+ gdcmVerboseMacro("Header::GetZSpacing: unfound StrSpacingBSlices");
const std::string &strSliceThickness = GetEntryByNumber(0x0018,0x0050);
if ( strSliceThickness == GDCM_UNFOUND )
{
if( sscanf( strRescInter.c_str(), "%f", &resInter) != 1 )
{
// bug in the element 0x0028,0x1052
- Debug::Verbose(0, "Header::GetRescaleIntercept: Rescale Slope "
+ gdcmVerboseMacro("Header::GetRescaleIntercept: Rescale Slope "
"is empty");
}
}
if( sscanf( strRescSlope.c_str(), "%f", &resSlope) != 1)
{
// bug in the element 0x0028,0x1053
- Debug::Verbose(0, "Header::GetRescaleSlope: Rescale Slope is empty");
+ gdcmVerboseMacro("Header::GetRescaleSlope: Rescale Slope is empty");
}
}
if ( strImPos == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetXImagePosition: unfound Image "
+ gdcmVerboseMacro("Header::GetXImagePosition: unfound Image "
"Position Patient (0020,0032)");
strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetXImagePosition: unfound Image "
+ gdcmVerboseMacro("Header::GetXImagePosition: unfound Image "
"Position (RET) (0020,0030)");
/// \todo How to tell the caller nothing was found ?
return 0.;
if ( strImPos == GDCM_UNFOUND)
{
- Debug::Verbose(0, "Header::GetYImagePosition: unfound Image "
+ gdcmVerboseMacro("Header::GetYImagePosition: unfound Image "
"Position Patient (0020,0032)");
strImPos = GetEntryByNumber(0x0020,0x0030); // For ACR-NEMA images
if ( strImPos == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetYImagePosition: unfound Image "
+ gdcmVerboseMacro("Header::GetYImagePosition: unfound Image "
"Position (RET) (0020,0030)");
/// \todo How to tell the caller nothing was found ?
return 0.;
{
if( sscanf( strImPos.c_str(), "%f\\%f\\%f", &xImPos, &yImPos, &zImPos) != 3)
{
- Debug::Verbose(0, "Header::GetZImagePosition: wrong Image "
+ gdcmVerboseMacro("Header::GetZImagePosition: wrong Image "
"Position Patient (0020,0032)");
return 0.; // bug in the element 0x0020,0x0032
}
if( sscanf( strImPos.c_str(),
"%f\\%f\\%f", &xImPos, &yImPos, &zImPos ) != 3 )
{
- Debug::Verbose(0, "Header::GetZImagePosition: wrong Image Position (RET) (0020,0030)");
+ gdcmVerboseMacro("Header::GetZImagePosition: wrong Image Position (RET) (0020,0030)");
return 0.; // bug in the element 0x0020,0x0032
}
else
{
if( sscanf( strSliceLocation.c_str(), "%f", &zImPos) != 1)
{
- Debug::Verbose(0, "Header::GetZImagePosition: wrong Slice Location (0020,1041)");
+ gdcmVerboseMacro("Header::GetZImagePosition: wrong Slice Location (0020,1041)");
return 0.; // bug in the element 0x0020,0x1041
}
else
return zImPos;
}
}
- Debug::Verbose(0, "Header::GetZImagePosition: unfound Slice Location (0020,1041)");
+ gdcmVerboseMacro("Header::GetZImagePosition: unfound Slice Location (0020,1041)");
std::string strLocation = GetEntryByNumber(0x0020,0x0050);
if ( strLocation != GDCM_UNFOUND )
{
if( sscanf( strLocation.c_str(), "%f", &zImPos) != 1)
{
- Debug::Verbose(0, "Header::GetZImagePosition: wrong Location (0020,0050)");
+ gdcmVerboseMacro("Header::GetZImagePosition: wrong Location (0020,0050)");
return 0.; // bug in the element 0x0020,0x0050
}
else
return zImPos;
}
}
- Debug::Verbose(0, "Header::GetYImagePosition: unfound Location (0020,0050)");
+ gdcmVerboseMacro("Header::GetYImagePosition: unfound Location (0020,0050)");
return 0.; // Hopeless
}
std::string strSize = GetEntryByNumber( 0x0028, 0x0101 );
if ( strSize == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetBitsStored: this is supposed to "
+ gdcmVerboseMacro("Header::GetBitsStored: this is supposed to "
"be mandatory");
return 0; // It's supposed to be mandatory
// the caller will have to check
std::string strSize = GetEntryByNumber( 0x0028, 0x0102 );
if ( strSize == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetHighBitPosition: this is supposed "
+ gdcmVerboseMacro("Header::GetHighBitPosition: this is supposed "
"to be mandatory");
return 0;
}
std::string strSize = GetEntryByNumber( 0x0028, 0x0103 );
if ( strSize == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::IsSignedPixelData: this is supposed "
+ gdcmVerboseMacro("Header::IsSignedPixelData: this is supposed "
"to be mandatory");
return false;
}
std::string strSize = GetEntryByNumber(0x0028,0x0100);
if ( strSize == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetBitsStored: this is supposed to "
+ gdcmVerboseMacro("Header::GetBitsStored: this is supposed to "
"be mandatory");
return 0; // It's supposed to be mandatory
// the caller will have to check
const std::string& strSize = GetEntryByNumber(0x0028,0x0002);
if ( strSize == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetBitsStored: this is supposed to "
+ gdcmVerboseMacro("Header::GetBitsStored: this is supposed to "
"be mandatory");
return 1; // Well, it's supposed to be mandatory ...
// but sometimes it's missing : *we* assume Gray pixels
}
if ( PhotometricInterp == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::IsMonochrome: absent Photometric "
+ gdcmVerboseMacro("Header::IsMonochrome: absent Photometric "
"Interpretation");
}
return false;
}
if ( PhotometricInterp == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::IsPaletteColor: absent Photometric "
+ gdcmVerboseMacro( "Header::IsPaletteColor: absent Photometric "
"Interpretation");
}
return false;
}
if ( PhotometricInterp == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::IsYBRFull: absent Photometric "
+ gdcmVerboseMacro("Header::IsYBRFull: absent Photometric "
"Interpretation");
}
return false;
{
return 8;
}
- Debug::Verbose(0, "Header::GetPixelSize: Unknown pixel type");
+ gdcmVerboseMacro("Header::GetPixelSize: Unknown pixel type");
return 0;
}
std::string bitsAlloc = GetEntryByNumber(0x0028, 0x0100); // Bits Allocated
if ( bitsAlloc == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetPixelType: unfound Bits Allocated");
+ gdcmVerboseMacro("Header::GetPixelType: unfound Bits Allocated");
bitsAlloc = "16";
}
if (sign == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetPixelType: unfound Pixel Representation");
+ gdcmVerboseMacro("Header::GetPixelType: unfound Pixel Representation");
bitsAlloc = "0";
}
else if ( sign == "0" )
}
if ( transfertSyntax == GDCM_UNFOUND )
{
- Debug::Verbose(0, "Header::GetTransfertSyntaxName:"
+ gdcmVerboseMacro( "Header::GetTransfertSyntaxName:"
" unfound Transfert Syntax (0002,0010)");
return "Uncompressed ACR-NEMA";
}
if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f",
&iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 )
{
- Debug::Verbose(0, "Header::GetImageOrientationPatient: "
+ gdcmVerboseMacro("Header::GetImageOrientationPatient: "
"wrong Image Orientation Patient (0020,0037)");
}
}
if( sscanf( strImOriPat.c_str(), "%f\\%f\\%f\\%f\\%f\\%f",
&iop[0], &iop[1], &iop[2], &iop[3], &iop[4], &iop[5]) != 6 )
{
- Debug::Verbose(0, "Header::GetImageOrientationPatient: "
+ gdcmVerboseMacro("Header::GetImageOrientationPatient: "
"wrong Image Orientation Patient (0020,0035)");
}
}
Program: gdcm
Module: $RCSfile: gdcmPixelReadConvert.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:13 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2005/01/07 19:20:38 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if ( numberOfReadBytes > fragmentSize )
{
- Debug::Verbose(0, "PixelReadConvert::ReadAndDecompressRLEFragment: we "
+ gdcmVerboseMacro("PixelReadConvert::ReadAndDecompressRLEFragment: we "
"read more bytes than the segment size.");
return false;
}
}
break;
default:
- Debug::Verbose( 0, "PixelReadConvert::ConvertSwapZone: SwapCode value "
+ gdcmVerboseMacro( "PixelReadConvert::ConvertSwapZone: SwapCode value "
"(16 bits) not allowed." );
}
}
}
break;
default:
- Debug::Verbose( 0, "PixelReadConvert::ConvertSwapZone: SwapCode value "
+ gdcmVerboseMacro( "PixelReadConvert::ConvertSwapZone: SwapCode value "
"(32 bits) not allowed." );
}
}
else
{
// other JPEG lossy not supported
- Debug::Error("PixelReadConvert::ReadAndDecompressJPEGFile: unknown "
+ gdcmErrorMacro("PixelReadConvert::ReadAndDecompressJPEGFile: unknown "
"jpeg lossy compression ");
return false;
}
if ( ! gdcm_read_JPEG_memory8( buffer, totalLength, Raw,
&howManyRead, &howManyWritten ) )
{
- Debug::Error(
+ gdcmErrorMacro(
"PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg8 "
);
delete [] buffer;
if ( ! gdcm_read_JPEG_memory12( buffer, totalLength, Raw,
&howManyRead, &howManyWritten ) )
{
- Debug::Error(
+ gdcmErrorMacro(
"PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg12 "
);
delete [] buffer;
if ( ! gdcm_read_JPEG_memory16( buffer, totalLength, Raw,
&howManyRead, &howManyWritten ) )
{
- Debug::Error(
+ gdcmErrorMacro(
"PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg16 "
);
delete [] buffer;
else
{
// other JPEG lossy not supported
- Debug::Error("PixelConvert::ReadAndDecompressJPEGFile: unknown "
+ gdcmErrorMacro("PixelConvert::ReadAndDecompressJPEGFile: unknown "
"jpeg lossy compression ");
delete [] buffer;
return false;
Raw+howManyWritten,
&howManyRead, &howManyWritten ) )
{
- Debug::Error("PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg8 ");
+ gdcmErrorMacro("PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg8 ");
delete [] buffer;
return false;
}
Raw+howManyWritten,
&howManyRead, &howManyWritten ) )
{
- Debug::Error("PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg12 ");
+ gdcmErrorMacro("PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg12 ");
delete [] buffer;
return false;
}
Raw+howManyWritten,
&howManyRead, &howManyWritten ) )
{
- Debug::Error("PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg16 ");
+ gdcmErrorMacro("PixelConvert::ReadAndDecompressJPEGFile: failed to read jpeg16 ");
delete [] buffer;
return false;
}
else
{
// other JPEG lossy not supported
- Debug::Error("PixelConvert::ReadAndDecompressJPEGFile: unknown "
+ gdcmErrorMacro("PixelConvert::ReadAndDecompressJPEGFile: unknown "
"jpeg lossy compression ");
delete [] buffer;
return false;
}
else
{
- Debug::Verbose(0, "PixelReadConvert::ConvertReArrangeBits: weird image");
+ gdcmVerboseMacro("PixelReadConvert::ConvertReArrangeBits: weird image");
throw FormatError( "PixelReadConvert::ConvertReArrangeBits()",
"weird image !?" );
}
//// First stage: get our hands on the Pixel Data.
if ( !fp )
{
- Debug::Verbose( 0, "PixelReadConvert::ReadAndDecompressPixelData: "
+ gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
"unavailable file pointer." );
return false;
}
fp->seekg( PixelOffset, std::ios::beg );
if( fp->fail() || fp->eof()) //Fp->gcount() == 1
{
- Debug::Verbose( 0, "PixelReadConvert::ReadAndDecompressPixelData: "
+ gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
"unable to find PixelOffset in file." );
return false;
}
// variable). But RawSize is the right size of the image !
if( PixelDataLength != RawSize)
{
- Debug::Verbose( 0, "PixelReadConvert::ReadAndDecompressPixelData: "
+ gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
"Mismatch between PixelReadConvert and RawSize." );
}
if( PixelDataLength > RawSize)
if ( fp->fail() || fp->eof())//Fp->gcount() == 1
{
- Debug::Verbose( 0, "PixelReadConvert::ReadAndDecompressPixelData: "
+ gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
"reading of Raw pixel data failed." );
return false;
}
{
if ( ! ReadAndDecompressRLEFile( fp ) )
{
- Debug::Verbose( 0, "PixelReadConvert::ReadAndDecompressPixelData: "
+ gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
"RLE decompressor failed." );
return false;
}
// Default case concerns JPEG family
if ( ! ReadAndDecompressJPEGFile( fp ) )
{
- Debug::Verbose( 0, "PixelReadConvert::ReadAndDecompressPixelData: "
+ gdcmVerboseMacro( "PixelReadConvert::ReadAndDecompressPixelData: "
"JPEG decompressor failed." );
return false;
}
LutRedData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1201 );
if ( ! LutRedData )
{
- Debug::Verbose(0, "PixelReadConvert::GrabInformationsFromHeader: "
+ gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: "
"unable to read red LUT data" );
}
LutGreenData = (uint8_t*)header->GetEntryBinAreaByNumber(0x0028, 0x1202 );
if ( ! LutGreenData)
{
- Debug::Verbose(0, "PixelReadConvert::GrabInformationsFromHeader: "
+ gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: "
"unable to read green LUT data" );
}
LutBlueData = (uint8_t*)header->GetEntryBinAreaByNumber( 0x0028, 0x1203 );
if ( ! LutBlueData )
{
- Debug::Verbose(0, "PixelReadConvert::GrabInformationsFromHeader: "
+ gdcmVerboseMacro("PixelReadConvert::GrabInformationsFromHeader: "
"unable to read blue LUT data" );
}
}
&lengthR, &debR, &nbitsR );
if( nbRead != 3 )
{
- Debug::Verbose(0, "PixelReadConvert::BuildLUTRGBA: wrong red LUT descriptor");
+ gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong red LUT descriptor");
}
int lengthG; // Green LUT length in Bytes
&lengthG, &debG, &nbitsG );
if( nbRead != 3 )
{
- Debug::Verbose(0, "PixelReadConvert::BuildLUTRGBA: wrong green LUT descriptor");
+ gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong green LUT descriptor");
}
int lengthB; // Blue LUT length in Bytes
&lengthB, &debB, &nbitsB );
if( nbRead != 3 )
{
- Debug::Verbose(0, "PixelReadConvert::BuildLUTRGBA: wrong blue LUT descriptor");
+ gdcmVerboseMacro("PixelReadConvert::BuildLUTRGBA: wrong blue LUT descriptor");
}
////////////////////////////////////////////////////////
}
else
{
- Debug::Verbose(0, "PixelReadConvert::Print: set as RLE file "
+ gdcmVerboseMacro("PixelReadConvert::Print: set as RLE file "
"but NO RLEinfo present.");
}
}
}
else
{
- Debug::Verbose(0, "PixelReadConvert::Print: set as JPEG file "
+ gdcmVerboseMacro("PixelReadConvert::Print: set as JPEG file "
"but NO JPEGinfo present.");
}
}
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:13 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2005/01/07 19:20:39 $
+ Version: $Revision: 1.47 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if( *it == entryToRemove)
{
DocEntries.erase(it);
- Debug::Verbose(0, "SQItem::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "SQItem::RemoveEntry: one element erased.");
delete entryToRemove;
return true;
}
}
- Debug::Verbose(0, "SQItem::RemoveEntry: value not present ");
+ gdcmVerboseMacro( "SQItem::RemoveEntry: value not present ");
return false ;
}
if( *it == entryToRemove)
{
DocEntries.erase(it);
- Debug::Verbose(0, "SQItem::RemoveEntry: one element erased.");
+ gdcmVerboseMacro( "SQItem::RemoveEntry: one element erased.");
return true;
}
}
- Debug::Verbose(0, "SQItem::RemoveEntry: value not present ");
+ gdcmVerboseMacro( "SQItem::RemoveEntry: value not present ");
return false ;
}
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:13 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2005/01/07 19:20:39 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from(filename.c_str());
if( !from )
{
- Debug::Verbose(2, "TS::TS: can't open dictionary", filename.c_str());
+ gdcmVerboseMacro("TS::TS: can't open dictionary" << filename.c_str());
FillDefaultTSDict( TsMap );
}
else
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2005/01/07 16:26:13 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2005/01/07 19:20:39 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::ifstream from(filename.c_str());
if(!from)
{
- Debug::Verbose(2, "VR::VR: can't open dictionary", filename.c_str());
+ gdcmVerboseMacro("VR::VR: can't open dictionary" << filename.c_str());
FillDefaultVRDict(vr);
}
else