- for (TagElValueHT::iterator tag = tagHt.begin();
- tag != tagHt.end();
- ++tag){
- os << tag->first << ": ";
- os << "[" << tag->second->GetValue() << "]";
- os << "[" << tag->second->GetName() << "]";
- os << "[" << tag->second->GetVR() << "]";
- os << " lgr : " << tag->second->GetLength();
- os << endl;
- }
+
+ size_t o;
+ short int g, e;
+ TSKey v;
+ char * d;
+ string d2;
+ gdcmTS * ts = gdcmGlobal::GetTS();
+
+ for (TagElValueHT::iterator tag = tagHt.begin();
+ tag != tagHt.end();
+ ++tag){
+ g = tag->second->GetGroup();
+ e = tag->second->GetElement();
+ v = tag->second->GetValue();
+ o = tag->second->GetOffset();
+ //d = _CreateCleanString(v); // replace non printable characters by '.'
+ d2=v;
+
+ os << tag->first << ": ";
+ os << " lgr : " << tag->second->GetLength();
+ os << ", Offset : " << o;
+ os << " x(" << hex << o << dec << ") ";
+ os << "\t[" << tag->second->GetVR() << "]";
+ os << "\t[" << tag->second->GetName() << "]";
+ os << "\t[" << d2 << "]";
+
+ // Display the UID value (instead of displaying the rough code)
+ if (g == 0x0002) { // Some more to be displayed ?
+ if ( (e == 0x0010) || (e == 0x0002) )
+ os << " ==>\t[" << ts->GetValue(v) << "]";
+ } else {
+ if (g == 0x0008) {
+ if ( (e == 0x0016) || (e == 0x1150) )
+ os << " ==>\t[" << ts->GetValue(v) << "]";
+ }
+ }
+ //free(d);
+ os << endl;
+ }