+ return newEntry; // It will be added where it has to be!
+}
+
+
+/**
+ * \brief When a private OB + Implicit VR
+ * (or UN + undefined length element) is encountered
+ * we made first a bad assumption -it should be a Sequence-
+ * When we realize we were wrong, we backtrack.
+ * WARNING : it will probabely fail if the element
+ * is embedded within a sequence
+ * @param docEntry Item Starter that warned us
+ * @param set DocEntrySet (ElementSet/SQItem) the DocEntry will belong
+ */
+
+DataEntry *Document::BacktrackSQtoOB(SeqEntry *docEntry, DocEntrySet *set)
+{
+ // Get all info we can from SeqEntry
+
+ uint16_t group = docEntry->GetGroup();
+ uint16_t elem = docEntry->GetElement();
+ uint32_t lgt = docEntry->GetLength();
+ long offset = docEntry->GetOffset();
+
+ gdcmDebugMacro( "BacktrackSQtoOB(" << std::hex << group
+ << "|" << elem
+ << " at offset 0x(" <<offset << ")" );
+
+ //set->RemoveEntry( docEntry );
+ docEntry->Delete(); // not yet included into a DocEntrySet !
+
+ // forge the OB Entry
+ DataEntry *newEntry = NewDataEntry(group, elem, "OB");
+ newEntry->SetOffset(offset);
+
+ // Move back to the beginning of the Element
+ Fp->seekg(offset, std::ios::beg);
+
+ uint32_t lengthOB = FindDocEntryLengthOBOrOW();// for encapsulation of encoded pixel
+
+ newEntry->SetReadLength(lengthOB);
+ newEntry->SetLength(lengthOB);
+
+ Fp->seekg(offset, std::ios::beg);
+ LoadDocEntry(newEntry, true); // true : forceload
+
+ /// \todo fixme : it will fail if the element
+ /// is embedded within a sequence (sequence length checking is not done)
+
+ return newEntry; // It will be added (ElementSet/SQItem) where it has to be!