X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHelper.cxx;h=8b7ec07e39d881c74904c6951899f830335e0905;hb=4962adb161e312436550b1569781c520d4fea97e;hp=3761252f910ed4e0294ac29afa763463654249b9;hpb=3a0c4256baa5052f854ac46751b93a3e0d0e5f7a;p=gdcm.git diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index 3761252f..8b7ec07e 100644 --- a/src/gdcmSerieHelper.cxx +++ b/src/gdcmSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2006/01/18 15:25:07 $ - Version: $Revision: 1.42 $ + Date: $Date: 2006/01/26 09:07:15 $ + Version: $Revision: 1.44 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -960,7 +960,7 @@ std::string SerieHelper::CreateUserDefinedFileIdentifier( File * inFile ) // Deal with all user supplied tags. // (user knows more than we do about his images!) - float converted; + double converted; std::string id; std::string s; char charConverted[17]; @@ -976,12 +976,15 @@ std::string SerieHelper::CreateUserDefinedFileIdentifier( File * inFile ) // e.g : 100 would be *before* 20; 000020.00 vs 00100.00 : OK if (it2->convert) { - converted = atof(s.c_str()); - // probabely something much more complicated is possible, - // using C++ features - /// \todo check the behaviour when there are >0 and <0 numbers - sprintf(charConverted, "%016.6f",converted); - s = charConverted; + if ( s != GDCM_UNFOUND) // Don't convert unfound fields ! + { + converted = atof(s.c_str()); + // probabely something much more complicated is possible, + // using C++ features + /// \todo check the behaviour when there are >0 and <0 numbers + sprintf(charConverted, "%016.6f",converted); + s = charConverted; + } } // Eliminate non-alphanum characters, including whitespace. for(unsigned int i=0; i