4 TagElValueHT & ElValSet::GetTagHt(void) {
8 void ElValSet::Add(ElValue * newElValue) {
9 tagHt[newElValue->GetKey()] = newElValue;
10 NameHt[newElValue->GetName()] = newElValue;
13 void ElValSet::Print(ostream & os) {
14 for (TagElValueHT::iterator tag = tagHt.begin();
17 os << tag->first << ": ";
18 os << "[" << tag->second->GetValue() << "]";
19 os << "[" << tag->second->GetName() << "]";
20 os << "[" << tag->second->GetVR() << "]" << endl;
24 void ElValSet::PrintByName(ostream & os) {
25 for (TagElValueNameHT::iterator tag = NameHt.begin();
28 os << tag->first << ": ";
29 os << "[" << tag->second->GetValue() << "]";
30 os << "[" << tag->second->GetKey() << "]";
31 os << "[" << tag->second->GetVR() << "]" << endl;
35 ElValue* ElValSet::GetElementByNumber(guint32 group, guint32 element) {
36 TagKey key = gdcmDictEntry::TranslateToKey(group, element);
37 if ( ! tagHt.count(key))
39 if (tagHt.count(key) > 1)
40 dbg.Verbose(0, "ElValSet::GetElementByNumber",
41 "multiple entries for this key (FIXME) !");
42 return tagHt.find(key)->second;
45 ElValue* ElValSet::GetElementByName(string TagName) {
46 if ( ! NameHt.count(TagName))
48 if (NameHt.count(TagName) > 1)
49 dbg.Verbose(0, "ElValSet::GetElement",
50 "multipe entries for this key (FIXME) !");
51 return NameHt.find(TagName)->second;
54 string ElValSet::GetElValueByNumber(guint32 group, guint32 element) {
55 TagKey key = gdcmDictEntry::TranslateToKey(group, element);
56 if ( ! tagHt.count(key))
57 return "gdcm::Unfound";
58 if (tagHt.count(key) > 1)
59 dbg.Verbose(0, "ElValSet::GetElValueByNumber",
60 "multiple entries for this key (FIXME) !");
61 return tagHt.find(key)->second->GetValue();
64 string ElValSet::GetElValueByName(string TagName) {
65 if ( ! NameHt.count(TagName))
66 return "gdcm::Unfound";
67 if (NameHt.count(TagName) > 1)
68 dbg.Verbose(0, "ElValSet::GetElValue",
69 "multipe entries for this key (FIXME) !");
70 return NameHt.find(TagName)->second->GetValue();