-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.15 2003/11/03 10:49:31 jpr Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeaderHelper.cxx,v 1.17 2003/11/12 14:06:35 malaterre Exp $
#include "gdcmHeaderHelper.h"
#include "gdcmUtil.h" //for debug
#include <math.h>
#include <algorithm>
-#include <string.h> //for bzero
+//#include <string.h> //for bzero
//directory manipulation (os indep).
//cygwin ???? -> _WIN32 ??
{
return GetPubElValByNumber(0x0008,0x0018); //0008 0018 UI ID SOP Instance UID
}
+//----------------------------------------------------------------------------
+float gdcmHeaderHelper::GetRescaleIntercept()
+{
+ float resInter = 0.;
+ std::string StrRescInter = GetPubElValByNumber(0x0028,0x1052); //0028 1052 DS IMG Rescale Intercept
+ if (StrRescInter != GDCM_UNFOUND) {
+ if( sscanf( StrRescInter.c_str(), "%f", &resInter) != 1) {
+ dbg.Verbose(0, "gdcmHeader::GetRescaleIntercept: Rescale Slope is empty");
+ // bug in the element 0x0028,0x1052
+ }
+ }
+ return resInter;
+}
+//----------------------------------------------------------------------------
+float gdcmHeaderHelper::GetRescaleSlope()
+{
+ float resSlope = 1.;
+ std::string StrRescSlope = GetPubElValByNumber(0x0028,0x1053); //0028 1053 DS IMG Rescale Slope
+ if (StrRescSlope != GDCM_UNFOUND) {
+ if( sscanf( StrRescSlope.c_str(), "%f", &resSlope) != 1) {
+ dbg.Verbose(0, "gdcmHeader::GetRescaleSlope: Rescale Slope is empty");
+ // bug in the element 0x0028,0x1053
+ }
+ }
+ return resSlope;
+}