+std::string gdcmHeader::GetPubEntryVRByName(std::string tagName) {
+ gdcmDictEntry *dictEntry = RefPubDict->GetTagByName(tagName);
+ if( dictEntry == NULL)
+ return GDCM_UNFOUND;
+
+ gdcmHeaderEntry* elem = GetHeaderEntryByNumber(dictEntry->GetGroup(),
+ dictEntry->GetElement());
+ return elem->GetVR();
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Searches within the public dictionary for element value of
+ * a given tag.
+ * @param group Group of the researched tag.
+ * @param element Element of the researched tag.
+ * @return Corresponding element value when it exists, and the string
+ * GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string gdcmHeader::GetPubEntryByNumber(guint16 group, guint16 element) {
+ return PubEntrySet.GetEntryByNumber(group, element);
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Searches within the public dictionary for element value
+ * representation of a given tag.
+ *
+ * Obtaining the VR (Value Representation) might be needed by caller
+ * to convert the string typed content to caller's native type
+ * (think of C++ vs Python). The VR is actually of a higher level
+ * of semantics than just the native C++ type.
+ * @param group Group of the researched tag.
+ * @param element Element of the researched tag.
+ * @return Corresponding element value representation when it exists,
+ * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string gdcmHeader::GetPubEntryVRByNumber(guint16 group, guint16 element) {
+ gdcmHeaderEntry* elem = GetHeaderEntryByNumber(group, element);
+ if ( !elem )
+ return GDCM_UNFOUND;
+ return elem->GetVR();
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Accesses an existing gdcmHeaderEntry (i.e. a Dicom Element)
+ * in the PubHeaderEntrySet of this instance
+ * through tag name and modifies it's content with the given value.
+ * @param content new value to substitute with
+ * @param tagName name of the Header Entry (Dicom Element) to be modified
+ */
+bool gdcmHeader::SetPubEntryByName(std::string content, std::string tagName) {
+ //return ( PubHeaderEntrySet.SetHeaderEntryByName (content, tagName) );
+ gdcmDictEntry *dictEntry = RefPubDict->GetTagByName(tagName);
+ if( dictEntry == NULL)
+ return false;
+ return(PubEntrySet.SetEntryByNumber(content,
+ dictEntry->GetGroup(),
+ dictEntry->GetElement()));
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Accesses an existing gdcmHeaderEntry (i.e. a Dicom Element)
+ * in the PubHeaderEntrySet of this instance
+ * through it's (group, element) and modifies it's content with
+ * the given value.
+ * @param content new value to substitute with
+ * @param group group of the Dicom Element to modify
+ * @param element element of the Dicom Element to modify
+ */
+bool gdcmHeader::SetPubEntryByNumber(std::string content, guint16 group,
+ guint16 element)
+
+//TODO : homogeneiser les noms : SetPubElValByNumber
+// qui appelle PubHeaderEntrySet.SetHeaderEntryByNumber
+// pourquoi pas SetPubHeaderEntryByNumber ??
+{
+ return ( PubEntrySet.SetEntryByNumber (content, group, element) );
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Accesses an existing gdcmHeaderEntry (i.e. a Dicom Element)
+ * in the PubHeaderEntrySet of this instance
+ * through it's (group, element) and modifies it's length with
+ * the given value.
+ * \warning Use with extreme caution.
+ * @param length new length to substitute with
+ * @param group group of the ElVal to modify
+ * @param element element of the ElVal to modify
+ * @return 1 on success, 0 otherwise.
+ */
+
+bool gdcmHeader::SetPubEntryLengthByNumber(guint32 length, guint16 group,
+ guint16 element) {
+ return ( PubEntrySet.SetEntryLengthByNumber (length, group, element) );
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Searches within Header Entries (Dicom Elements) parsed with
+ * the public and private dictionaries
+ * for the element value of a given tag.
+ * @param tagName name of the searched element.
+ * @return Corresponding element value when it exists,
+ * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string gdcmHeader::GetEntryByName(std::string tagName) {
+ return GetPubEntryByName(tagName);
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Searches within Header Entries (Dicom Elements) parsed with
+ * the public and private dictionaries
+ * for the element value representation of a given tag.
+ *
+ * Obtaining the VR (Value Representation) might be needed by caller
+ * to convert the string typed content to caller's native type
+ * (think of C++ vs Python). The VR is actually of a higher level
+ * of semantics than just the native C++ type.
+ * @param tagName name of the searched element.
+ * @return Corresponding element value representation when it exists,
+ * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string gdcmHeader::GetEntryVRByName(std::string tagName) {
+ return GetPubEntryVRByName(tagName);
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Searches within Header Entries (Dicom Elements) parsed with
+ * the public and private dictionaries
+ * for the element value representation of a given tag.
+ * @param group Group of the searched tag.
+ * @param element Element of the searched tag.
+ * @return Corresponding element value representation when it exists,
+ * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string gdcmHeader::GetEntryByNumber(guint16 group, guint16 element) {
+ return GetPubEntryByNumber(group, element);
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Searches within Header Entries (Dicom Elements) parsed with
+ * the public and private dictionaries
+ * for the element value representation of a given tag..
+ *
+ * Obtaining the VR (Value Representation) might be needed by caller
+ * to convert the string typed content to caller's native type
+ * (think of C++ vs Python). The VR is actually of a higher level
+ * of semantics than just the native C++ type.
+ * @param group Group of the searched tag.
+ * @param element Element of the searched tag.
+ * @return Corresponding element value representation when it exists,
+ * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
+ */
+std::string gdcmHeader::GetEntryVRByNumber(guint16 group, guint16 element) {
+ return GetPubEntryVRByNumber(group, element);
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Sets the value (string) of the Header Entry (Dicom Element)
+ * @param content string value of the Dicom Element
+ * @param tagName name of the searched Dicom Element.
+ * @return true when found
+ */
+bool gdcmHeader::SetEntryByName(std::string content,std::string tagName) {
+ gdcmDictEntry *dictEntry = RefPubDict->GetTagByName(tagName);
+ if( dictEntry == NULL)
+ return false;
+
+
+ TagKey key = gdcmDictEntry::TranslateToKey(dictEntry->GetGroup(),
+ dictEntry->GetElement());
+ if ( PubEntrySet.GetTagHT().count(key) == 0 )
+ return false;
+ int l = content.length();
+ if(l%2) { // Odd length are padded with a space (020H).
+ l++;
+ content = content + '\0';