5 gdcmDict::gdcmDict(const char* FileName) {
6 std::ifstream from(FileName);
7 dbg.Error(!from, "gdcmDict::gdcmDict: can't open dictionary", FileName);
8 guint16 group, element;
9 // CLEANME : use defines for all those constants
11 TagKey key, vr, fourth, name;
13 from >> hex >> group >> element;
15 from.getline(buff, 256, ' ');
18 from.getline(buff, 256, ' ');
20 from.getline(buff, 256, '\n');
22 gdcmDictEntry * newEntry = new gdcmDictEntry(group, element,
24 entries[gdcmDictEntry::TranslateToKey(group, element)] = newEntry;
29 void gdcmDict::Print(ostream& os) {
30 for (TagHT::iterator tag = entries.begin(); tag != entries.end(); ++tag){
32 os << "(" << hex << tag->second->GetGroup() << ',';
33 os << hex << tag->second->GetElement() << ") = " << dec;
34 os << tag->second->GetVR() << ", ";
35 os << tag->second->GetFourth() << ", ";
36 os << tag->second->GetName() << "." << endl;
40 gdcmDictEntry * gdcmDict::GetTag(guint32 group, guint32 element) {
41 TagKey key = gdcmDictEntry::TranslateToKey(group, element);
42 if ( ! entries.count(key))
43 return (gdcmDictEntry*)0;
44 if (entries.count(key) > 1)
45 dbg.Verbose(0, "gdcmDict::GetTag",
46 "multiple entries for this key (FIXME) !");
47 return entries.find(key)->second;