gdcmDebug.h File Reference

#include "gdcmCommon.h"
#include "gdcmCommand.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <assert.h>
#include <errno.h>

Include dependency graph for gdcmDebug.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  GDCM_NAME_SPACE

Classes

class  GDCM_NAME_SPACE::Debug
 Debug is an object for warning/logging/tracing programs. It has the following modes :
  • error : for bad library use, seriously wrong DICOM
  • debug : for information/debug messages
  • warning : Warns the user when some oddity occured.
  • log : we display messages when anything is not Dicom Kosher
  • debug : we help developper to trace, at a glance, the execution
  • assert : design by contract implementation. A function should have proper input and proper output. (should not happen, not user controlled).
More...

Defines

#define GDCM_FUNCTION   "<unknow>"
#define gdcmMessageBodyMacro(type, obj, msg, adds)
 Debug : To be used to help bug tracking developer.
#define gdcmDebugBodyMacro(obj, msg)
 Debug : To be used to help bug tracking developer.
#define gdcmDebugMacro(msg)   gdcmDebugBodyMacro(NULL,msg)
#define gdcmStaticDebugMacro(msg)   gdcmDebugBodyMacro(NULL,msg)
#define gdcmLogBodyMacro(obj, msg)
 Log : we display messages when anything is not Dicom Kosher.
#define gdcmLogMacro(msg)   gdcmLogBodyMacro(this,msg)
#define gdcmStaticLogMacro(msg)   gdcmLogBodyMacro(NULL,msg)
#define gdcmWarningBodyMacro(obj, msg)
 Warning : To be used to warn the user when some oddity occurs.
#define gdcmWarningMacro(msg)   gdcmWarningBodyMacro(this,msg)
#define gdcmStaticWarningMacro(msg)   gdcmWarningBodyMacro(NULL,msg)
#define gdcmErrorBodyMacro(obj, msg)
 Error : To be used when unecoverabale error occurs at a 'deep' level. (don't use it if file is not ACR/DICOM!).
#define gdcmErrorMacro(msg)   gdcmErrorBodyMacro(this,msg)
#define gdcmStaticErrorMacro(msg)   gdcmErrorBodyMacro(NULL,msg)
#define gdcmAssertBodyMacro(obj, arg)
 Assert : To be used when an *absolutely* impossible error occurs No function should be allowed to stop the process instead of warning the caller!
#define gdcmAssertMacro(msg)   gdcmAssertBodyMacro(NULL,msg)
#define gdcmStaticAssertMacro(msg)   gdcmAssertBodyMacro(NULL,msg)


Define Documentation

#define GDCM_FUNCTION   "<unknow>"
 

Definition at line 157 of file gdcmDebug.h.

#define gdcmAssertBodyMacro obj,
arg   ) 
 

Value:

{                                                              \
   if( !(arg) )                                                \
   {                                                           \
      gdcmMessageBodyMacro(GDCM_NAME_SPACE::CMD_ASSERT,obj,"","");\
      assert ( arg );                                          \
   }                                                           \
}
Assert : To be used when an *absolutely* impossible error occurs No function should be allowed to stop the process instead of warning the caller!

Parameters:
obj current instance or NULL
arg argument to test An easy solution to pass also a message is to do: gdcmAssertMacro( "my message" && 2 < 3 )

Definition at line 278 of file gdcmDebug.h.

#define gdcmAssertMacro msg   )     gdcmAssertBodyMacro(NULL,msg)
 

Definition at line 286 of file gdcmDebug.h.

Referenced by GDCM_NAME_SPACE::Util::DicomString(), GDCM_NAME_SPACE::FileHelper::FileHelper(), GDCM_NAME_SPACE::RLEFrame::GetLength(), GDCM_NAME_SPACE::DirList::GetNext(), GDCM_NAME_SPACE::DictSet::GetNextDict(), GDCM_NAME_SPACE::ElementSet::GetNextEntry(), GDCM_NAME_SPACE::Dict::GetNextEntry(), GDCM_NAME_SPACE::JPEGFragmentsInfo::GetNextFragment(), GDCM_NAME_SPACE::RLEFramesInfo::GetNextFrame(), GDCM_NAME_SPACE::DicomDirSerie::GetNextImage(), GDCM_NAME_SPACE::DicomDir::GetNextPatient(), GDCM_NAME_SPACE::DicomDirSerie::GetNextPrivate(), GDCM_NAME_SPACE::DicomDirStudy::GetNextSerie(), GDCM_NAME_SPACE::SerieHelper::GetNextSingleSerieUIDFileSet(), GDCM_NAME_SPACE::SeqEntry::GetNextSQItem(), GDCM_NAME_SPACE::DicomDirPatient::GetNextStudy(), GDCM_NAME_SPACE::DicomDirStudy::GetNextVisit(), GDCM_NAME_SPACE::RLEFrame::GetOffset(), GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressJPEGFile(), GDCM_NAME_SPACE::RLEFrame::SetLength(), GDCM_NAME_SPACE::RLEFrame::SetOffset(), GDCM_NAME_SPACE::DocEntry::WriteContent(), and GDCM_NAME_SPACE::DocEntry::~DocEntry().

#define gdcmDebugBodyMacro obj,
msg   ) 
 

Value:

{                                                              \
   if( Debug::GetDebugFlag() )                                 \
   {                                                           \
      std::string adds="";                                     \
      if( errno )                                              \
      {                                                        \
         adds = "Last system error was: ";                     \
         adds += strerror(errno);                              \
         adds += "\n";                                         \
      }                                                        \
      gdcmMessageBodyMacro(GDCM_NAME_SPACE::CMD_DEBUG,obj,msg,adds);\
   }                                                           \
}
Debug : To be used to help bug tracking developer.

Parameters:
obj current instance or NULL
msg message part

Definition at line 188 of file gdcmDebug.h.

#define gdcmDebugMacro msg   )     gdcmDebugBodyMacro(NULL,msg)
 

Definition at line 202 of file gdcmDebug.h.

Referenced by GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::PixelReadConvert::BuildLUTRGBA(), GDCM_NAME_SPACE::PixelReadConvert::BuildRGBImage(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::Document::CheckSwap(), GDCM_NAME_SPACE::PixelReadConvert::ConvertHandleColor(), GDCM_NAME_SPACE::DicomDir::CreateDicomDir(), GDCM_NAME_SPACE::DicomDir::CreateDicomDirChainedList(), GDCM_NAME_SPACE::Dict::Dict(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::DicomDir::DoTheLoadingJob(), GDCM_NAME_SPACE::Document::GetTransferSyntaxName(), GDCM_NAME_SPACE::Document::HandleBrokenEndian(), GDCM_NAME_SPACE::Document::HandleOutOfGroup0002(), GDCM_NAME_SPACE::File::IsPaletteColor(), GDCM_NAME_SPACE::File::IsYBRFull(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::Document::ParseDES(), GDCM_NAME_SPACE::File::ReadEncapsulatedBasicOffsetTable(), GDCM_NAME_SPACE::File::ReadTagLength(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), GDCM_NAME_SPACE::SerieHelper::SplitOnTagValue(), GDCM_NAME_SPACE::Document::SwitchByteSwapCode(), GDCM_NAME_SPACE::File::Write(), GDCM_NAME_SPACE::DataEntry::WriteContent(), and GDCM_NAME_SPACE::PixelWriteConvert::~PixelWriteConvert().

#define gdcmErrorBodyMacro obj,
msg   ) 
 

Value:

Error : To be used when unecoverabale error occurs at a 'deep' level. (don't use it if file is not ACR/DICOM!).

Parameters:
obj current instance or NULL
msg second message part

Definition at line 256 of file gdcmDebug.h.

#define gdcmErrorMacro msg   )     gdcmErrorBodyMacro(this,msg)
 

Definition at line 260 of file gdcmDebug.h.

Referenced by GDCM_NAME_SPACE::Dict::AddEntry(), GDCM_NAME_SPACE::DicomDir::CreateDicomDir(), GDCM_NAME_SPACE::JPEGFragment::DecompressJPEGFramesFromFile(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::DicomDir::DoTheLoadingJob(), GDCM_NAME_SPACE::Document::FixDocEntryFoundLength(), GDCM_NAME_SPACE::Document::GetTransferSyntaxName(), GDCM_NAME_SPACE::DataEntry::GetValue(), GDCM_NAME_SPACE::File::GetXOrigin(), GDCM_NAME_SPACE::File::GetYOrigin(), GDCM_NAME_SPACE::File::GetZOrigin(), GDCM_NAME_SPACE::DicomDir::IsReadable(), GDCM_NAME_SPACE::File::ReadTag(), GDCM_NAME_SPACE::File::ReadTagLength(), GDCM_NAME_SPACE::DicomDir::SetElement(), GDCM_NAME_SPACE::DataEntry::SetValue(), GDCM_NAME_SPACE::Document::SwapDouble(), and GDCM_NAME_SPACE::Document::SwapLong().

#define gdcmLogBodyMacro obj,
msg   ) 
 

Value:

{                                                          \
   if( Debug::GetLogFlag() )                               \
      gdcmMessageBodyMacro(GDCM_NAME_SPACE::CMD_LOG,obj,msg,"");\
}
Log : we display messages when anything is not Dicom Kosher.

Parameters:
obj current instance or NULL
msg message part

Definition at line 217 of file gdcmDebug.h.

#define gdcmLogMacro msg   )     gdcmLogBodyMacro(this,msg)
 

Definition at line 222 of file gdcmDebug.h.

#define gdcmMessageBodyMacro type,
obj,
msg,
adds   ) 
 

Value:

{                                                              \
   std::ostringstream osmacro;                                 \
   osmacro << "In " __FILE__ ", line " << __LINE__             \
           << ", function " << GDCM_FUNCTION << "\n"           \
           << adds << msg << "\n\n";                           \
   GDCM_NAME_SPACE::Debug::SendToOutput(type,osmacro.str(),obj);\
}
Debug : To be used to help bug tracking developer.

Parameters:
type type
obj obj
msg message part
adds adds

Definition at line 167 of file gdcmDebug.h.

#define gdcmStaticAssertMacro msg   )     gdcmAssertBodyMacro(NULL,msg)
 

Definition at line 288 of file gdcmDebug.h.

#define gdcmStaticDebugMacro msg   )     gdcmDebugBodyMacro(NULL,msg)
 

Definition at line 204 of file gdcmDebug.h.

#define gdcmStaticErrorMacro msg   )     gdcmErrorBodyMacro(NULL,msg)
 

Definition at line 262 of file gdcmDebug.h.

Referenced by GDCM_NAME_SPACE::DirList::IsDirectory().

#define gdcmStaticLogMacro msg   )     gdcmLogBodyMacro(NULL,msg)
 

Definition at line 224 of file gdcmDebug.h.

#define gdcmStaticWarningMacro msg   )     gdcmWarningBodyMacro(NULL,msg)
 

Definition at line 243 of file gdcmDebug.h.

Referenced by GDCM_NAME_SPACE::DictSet::BuildDictPath(), GDCM_NAME_SPACE::Util::GetMACAddress(), and GDCM_NAME_SPACE::Global::Global().

#define gdcmWarningBodyMacro obj,
msg   ) 
 

Value:

{                                                              \
   if( Debug::GetWarningFlag() )                               \
      gdcmMessageBodyMacro(GDCM_NAME_SPACE::CMD_WARNING,obj,msg,"");\
}
Warning : To be used to warn the user when some oddity occurs.

Parameters:
obj current instance or NULL
msg message part

Definition at line 236 of file gdcmDebug.h.

#define gdcmWarningMacro msg   )     gdcmWarningBodyMacro(this,msg)
 

Definition at line 241 of file gdcmDebug.h.

Referenced by GDCM_NAME_SPACE::Dict::AddDict(), GDCM_NAME_SPACE::ElementSet::AddEntry(), GDCM_NAME_SPACE::File::AnonymizeNoLoad(), GDCM_NAME_SPACE::PixelReadConvert::BuildLUTRGBA(), GDCM_NAME_SPACE::Document::CheckSwap(), GDCM_NAME_SPACE::FileHelper::CheckWriteIntegrity(), GDCM_NAME_SPACE::File::ComputeJPEGFragmentInfo(), GDCM_NAME_SPACE::File::ComputeRLEInfo(), GDCM_NAME_SPACE::PixelReadConvert::ConvertRGBPlanesToRGBPixels(), GDCM_NAME_SPACE::PixelReadConvert::ConvertSwapZone(), GDCM_NAME_SPACE::PixelReadConvert::ConvertYcBcRPlanesToRGBPixels(), GDCM_NAME_SPACE::DicomDir::CreateDicomDir(), GDCM_NAME_SPACE::DicomDirElement::DicomDirElement(), GDCM_NAME_SPACE::Dict::Dict(), GDCM_NAME_SPACE::DictGroupName::DictGroupName(), GDCM_NAME_SPACE::Document::DoTheLoadingDocumentJob(), GDCM_NAME_SPACE::DicomDir::DoTheLoadingJob(), GDCM_NAME_SPACE::Document::FindDocEntryLength(), GDCM_NAME_SPACE::Document::FindDocEntryLengthOBOrOW(), GDCM_NAME_SPACE::Document::FindDocEntryVR(), GDCM_NAME_SPACE::Document::FixDocEntryFoundLength(), GDCM_NAME_SPACE::gdcm_read_JPEGLS_file(), GDCM_NAME_SPACE::File::GetBitsAllocated(), GDCM_NAME_SPACE::File::GetBitsStored(), GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::File::GetHighBitPosition(), GDCM_NAME_SPACE::File::GetImageOrientationPatient(), GDCM_NAME_SPACE::File::GetImagePositionPatient(), GDCM_NAME_SPACE::Orientation::GetOrientationType(), GDCM_NAME_SPACE::File::GetPixelAreaLength(), GDCM_NAME_SPACE::File::GetPixelOffset(), GDCM_NAME_SPACE::File::GetPixelSize(), GDCM_NAME_SPACE::File::GetPixelType(), GDCM_NAME_SPACE::FileHelper::GetRaw(), GDCM_NAME_SPACE::File::GetRescaleIntercept(), GDCM_NAME_SPACE::File::GetRescaleSlope(), GDCM_NAME_SPACE::File::GetRescaleSlopeIntercept(), GDCM_NAME_SPACE::File::GetSamplesPerPixel(), GDCM_NAME_SPACE::File::GetSpacing(), GDCM_NAME_SPACE::Document::GetTransferSyntax(), GDCM_NAME_SPACE::File::GetTSize(), GDCM_NAME_SPACE::File::GetXOrigin(), GDCM_NAME_SPACE::File::GetXSpacing(), GDCM_NAME_SPACE::File::GetYOrigin(), GDCM_NAME_SPACE::File::GetYSpacing(), GDCM_NAME_SPACE::File::GetZSpacing(), GDCM_NAME_SPACE::Document::HandleBrokenEndian(), GDCM_NAME_SPACE::Document::HandleOutOfGroup0002(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry(), GDCM_NAME_SPACE::Document::IsDocEntryAnInteger(), GDCM_NAME_SPACE::File::IsMonochrome(), GDCM_NAME_SPACE::File::IsMonochrome1(), GDCM_NAME_SPACE::Document::IsParsable(), GDCM_NAME_SPACE::File::IsReadable(), GDCM_NAME_SPACE::DicomDir::IsReadable(), GDCM_NAME_SPACE::File::IsSignedPixelData(), GDCM_NAME_SPACE::Document::Load(), GDCM_NAME_SPACE::Document::LoadEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::NewDataEntry(), GDCM_NAME_SPACE::DocEntrySet::NewSeqEntry(), GDCM_NAME_SPACE::Document::ParseSQ(), GDCM_NAME_SPACE::SerieHelper::Print(), GDCM_NAME_SPACE::PixelReadConvert::Print(), GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressJPEGFile(), GDCM_NAME_SPACE::PixelReadConvert::ReadAndDecompressPixelData(), GDCM_NAME_SPACE::RLEFrame::ReadAndDecompressRLEFragment(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::File::ReadTag(), GDCM_NAME_SPACE::Dict::RemoveDict(), GDCM_NAME_SPACE::DicomDir::SetElement(), GDCM_NAME_SPACE::DocEntrySet::SetEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::SetEntryString(), GDCM_NAME_SPACE::SerieHelper::SplitOnPosition(), GDCM_NAME_SPACE::VR::VR(), GDCM_NAME_SPACE::File::Write(), GDCM_NAME_SPACE::DicomDir::Write(), and GDCM_NAME_SPACE::FileHelper::WriteRawData().


Generated on Fri Aug 24 12:59:58 2007 for gdcm by  doxygen 1.4.6