+ if ( tokens[3] == "gdcmUnfound") // sometimes Trigger Time is not found. CreateUserDefinedFileIdentifier is not aware of the pb.
+ {
+ ///this is a trick to build up a lexicographical compliant name :
+ /// eg : fich001.ima vs fich100.ima as opposed to fich1.ima vs fich100.ima
+ std::string name = gdcm::Util::GetName( *it );
+ if (hasSkel)
+ {
+ gdcm::Util::Tokenize (name, tokensForFileName, skel);
+ imageNum = atoi ( tokensForFileName[0].c_str() );
+ // probabely we could write something much more complicated using C++ !
+ sprintf (newName, "%s%06d%s", skel, imageNum, extent);
+ tokens[3] = newName;
+ tokensForFileName.clear();
+ }
+ else
+ tokens[3] = name;
+
+
+ userFileIdentifier = tokens[0] + token + tokens[1] + token + tokens[2] + token
+ + tokens[3] + token + tokens[4] + token;
+ }
+ if (verbose)
+ std::cout << "[" << userFileIdentifier << "]" << std::endl;
+