X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDictGroupName.cxx;h=bc6477d802920811c41c4ecd58fcdfc6e19f318b;hb=76ac46b16fd92d0fb444f786d4946424d9029315;hp=680c199d85ab1573d30bbdeddae61c94e4aaf573;hpb=3a9e9df62b3198c4f93d1768074b6be828ac7308;p=gdcm.git diff --git a/src/gdcmDictGroupName.cxx b/src/gdcmDictGroupName.cxx index 680c199d..bc6477d8 100644 --- a/src/gdcmDictGroupName.cxx +++ b/src/gdcmDictGroupName.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDictGroupName.cxx,v $ Language: C++ - Date: $Date: 2005/04/05 10:56:25 $ - Version: $Revision: 1.1 $ + Date: $Date: 2007/05/23 14:18:09 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,11 +23,12 @@ #include #include +#include -namespace gdcm +namespace GDCM_NAME_SPACE { //----------------------------------------------------------------------------- -/// \brief auto generated function, to fill up the 'Value Representation' +/// \brief auto generated function, to fill up the 'Group Name' /// Dictionnary, if relevant file is not found on user's disk void FillDefaultDictGroupName(DictGroupNameHT &groupName); @@ -40,7 +41,7 @@ DictGroupName::DictGroupName() { std::string filename = DictSet::BuildDictPath() + DICT_GROUP_NAME; std::ifstream from(filename.c_str()); - if(!from) + if ( !from ) { gdcmWarningMacro("Can't open dictionary" << filename.c_str()); FillDefaultDictGroupName(groupName); @@ -49,7 +50,7 @@ DictGroupName::DictGroupName() { char buff[1024]; uint16_t key; - GroupName value; + TagName value; while (!from.eof()) { @@ -60,7 +61,7 @@ DictGroupName::DictGroupName() from.getline(buff, 1024, '"'); from.getline(buff, 1024, '"'); value = buff; - if(!from.eof()) + if ( !from.eof() ) groupName[key] = value; from.getline(buff, 1024, '\n'); @@ -79,10 +80,11 @@ DictGroupName::~DictGroupName() //----------------------------------------------------------------------------- // Public -const GroupName &DictGroupName::GetName(uint16_t group) +/// \returns the formerly NIH defined ACR-NEMA group name +const TagName &DictGroupName::GetName(uint16_t group) { DictGroupNameHT::const_iterator it = groupName.find(group); - if (it == groupName.end()) + if ( it == groupName.end() ) { return GDCM_UNFOUND; } @@ -101,14 +103,14 @@ const GroupName &DictGroupName::GetName(uint16_t group) * \brief Print all * @param os The output stream to be written to. */ -void DictGroupName::Print(std::ostream &os) +void DictGroupName::Print(std::ostream &os,std::string const &) { std::ostringstream s; for (DictGroupNameHT::iterator it = groupName.begin(); it != groupName.end(); ++it) { - s << "DictGroupName : " << std::hex << it->first << std::dec - << " = " << it->second << std::endl; + s << "DictGroupName : 0x" << std::hex << std::setw(4) << it->first + << std::dec << " = " << it->second << std::endl; } os << s.str(); }