+/**
+ * \ingroup gdcmHeader
+ * \brief Build a new Element Value from all the low level arguments.
+ * Check for existence of dictionary entry, and build
+ * a default one when absent.
+ * @param Group group of the underlying DictEntry
+ * @param Elem element of the underlying DictEntry
+ */
+ElValue* gdcmHeader::NewElValueByKey(guint16 Group, guint16 Elem) {
+ // Find out if the tag we encountered is in the dictionaries:
+ gdcmDictEntry * NewTag = GetDictEntryByKey(Group, Elem);
+ if (!NewTag)
+ NewTag = new gdcmDictEntry(Group, Elem);
+
+ ElValue* NewElVal = new ElValue(NewTag);
+ if (!NewElVal) {
+ dbg.Verbose(1, "gdcmHeader::NewElValueByKey",
+ "failed to allocate ElValue");
+ return (ElValue*)0;
+ }
+ return NewElVal;
+}
+
+/**
+ * \ingroup gdcmHeader
+ * \brief Build a new Element Value from all the low level arguments.
+ * Check for existence of dictionary entry, and build
+ * a default one when absent.
+ * @param Name Name of the underlying DictEntry
+ */
+ElValue* gdcmHeader::NewElValueByName(string Name) {
+
+ gdcmDictEntry * NewTag = GetDictEntryByName(Name);
+ if (!NewTag)
+ NewTag = new gdcmDictEntry(0xffff, 0xffff, "LO", "Unknown", Name);
+
+ ElValue* NewElVal = new ElValue(NewTag);
+ if (!NewElVal) {
+ dbg.Verbose(1, "gdcmHeader::ObtainElValueByName",
+ "failed to allocate ElValue");
+ return (ElValue*)0;
+ }
+ return NewElVal;
+}
+
+