7 gdcmDict::gdcmDict(const char* FileName) {
8 std::ifstream from(FileName);
9 dbg.Error(!from, "gdcmDict::gdcmDict: can't open dictionary", FileName);
10 guint16 group, element;
11 // CLEANME : use defines for all those constants
13 TagKey key, vr, fourth, name;
15 from >> hex >> group >> element;
17 from.getline(buff, 256, ' ');
20 from.getline(buff, 256, ' ');
22 from.getline(buff, 256, '\n');
24 gdcmDictEntry * newEntry = new gdcmDictEntry(group, element,
26 entries[gdcmDictEntry::TranslateToKey(group, element)] = newEntry;
31 void gdcmDict::Print(ostream& os) {
32 for (TagHT::iterator tag = entries.begin(); tag != entries.end(); ++tag){
34 os << "(" << hex << tag->second->GetGroup() << ',';
35 os << hex << tag->second->GetElement() << ") = " << dec;
36 os << tag->second->GetVR() << ", ";
37 os << tag->second->GetFourth() << ", ";
38 os << tag->second->GetName() << "." << endl;
42 // renvoie une ligne de Dictionnaire Dicom à partir de (numGroup, numElement)
44 gdcmDictEntry * gdcmDict::GetTag(guint32 group, guint32 element) {
45 TagKey key = gdcmDictEntry::TranslateToKey(group, element);
46 if ( ! entries.count(key))
47 return (gdcmDictEntry*)0;
48 if (entries.count(key) > 1)
49 dbg.Verbose(0, "gdcmDict::GetTag",
50 "multiple entries for this key (FIXME) !");
51 return entries.find(key)->second;