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)");
}
}