+ HandleBrokenEndian(group, elem);
+ std::string vr = FindDocEntryVR();
+ std::string realVR = vr;
+
+ if( vr == GDCM_UNKNOWN)
+ {
+ DictEntry *dictEntry = GetDictEntryByNumber(group,elem);
+ if( dictEntry )
+ realVR = dictEntry->GetVR();
+ }
+
+ DocEntry *newEntry;
+ if( Global::GetVR()->IsVROfSequence(realVR) )
+ newEntry = NewSeqEntryByNumber(group, elem);
+ else if( Global::GetVR()->IsVROfStringRepresentable(realVR) )
+ newEntry = NewValEntryByNumber(group, elem,vr);
+ else
+ newEntry = NewBinEntryByNumber(group, elem,vr);
+
+ if( vr == GDCM_UNKNOWN )
+ {
+ if( Filetype == ExplicitVR )
+ {
+ // We thought this was explicit VR, but we end up with an
+ // implicit VR tag. Let's backtrack.
+ std::string msg;
+ msg = Util::Format("Falsely explicit vr file (%04x,%04x)\n",
+ newEntry->GetGroup(), newEntry->GetElement());
+ dbg.Verbose(1, "Document::FindVR: ", msg.c_str());
+ }
+ newEntry->SetImplicitVR();
+ }