// combined with all software versions...
typedef map<TagKey, gdcmDictEntry*> TagHT;
- // Table de Hachage (group,Elem) --> ligne du Dictionnaire Dicom
+ // Table de Hachage (group,Elem) --> pointeur vers une ligne du Dictionnaire Dicom
typedef map<TagKey, gdcmDictEntry*> TagHT;
bool IsImplicitVr(void) { return ImplicitVr; };
void SetVR(string);
string GetVR(void);
- string GetValue(void) { return value; };
- guint32 GetLength(void) { return LgrElem; };
- size_t GetOffset(void) { return Offset; };
- guint16 GetGroup(void) { return entry->GetGroup(); };
+ string GetValue(void) { return value; };
+ guint32 GetLength(void) { return LgrElem; };
+ size_t GetOffset(void) { return Offset; };
+ guint16 GetGroup(void) { return entry->GetGroup(); };
guint16 GetElement(void) { return entry->GetElement(); };
- string GetKey(void) { return entry->GetKey(); };
- string GetName(void) { return entry->GetName();};
+ string GetKey(void) { return entry->GetKey(); };
+ string GetName(void) { return entry->GetName(); };
};
class GDCM_EXPORT ElValSet {
// We need both accesses with a TagKey and the Dictentry.Name
+
TagElValueHT tagHt;
TagElValueNameHT NameHt;
-public:
- void Add(ElValue*);
+public:
+ void Add(ElValue*);
void Print(ostream &);
void PrintByName(ostream &);
ElValue* GetElementByNumber(guint32 group, guint32 element);
string GetElValueByNumber(guint32 group, guint32 element);
string GetElValueByName (string);
TagElValueHT & GetTagHt(void);
+
+ int SetElValueByNumber(string content, guint32 group, guint32 element);
+ int SetElValueByName(string content, string TagName);
};
// Qu'y a-t-il a corriger ?
//
// outside of the elements:
+
guint16 grPixel;
guint16 numPixel;
// Ne faudrait-il pas une indication sur la presence ou non
string GetElValRepByName(string TagName);
string GetElValRepByNumber(guint16 group, guint16 element);
- // TODO Swig int SetPubElValByName(string content, string TagName);
- // TODO Swig int SetPubElValByNumber(string content, guint16 group, guint16 element);
+ int SetPubElValByName(string content, string TagName);
+ int SetPubElValByNumber(string content, guint16 group, guint16 element);
// TODO Swig int SetShaElValByName(string content, string ShadowTagName);
// TODO Swig int SetShaElValByNumber(string content, guint16 group, guint16 element);
- // TODO Swig int GetSwapCode();
};
//
// Data pointe sur quoi?
// sur les Pixels lus?
// --> j'ajoute un champ public : Pixels
+ // (il faudra que l'utilisateur puisse modifier les pixels ?)
void* Data;
int Parsed; // weather allready parsed
return tagHt.find(key)->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);
+ return(1);
+}
+
string ElValSet::GetElValueByName(string TagName) {
if ( ! NameHt.count(TagName))
return "gdcm::Unfound";
return NameHt.find(TagName)->second->GetValue();
}
+int ElValSet::SetElValueByName(string content, string TagName) {
+ if ( ! NameHt.count(TagName))
+ return 0;
+ if (NameHt.count(TagName) > 1) {
+ dbg.Verbose(0, "ElValSet::SetElValue",
+ "multipe entries for this key (FIXME) !");
+ return 0;
+ }
+ NameHt.find(TagName)->second->SetValue(content);
+}
+
+
return GetShaElValRepByName(TagName);
}
+/**
+ * \ingroup gdcmHeader
+ * \brief Modifie la valeur d'un ElValue déja existant
+ * \ dans le PubElVals du gdcmHeader,
+ * \ accédé par ses numero de groupe et d'element.
+ */
+int gdcmHeader::SetPubElValByNumber(string content, guint16 group, guint16 element) {
+ //TagKey key = gdcmDictEntry::TranslateToKey(group, element);
+ //PubElVals.tagHt[key]->SetValue(content);
+
+ return ( PubElVals.SetElValueByNumber (content, group, element) );
+}
+
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Modifie la valeur d'un ElValue déja existant
+ * \ dans le PubElVals du gdcmHeader,
+ * \ accédé par son nom
+ */
+int gdcmHeader::SetPubElValByName(string content, string TagName) {
+ //TagKey key = gdcmDictEntry::TranslateToKey(group, element);
+ //PubElVals.tagHt[key]->SetValue(content);
+
+ return ( PubElVals.SetElValueByName (content, TagName) );
+}
+
/**
* \ingroup gdcmHeader
* \brief Parses the header of the file but does NOT load element values.