- // FIX ME
- // ATTENTION : nbCode correspond au nombre d'elements dans la table
- // de type DICOM_VR. A nettoyer.
- //
- int nbCode=26;
-
- if (filetype == ExplicitVR) {
- lgrLue=fread (&VR, (size_t)2,(size_t)1, fp);
- VR[2]=0;
-
- // Warning: we believe this is explicit VR (Value Representation) because
- // we used a heuristic that found "UL" in the first tag. Alas this
- // doesn't guarantee that all the tags will be in explicit VR. In some
- // cases (see e-film filtered files) one finds implicit VR tags mixed
- // within an explicit VR file. Hence we make sure the present tag
- // is in explicit VR and try to fix things if it happens not to be
- // the case.
-
- // FIXME There should be only one occurence returned. Avoid the
- // first extraction by calling proper method.
- VRAtr FoundVR = dicom_vr->find(string(VR))->first;
- if (FoundVR.empty()) {
- pleCourant->SetVR(FoundVR);
- } else {
-
- // On est mal : implicit VR repere
- // mais ce n'est pas un code connu ...
- // On reconstitue la longueur
-
- dbg.Verbose(1, "gdcmHeader::RecupLgr:",
- "Explicit VR, but no known code");
- memcpy(&l_gr, VR,(size_t)2);
- lgrLue=fread ( ((char*)&l_gr)+2, (size_t)2, (size_t)1, fp);
- l_gr = SwapLong((guint32)l_gr);
- pleCourant->SetLgrLue(l_gr);
- if ( (int)l_gr == -1)
- l_gr=0;
-
- *skippedLength = 4;
- return(l_gr);
- }