From: malaterre Date: Tue, 7 Dec 2004 02:36:21 +0000 (+0000) Subject: STYLE: Minor cleanup + speedup X-Git-Tag: Version1.0.bp~531 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=424edddc16b19a77e9790e4918b6b42bf969fbaf;p=gdcm.git STYLE: Minor cleanup + speedup --- diff --git a/src/gdcmHeader.cxx b/src/gdcmHeader.cxx index 62b38d49..1857184c 100644 --- a/src/gdcmHeader.cxx +++ b/src/gdcmHeader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmHeader.cxx,v $ Language: C++ - Date: $Date: 2004/12/03 16:57:49 $ - Version: $Revision: 1.211 $ + Date: $Date: 2004/12/07 02:36:21 $ + Version: $Revision: 1.212 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -369,12 +369,12 @@ float Header::GetZSpacing() // Si le Spacing Between Slices est absent, // on suppose que les coupes sont jointives - std::string strSpacingBSlices = GetEntryByNumber(0x0018,0x0088); + const std::string &strSpacingBSlices = GetEntryByNumber(0x0018,0x0088); if ( strSpacingBSlices == GDCM_UNFOUND ) { dbg.Verbose(0, "Header::GetZSpacing: unfound StrSpacingBSlices"); - std::string strSliceThickness = GetEntryByNumber(0x0018,0x0050); + const std::string &strSliceThickness = GetEntryByNumber(0x0018,0x0050); if ( strSliceThickness == GDCM_UNFOUND ) { return 1.; @@ -388,11 +388,8 @@ float Header::GetZSpacing() return (float)atof( strSliceThickness.c_str() ); } } - else - { - return (float)atof( strSpacingBSlices.c_str() ); - } - return 1.; + //else + return (float)atof( strSpacingBSlices.c_str() ); } /** @@ -403,7 +400,7 @@ float Header::GetRescaleIntercept() { float resInter = 0.; /// 0028 1052 DS IMG Rescale Intercept - std::string strRescInter = GetEntryByNumber(0x0028,0x1052); + const std::string &strRescInter = GetEntryByNumber(0x0028,0x1052); if ( strRescInter != GDCM_UNFOUND ) { if( sscanf( strRescInter.c_str(), "%f", &resInter) != 1 )