+void ElValSet::Print(ostream & os) {
+ 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() << "]" << endl;
+ }
+}
+
+void ElValSet::PrintByName(ostream & os) {
+ for (TagElValueNameHT::iterator tag = NameHt.begin();
+ tag != NameHt.end();
+ ++tag){
+ os << tag->first << ": ";
+ os << "[" << tag->second->GetValue() << "]";
+ os << "[" << tag->second->GetKey() << "]";
+ os << "[" << tag->second->GetVR() << "]" << endl;
+ }
+}
+
+ElValue* ElValSet::GetElementByNumber(guint32 group, guint32 element) {
+ TagKey key = gdcmDictEntry::TranslateToKey(group, element);
+ if ( ! tagHt.count(key))
+ return (ElValue*)0;
+ if (tagHt.count(key) > 1)
+ dbg.Verbose(0, "ElValSet::GetElementByNumber",
+ "multiple entries for this key (FIXME) !");
+ return tagHt.find(key)->second;
+}
+
+ElValue* ElValSet::GetElementByName(string TagName) {
+ if ( ! NameHt.count(TagName))
+ return (ElValue*)0;
+ if (NameHt.count(TagName) > 1)
+ dbg.Verbose(0, "ElValSet::GetElement",
+ "multipe entries for this key (FIXME) !");
+ return NameHt.find(TagName)->second;
+}
+
+string ElValSet::GetElValueByNumber(guint32 group, guint32 element) {
+ TagKey key = gdcmDictEntry::TranslateToKey(group, element);
+ if ( ! tagHt.count(key))
+ return "gdcm::Unfound";
+ if (tagHt.count(key) > 1)
+ dbg.Verbose(0, "ElValSet::GetElValueByNumber",
+ "multiple entries for this key (FIXME) !");
+ return tagHt.find(key)->second->GetValue();
+}
+
+string ElValSet::GetElValueByName(string TagName) {
+ if ( ! NameHt.count(TagName))
+ return "gdcm::Unfound";
+ if (NameHt.count(TagName) > 1)
+ dbg.Verbose(0, "ElValSet::GetElValue",
+ "multipe entries for this key (FIXME) !");
+ return NameHt.find(TagName)->second->GetValue();
+}
+
+int ElValSet::SetElValueByNumber(string content, guint32 group, guint32 element) {
+ TagKey key = gdcmDictEntry::TranslateToKey(group, element);
+ if ( ! tagHt.count(key))
+ return 0;
+ if (tagHt.count(key) > 1) {
+ dbg.Verbose(0, "ElValSet::SetElValueByNumber",
+ "multiple entries for this key (FIXME) !");
+ return (0);
+ }
+ tagHt[key]->SetValue(content);
+
+ // Question : m à j LgrElem ?
+ tagHt[key]->SetLength(strlen(content.c_str()));
+
+ // FIXME should we really update the element length ?
+ tagHt[key]->SetLength(content.length());
+
+ return(1);
+}
+
+int ElValSet::SetElValueByName(string content, string TagName) {
+ if ( ! NameHt.count(TagName))
+ return 0;
+ if (NameHt.count(TagName) > 1) {
+ dbg.Verbose(0, "ElValSet::SetElValueByName",
+ "multipe entries for this key (FIXME) !");
+ return 0;
+ }
+ NameHt.find(TagName)->second->SetValue(content);
+ NameHt.find(TagName)->second->SetLength(strlen(content.c_str()));
+ return(1);
+}
+
+
+int ElValSet::SetElValueLengthByNumber(guint32 l, guint32 group, guint32 element) {
+ TagKey key = gdcmDictEntry::TranslateToKey(group, element);
+ if ( ! tagHt.count(key))
+ return 0;
+ if (tagHt.count(key) > 1) {
+ dbg.Verbose(0, "ElValSet::SetElValueLengthByNumber",
+ "multiple entries for this key (FIXME) !");
+ return (0);
+ }
+ // m à j LgrElem
+ tagHt[key]->SetLength(l);
+ return(1);
+}
+
+
+int ElValSet::SetElValueLengthByName(guint32 l, string TagName) {
+ if ( ! NameHt.count(TagName))
+ return 0;
+ if (NameHt.count(TagName) > 1) {
+ dbg.Verbose(0, "ElValSet::SetElValueByName",
+ "multipe entries for this key (FIXME) !");
+ return 0;
+ }
+ NameHt.find(TagName)->second->SetLength(l);
+ return(1);
+}
+
+
+int ElValSet::Write(FILE * _fp) {
+
+// ATTENTION : fonction non terminée (commitée a titre de precaution)
+
+ guint16 gr, el;
+ guint32 lgr;
+ const char * val;
+ string vr;
+ guint32 val_int32;
+ guint16 val_int16;
+ void *ptr;
+ char str_lgrCalcGroupe[10];
+
+ string implicitVRTransfertSyntax = "1.2.840.10008.1.2";
+
+ // Utilisées pour le calcul Group Length
+ int deja = 0;
+ guint32 lgrCalcGroupe=0;
+ ElValue *elem, *elemZ, *elemZPrec;
+ guint16 grCourant = 0;
+
+ // Question :
+ // Comment pourrait-on tester si on est TrueDicom ou non ,
+ // (FileType est un champ de gdcmHeader ...)
+ //
+
+ // On parcourt la table pour recalculer la longueur des 'elements 0x0000'
+ // au cas ou un tag ai été ajouté par rapport à ce qui a été lu
+ // dans l'image native
+ //
+ // cf : code IdDcmWriteFile dans libido/src/dcmwrite.c
+