+
+ std::cout << "------------ using listElem -----------------" << std::endl;
+
+ //for (ListTag::iterator i = listElem.begin();
+
+ char greltag[9]; //group element tag
+
+ for (std::list<gdcmElValue*>::iterator i = listElem.begin();
+ i != listElem.end();
+ ++i){
+ sprintf(greltag,"%04x|%04x",(*i)->GetGroup(),(*i)->GetElement());
+ g = (*i)->GetGroup();
+ e = (*i)->GetElement();
+ v = (*i)->GetValue();
+ o = (*i)->GetOffset();
+ d2 = _CreateCleanString(v); // replace non printable characters by '.'
+ //os << std::hex <<g << "|" << e << std::dec << ": ";
+ os << greltag << " : ";
+ os << " lgr : " << (*i)->GetReadLength();
+ os << ", Offset : " << o;
+ os << " x(" << std::hex << o << std::dec << ") ";
+ os << "\t[" << (*i)->GetVR() << "]";
+ os << "\t[" << (*i)->GetName() << "]";
+ os << "\t[" << d2 << "]";
+
+ // Display the UID value (instead of displaying the rough code)
+ if (g == 0x0002) { // Any 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) << "]";
+ }
+ }
+ os << std::endl;
+ }