]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDir.cxx
* Test/TestUtil.cxx : reformat the source code
[gdcm.git] / src / gdcmDicomDir.cxx
index 58e58b631a8692475feabaffbb23a362f5059a6d..7ab7f7d6d3c3b7c0f6add43c6d8de4c5044b6f46 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 20:16:57 $
-  Version:   $Revision: 1.85 $
+  Date:      $Date: 2004/12/07 13:39:33 $
+  Version:   $Revision: 1.88 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -455,11 +455,11 @@ std::cerr<<"File : "<<it->c_str()<<std::endl;
    SetElements(tmp, list);
    CallEndMethod();
 
-   for(VectDocument::iterator it=list.begin();
-       it!=list.end();
-       ++it)
+   for(VectDocument::iterator itDoc=list.begin();
+       itDoc!=list.end();
+       ++itDoc)
    {
-      delete dynamic_cast<Header *>(*it);
+      delete dynamic_cast<Header *>(*itDoc);
    }
 }
 
@@ -482,7 +482,7 @@ DicomDirMeta * DicomDir::NewMeta()
                                     cc != lastOneButSequence;
                                    ++cc)
       {
-         m->AddDocEntry( cc->second );
+         m->AddEntry( cc->second );
       }
    }
    else  // after root directory parsing
@@ -519,29 +519,7 @@ DicomDirPatient * DicomDir::NewPatient()
       entry->SetOffset(0); // just to avoid further missprinting
       entry->SetValue( it->Value );
 
-      // dealing with value length ...
-      
-      if( dictEntry->GetGroup() == 0xfffe)
-      {
-         entry->SetLength(entry->GetValue().length());
-      }
-      else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" )
-      {
-         entry->SetLength( 4 );
-      } 
-      else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" )
-      {
-         entry->SetLength(2); 
-      } 
-      else if( dictEntry->GetVR() == "SQ" )
-      {
-         entry->SetLength( 0xffffffff );
-      }
-      else
-      {
-         entry->SetLength( entry->GetValue().length() );
-      }
-      p->AddDocEntry( entry );
+      p->AddEntry( entry );
    }
 
    Patients.push_front( p );
@@ -639,7 +617,6 @@ void DicomDir::SetElement(std::string const & path, DicomDirType type,
       entry     = new ValEntry( dictEntry ); // Be sure it's never a BinEntry !
 
       entry->SetOffset(0); // just to avoid further missprinting
-      entry->SetLength(0); // just to avoid further missprinting
 
       if( header )
       {
@@ -683,34 +660,8 @@ void DicomDir::SetElement(std::string const & path, DicomDirType type,
             val = it->Value;
       }
 
-     // GDCM_UNFOUND or not !
-
       entry->SetValue( val ); // troubles expected when vr=SQ ...
 
-      if( dictEntry )
-      {
-         if( dictEntry->GetGroup() == 0xfffe )
-         {
-            entry->SetLength( entry->GetValue().length() ); // FIXME 
-         }
-         else if( dictEntry->GetVR() == "UL" || dictEntry->GetVR() == "SL" )
-         {
-            entry->SetLength(4);
-         }
-         else if( dictEntry->GetVR() == "US" || dictEntry->GetVR() == "SS" )
-         {
-            entry->SetLength(2); 
-         }
-         else if( dictEntry->GetVR() == "SQ" )
-         {
-            entry->SetLength( 0xffffffff );
-         }
-         else
-         {
-            entry->SetLength( entry->GetValue().length() );
-         }
-      }
-
       if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !
       {
          std::cout << "GDCM_DICOMDIR_META ?!? should never print that"