X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=src%2FgdcmDict.cxx;h=32cc12467410975dd91ebb1ae9c0f8dd8fa22977;hb=e06d61ba347d7f5f692a682434e089d939f85653;hp=271a2346640b96f1ed8233d6a9d30fd3423f334f;hpb=51b61705e90b352de08519835fa1c63b81bca616;p=gdcm.git diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 271a2346..32cc1246 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -1,11 +1,12 @@ +// gdcmDict.cxx + #include #include "gdcm.h" #include "gdcmUtil.h" -gdcmDict::gdcmDict(char * FileName) { +gdcmDict::gdcmDict(const char* FileName) { std::ifstream from(FileName); - dbg.Error(!from, "gdcmDictSet::gdcmDictSet:", - "can't open dictionary"); + dbg.Error(!from, "gdcmDict::gdcmDict: can't open dictionary", FileName); guint16 group, element; // CLEANME : use defines for all those constants char buff[1024]; @@ -38,8 +39,14 @@ void gdcmDict::Print(ostream& os) { } } +// renvoie une ligne de Dictionnaire Dicom à partir de (numGroup, numElement) + gdcmDictEntry * gdcmDict::GetTag(guint32 group, guint32 element) { TagKey key = gdcmDictEntry::TranslateToKey(group, element); - TagHT::iterator found = entries.find(key); - return found->second; + if ( ! entries.count(key)) + return (gdcmDictEntry*)0; + if (entries.count(key) > 1) + dbg.Verbose(0, "gdcmDict::GetTag", + "multiple entries for this key (FIXME) !"); + return entries.find(key)->second; }