]> Creatis software - gdcm.git/commitdiff
* src/gdcmDicomDir*.[h|cxx] : rename methods to be logik in their name.
authorregrain <regrain>
Thu, 20 Jan 2005 11:09:21 +0000 (11:09 +0000)
committerregrain <regrain>
Thu, 20 Jan 2005 11:09:21 +0000 (11:09 +0000)
     Remove all access to the hash-tables or lists in the objects.
   -- BeNours

14 files changed:
ChangeLog
Example/PrintDicomDir.cxx
Testing/TestDicomDir.cxx
src/gdcmDicomDir.cxx
src/gdcmDicomDir.h
src/gdcmDicomDirElement.cxx
src/gdcmDicomDirObject.cxx
src/gdcmDicomDirObject.h
src/gdcmDicomDirPatient.cxx
src/gdcmDicomDirPatient.h
src/gdcmDicomDirSerie.cxx
src/gdcmDicomDirSerie.h
src/gdcmDicomDirStudy.cxx
src/gdcmDicomDirStudy.h

index a0ac327ecb4ffd32510e8fbe463de0ed492493be..a05be787d2a9df1165d75032f1d2ca33332f18c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-20 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+   * src/gdcmDicomDir*.[h|cxx] : rename methods to be logik in their name.
+     Remove all access to the hash-tables or lists in the objects.
+
 2005-01-20 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
    * src/gdcmDebug.h : remove the Debug test in the gdcmErrorMacro
    * src/gdcmDocument.[h|cxx] : rename the Initialise method to Initialize, to
index 5e589900e755b4e46a25e1e34cc2c555cb85ac34..cc8c9a7f869f594729b7db1d44b681a7edca2fbc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: PrintDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:55:16 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2005/01/20 11:09:21 $
+  Version:   $Revision: 1.17 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -71,7 +71,7 @@ int main(int argc, char* argv[])
    }
 
    // Test if the DicomDir contains any Patient
-   pa = e1->GetFirstEntry();
+   pa = e1->GetFirstPatient();
    if ( pa  == 0)
    {
       std::cout<<"          DicomDir '"<<fileName
@@ -91,11 +91,11 @@ int main(int argc, char* argv[])
        << " =  PATIENT List ==========================================" 
        << std::endl<< std::endl;
 
-      pa = e1->GetFirstEntry();
+      pa = e1->GetFirstPatient();
       while (pa) 
       {
          std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name   
-         pa = e1->GetNextEntry();    
+         pa = e1->GetNextPatient();    
       }
       break;
 
@@ -104,16 +104,17 @@ int main(int argc, char* argv[])
         << " = PATIENT/STUDY List =======================================" 
         << std::endl<< std::endl;
 
-      pa = e1->GetFirstEntry();
+      pa = e1->GetFirstPatient();
       while ( pa ) // on degouline les PATIENT de ce DICOMDIR
       {  
          std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name 
-         st = pa->GetFirstEntry();
+
+         st = pa->GetFirstStudy();
          while ( st ) { // on degouline les STUDY de ce patient
             std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl; // Study Description
-            st = pa->GetNextEntry();
+            st = pa->GetNextStudy();
          }
-         pa = e1->GetNextEntry();    
+         pa = e1->GetNextPatient();    
       }   
       break;
 
@@ -122,29 +123,31 @@ int main(int argc, char* argv[])
         << " =  PATIENT/STUDY/SERIE List ==================================" 
         << std::endl<< std::endl;
 
-      pa = e1->GetFirstEntry(); 
+      pa = e1->GetFirstPatient(); 
       while ( pa )   // on degouline les PATIENT de ce DICOMDIR
       {
        // Patient's Name, Patient ID 
          std::cout << "Pat.Name:[" << pa->GetEntry(0x0010, 0x0010) <<"]"; // Patient's Name
          std::cout << " Pat.ID:[";
          std::cout << pa->GetEntry(0x0010, 0x0020) << "]" << std::endl; // Patient ID
-         st = pa->GetFirstEntry();
+
+         st = pa->GetFirstStudy();
          while ( st ) { // on degouline les STUDY de ce patient
             std::cout << "--- Stud.descr:["    << st->GetEntry(0x0008, 0x1030) << "]";// Study Description 
             std::cout << " Stud.ID:["          << st->GetEntry(0x0020, 0x0010);       // Study ID
             std::cout << "]" << std::endl;
-            se = st->GetFirstEntry();
+
+            se = st->GetFirstSerie();
             while ( se ) { // on degouline les SERIES de cette study
                std::cout << "--- --- Ser.Descr:["<< se->GetEntry(0x0008, 0x103e)<< "]";  // Series Description
                std::cout << " Ser.nb:["         <<  se->GetEntry(0x0020, 0x0011);        // Series number
                std::cout << "] Mod.:["          <<  se->GetEntry(0x0008, 0x0060) << "]"; // Modality
                std::cout << std::endl;    
-               se = st->GetNextEntry();   
+               se = st->GetNextSerie();   
             }
-            st = pa->GetNextEntry();
+            st = pa->GetNextStudy();
          }
-         pa = e1->GetNextEntry();    
+         pa = e1->GetNextPatient();    
       } 
       break;
 
@@ -153,28 +156,31 @@ int main(int argc, char* argv[])
            << " = PATIENT/STUDY/SERIE/IMAGE List ============================" 
            << std::endl<< std::endl;
  
-      pa = e1->GetFirstEntry(); 
+      pa = e1->GetFirstPatient(); 
       while ( pa ) {  // les PATIENT de ce DICOMDIR
          std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
-         st = pa->GetFirstEntry();
+
+         st = pa->GetFirstStudy();
          while ( st ) { // on degouline les STUDY de ce patient
             std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl;    // Study Description
             std::cout << " Stud.ID:["          << st->GetEntry(0x0020, 0x0010); // Study ID
-            se = st->GetFirstEntry();
+
+            se = st->GetFirstSerie();
             while ( se ) { // on degouline les SERIES de cette study
                std::cout << "--- --- "<< se->GetEntry(0x0008, 0x103e) << std::endl;      // Serie Description
                std::cout << " Ser.nb:["         <<  se->GetEntry(0x0020, 0x0011);        // Series number
                std::cout << "] Mod.:["          <<  se->GetEntry(0x0008, 0x0060) << "]"; // Modality
-               im = se->GetFirstEntry();
+
+               im = se->GetFirstImage();
                while ( im ) { // on degouline les Images de cette serie
                   std::cout << "--- --- --- "<< im->GetEntry(0x0004, 0x1500) << std::endl; // File name
-                  im = se->GetNextEntry();   
+                  im = se->GetNextImage();   
                }
-               se = st->GetNextEntry();   
+               se = st->GetNextSerie();   
            }
-            st = pa->GetNextEntry();
+            st = pa->GetNextStudy();
         }     
-        pa = e1->GetNextEntry();    
+        pa = e1->GetNextPatient();    
       }
       break;
 
index 7a70e90b22dbc6d027bdbefd9ab7c659cff38d8f..abcf31faf5869f42bebd88c7665f2b7fb2dec368 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:56:21 $
-  Version:   $Revision: 1.30 $
+  Date:      $Date: 2005/01/20 11:09:22 $
+  Version:   $Revision: 1.31 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -70,7 +70,7 @@ int TestDicomDir(int argc, char* argv[])
    }
 
    // Test if the DicomDir contains any Patient
-   if( !e1->GetFirstEntry() )
+   if( !e1->GetFirstPatient() )
    {
       std::cout<<"          DicomDir '"<<file
                <<" has no patient"<<std::endl
@@ -80,37 +80,41 @@ int TestDicomDir(int argc, char* argv[])
       return 1;
    }
 
-  // step by step structure full exploitation
-  
+   // step by step structure full exploitation
    std::cout << std::endl << std::endl  
              << " = PATIENT/STUDY/SERIE/IMAGE List ============================" 
              << std::endl<< std::endl;
   
-   pa = e1->GetFirstEntry(); 
-   while ( pa ) {  // we process all the PATIENT of this DICOMDIR 
+   pa = e1->GetFirstPatient(); 
+   while ( pa ) 
+   {  // we process all the PATIENT of this DICOMDIR 
       std::cout << pa->GetEntry(0x0010, 0x0010) << std::endl; // Patient's Name
-      st = pa->GetFirstEntry();
-      while ( st ) { // we process all the STUDY of this patient
+
+      st = pa->GetFirstStudy();
+      while ( st ) 
+      { // we process all the STUDY of this patient
          std::cout << "--- "<< st->GetEntry(0x0008, 0x1030) << std::endl;    // Study Description
          std::cout << " Stud.ID:["          << st->GetEntry(0x0020, 0x0010); // Study ID
-         se = st->GetFirstEntry();
-         while ( se ) { // we process all the SERIES of this study
+
+         se = st->GetFirstSerie();
+         while ( se ) 
+         { // we process all the SERIES of this study
             std::cout << "--- --- "<< se->GetEntry(0x0008, 0x103e) << std::endl;      // Serie Description
             std::cout << " Ser.nb:["         <<  se->GetEntry(0x0020, 0x0011);        // Series number
             std::cout << "] Mod.:["          <<  se->GetEntry(0x0008, 0x0060) << "]"; // Modality
-            im = se->GetFirstEntry();
+
+            im = se->GetFirstImage();
             while ( im ) { // we process all the IMAGE of this serie
                std::cout << "--- --- --- "<< im->GetEntry(0x0004, 0x1500) << std::endl; // File name
-               im = se->GetNextEntry();   
+               im = se->GetNextImage();   
             }
-            se = st->GetNextEntry();   
+            se = st->GetNextSerie();   
          }
-         st = pa->GetNextEntry();
-     }  
-     pa = e1->GetNextEntry();
-  }  
-      
-    
+         st = pa->GetNextStudy();
+      }  
+      pa = e1->GetNextPatient();
+   }  
+
    std::cout << std::endl << std::endl  
              << " = DICOMDIR full content ====================================" 
              << std::endl<< std::endl;
index ebbbfde8843ba8e7df3db734a7fa51a6de722de7..9f05141bcf99c667e3405ce41cbc190659e9ffa4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/19 15:24:28 $
-  Version:   $Revision: 1.107 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.108 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -61,9 +61,9 @@ namespace gdcm
  */
 DicomDir::DicomDir()
    :Document( )
-{ 
+{
    Initialize();  // sets all private fields to NULL
-   MetaElems = NewMeta();
+   NewMeta();
 }
 
 /**
@@ -107,7 +107,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ):
 
       if ( parseDir ) // user asked for a recursive parsing of a root directory
       {
-         MetaElems = NewMeta();
+         NewMeta();
 
          gdcmVerboseMacro( "Parse directory and create the DicomDir");
          ParseDirectory();
@@ -209,29 +209,6 @@ bool DicomDir::IsReadable()
    return true;
 }
 
-/**
- * \brief Sets all fields to NULL
- */
-
-void DicomDir::Initialize()
-{
-   StartMethod             = NULL;
-   ProgressMethod          = NULL;
-   EndMethod               = NULL;
-   StartMethodArgDelete    = NULL;
-   ProgressMethodArgDelete = NULL;
-   EndMethodArgDelete      = NULL;
-   StartArg                = NULL;
-   ProgressArg             = NULL;
-   EndArg                  = NULL;
-
-   Progress = 0.0;
-   Abort = false;
-
-   MetaElems = NULL;   
-}
-
-
 /**
  * \brief  fills the whole structure, starting from a root Directory
  */
@@ -336,6 +313,34 @@ void DicomDir::SetEndMethodArgDelete( DicomDir::Method *method )
    EndMethodArgDelete = method;
 }
 
+/**
+ * \brief   Get the first entry while visiting the DicomDirPatients
+ * \return  The first DicomDirPatient if found, otherwhise NULL
+ */ 
+DicomDirPatient *DicomDir::GetFirstPatient()
+{
+   ItPatient = Patients.begin();
+   if ( ItPatient != Patients.end() )
+      return *ItPatient;
+   return NULL;
+}
+
+/**
+ * \brief   Get the next entry while visiting the DicomDirPatients
+ * \note : meaningfull only if GetFirstEntry already called
+ * \return  The next DicomDirPatient if found, otherwhise NULL
+ */
+DicomDirPatient *DicomDir::GetNextPatient()
+{
+   gdcmAssertMacro (ItPatient != Patients.end());
+   {
+      ++ItPatient;
+      if ( ItPatient != Patients.end() )
+         return *ItPatient;
+   }
+   return NULL;
+}
+
 /**
  * \brief    writes on disc a DICOMDIR
  * \ warning does NOT add the missing elements in the header :
@@ -366,7 +371,7 @@ bool DicomDir::WriteDicomDir(std::string const &fileName)
    fp->write(filePreamble, 128); //FIXME
    binary_write( *fp, "DICM");
  
-   DicomDirMeta *ptrMeta = GetDicomDirMeta();
+   DicomDirMeta *ptrMeta = GetMeta();
    ptrMeta->WriteContent(fp, ExplicitVR);
    
    // force writing 0004|1220 [SQ ], that CANNOT exist within DicomDirMeta
@@ -463,7 +468,10 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path)
   
 DicomDirMeta * DicomDir::NewMeta()
 {
-   DicomDirMeta *m = new DicomDirMeta();
+   if( MetaElems )
+      delete MetaElems;
+
+   MetaElems = new DicomDirMeta();
   
    if ( TagHT.begin() != TagHT.end() ) // after Document Parsing
    { 
@@ -475,17 +483,17 @@ DicomDirMeta * DicomDir::NewMeta()
                                     cc != lastOneButSequence;
                                    ++cc)
       {
-         m->AddEntry( cc->second );
+         MetaElems->AddEntry( cc->second );
       }
    }
    else  // after root directory parsing
    {
       ListDicomDirMetaElem const &elemList = 
          Global::GetDicomDirElements()->GetDicomDirMetaElements();
-      m->FillObject(elemList);
+      MetaElems->FillObject(elemList);
    }
-   m->SetSQItemNumber(0); // To avoid further missprinting
-   return m;  
+   MetaElems->SetSQItemNumber(0); // To avoid further missprinting
+   return MetaElems;  
 }
 
 /**
@@ -515,8 +523,7 @@ DicomDirPatient *DicomDir::NewPatient()
       p->AddEntry( entry );
    }
 
-   Patients.push_front( p );
-
+   AddPatientToEnd( p );
    return p;
 }
 
@@ -544,33 +551,37 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
       case GDCM_DICOMDIR_IMAGE:
          elemList = Global::GetDicomDirElements()->GetDicomDirImageElements();
          si = new DicomDirImage();
-         if( !AddDicomDirImageToEnd(static_cast<DicomDirImage *>(si)) )
+         if( !AddImageToEnd(static_cast<DicomDirImage *>(si)) )
          {
-            gdcmVerboseMacro( "Add DicomDirImageToEnd failed");
+            delete si;
+            gdcmErrorMacro( "Add ImageToEnd failed");
          }
          break;
       case GDCM_DICOMDIR_SERIE:
          elemList = Global::GetDicomDirElements()->GetDicomDirSerieElements();
          si = new DicomDirSerie();
-         if( !AddDicomDirSerieToEnd(static_cast<DicomDirSerie *>(si)) )
+         if( !AddSerieToEnd(static_cast<DicomDirSerie *>(si)) )
          {
-            gdcmVerboseMacro( "Add DicomDirSerieToEnd failed");
+            delete si;
+            gdcmErrorMacro( "Add SerieToEnd failed");
          }
          break;
       case GDCM_DICOMDIR_STUDY:
          elemList = Global::GetDicomDirElements()->GetDicomDirStudyElements();
          si = new DicomDirStudy();
-         if( !AddDicomDirStudyToEnd(static_cast<DicomDirStudy *>(si)) )
+         if( !AddStudyToEnd(static_cast<DicomDirStudy *>(si)) )
          {
-            gdcmVerboseMacro( "Add DicomDirStudyToEnd failed");
+            delete si;
+            gdcmErrorMacro( "Add StudyToEnd failed");
          }
          break;
       case GDCM_DICOMDIR_PATIENT:
          elemList = Global::GetDicomDirElements()->GetDicomDirPatientElements();
          si = new DicomDirPatient();
-         if( !AddDicomDirPatientToEnd(static_cast<DicomDirPatient *>(si)) )
+         if( !AddPatientToEnd(static_cast<DicomDirPatient *>(si)) )
          {
-            gdcmVerboseMacro( "Add DicomDirPatientToEnd failed");
+            delete si;
+            gdcmErrorMacro( "Add PatientToEnd failed");
          }
          break;
       case GDCM_DICOMDIR_META:
@@ -578,8 +589,8 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
          si = new DicomDirMeta();
          if( MetaElems )
          {
-            gdcmVerboseMacro( "MetaElements already exist, they will be destroyed");
             delete MetaElems;
+            gdcmErrorMacro( "MetaElements already exist, they will be destroyed");
          }
          MetaElems = static_cast<DicomDirMeta *>(si);
          break;
@@ -651,8 +662,7 @@ void DicomDir::SetElement(std::string const &path, DicomDirType type,
 
       if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !
       {
-         std::cout << "GDCM_DICOMDIR_META ?!? should never print that" 
-                   << std::endl;
+         gdcmVerboseMacro("GDCM_DICOMDIR_META ?!? should never print that");
       }
       si->AddEntry(entry);
    }
@@ -699,6 +709,27 @@ void DicomDir::CallEndMethod()
 
 //-----------------------------------------------------------------------------
 // Private
+/**
+ * \brief Sets all fields to NULL
+ */
+void DicomDir::Initialize()
+{
+   StartMethod             = NULL;
+   ProgressMethod          = NULL;
+   EndMethod               = NULL;
+   StartMethodArgDelete    = NULL;
+   ProgressMethodArgDelete = NULL;
+   EndMethodArgDelete      = NULL;
+   StartArg                = NULL;
+   ProgressArg             = NULL;
+   EndArg                  = NULL;
+
+   Progress = 0.0;
+   Abort = false;
+
+   MetaElems = NULL;   
+}
+
 /**
  * \brief create a 'DicomDir' from a DICOMDIR Header 
  */
@@ -729,7 +760,7 @@ void DicomDir::CreateDicomDir()
       return;
    }
 
-   MetaElems = NewMeta();
+   NewMeta();
 
    ListSQItem listItems = s->GetSQItems();
    
@@ -753,22 +784,42 @@ void DicomDir::CreateDicomDir()
       if( v == "PATIENT " )
       {
          si = new DicomDirPatient();
-         AddDicomDirPatientToEnd( static_cast<DicomDirPatient *>(si) );
+         if( !AddPatientToEnd( static_cast<DicomDirPatient *>(si)) )
+         {
+            delete si;
+            si = NULL;
+            gdcmErrorMacro( "Add PatientToEnd failed");
+         }
       }
       else if( v == "STUDY " )
       {
          si = new DicomDirStudy();
-         AddDicomDirStudyToEnd( static_cast<DicomDirStudy *>(si) );
+         if( !AddStudyToEnd( static_cast<DicomDirStudy *>(si)) )
+         {
+            delete si;
+            si = NULL;
+            gdcmErrorMacro( "Add AddStudyToEnd failed");
+         }
       }
       else if( v == "SERIES" )
       {
          si = new DicomDirSerie();
-         AddDicomDirSerieToEnd( static_cast<DicomDirSerie *>(si) );
+         if( !AddSerieToEnd( static_cast<DicomDirSerie *>(si)) )
+         {
+            delete si;
+            si = NULL;
+            gdcmErrorMacro( "Add AddSerieToEnd failed");
+         }
       }
       else if( v == "IMAGE " ) 
       {
          si = new DicomDirImage();
-         AddDicomDirImageToEnd( static_cast<DicomDirImage *>(si) );
+         if( !AddImageToEnd( static_cast<DicomDirImage *>(si)) )
+         {
+            delete si;
+            si = NULL;
+            gdcmErrorMacro( "Add AddImageToEnd failed");
+         }
       }
       else
       {
@@ -776,85 +827,90 @@ void DicomDir::CreateDicomDir()
          // neither an 'IMAGE' SQItem. Skip to next item.
          continue;
       }
-      MoveSQItem(si,*i);
-   }
-   TagHT.clear();
-}
 
-/**
- * \brief Well ... there is only one occurence  
- */
-bool DicomDir::AddDicomDirMeta()
-{
-   if( MetaElems )
-   {
-      delete MetaElems;
+      if( si )
+         MoveSQItem(si,*i);
    }
-   MetaElems = new DicomDirMeta();
-   return true;
+   TagHT.clear();
 }
 
 /**
- * \brief  AddDicomDirPatientToEnd 
+ * \brief  AddPatientToEnd 
  * @param   dd SQ Item to enqueue to the DicomPatient chained List
  */
-bool DicomDir::AddDicomDirPatientToEnd(DicomDirPatient *dd)
+bool DicomDir::AddPatientToEnd(DicomDirPatient *dd)
 {
    Patients.push_back(dd);
    return true;
 }
 
 /**
- * \brief  AddDicomDirStudyToEnd 
+ * \brief  AddStudyToEnd 
  * @param   dd SQ Item to enqueue to the DicomDirStudy chained List
  */
-bool DicomDir::AddDicomDirStudyToEnd(DicomDirStudy *dd)
+bool DicomDir::AddStudyToEnd(DicomDirStudy *dd)
 {
    if( Patients.size() > 0 )
    {
       ListDicomDirPatient::iterator itp = Patients.end();
       itp--;
-      (*itp)->AddDicomDirStudy(dd);
+      (*itp)->AddStudy(dd);
       return true;
    }
    return false;
 }
 
 /**
- * \brief  AddDicomDirSerieToEnd 
+ * \brief  AddSerieToEnd 
  * @param   dd SQ Item to enqueue to the DicomDirSerie chained List
  */
-bool DicomDir::AddDicomDirSerieToEnd(DicomDirSerie *dd)
+bool DicomDir::AddSerieToEnd(DicomDirSerie *dd)
 {
    if( Patients.size() > 0 )
    {
       ListDicomDirPatient::iterator itp = Patients.end();
       itp--;
 
-      if( (*itp)->GetDicomDirStudies().size() > 0 )
+      DicomDirStudy *study = (*itp)->GetLastStudy();
+      if( study )
+      {
+         study->AddSerie(dd);
+         return true;
+      }
+/*      if( (*itp)->GetDicomDirStudies().size() > 0 )
       {
          ListDicomDirStudy::const_iterator itst = 
             (*itp)->GetDicomDirStudies().end();
          itst--;
-         (*itst)->AddDicomDirSerie(dd);
+         (*itst)->AddSerie(dd);
          return true;
-      }
+      }*/
    }
    return false;
 }
 
 /**
- * \brief   AddDicomDirImageToEnd
+ * \brief   AddImageToEnd
  * @param   dd SQ Item to enqueue to the DicomDirImage chained List
  */
-bool DicomDir::AddDicomDirImageToEnd(DicomDirImage *dd)
+bool DicomDir::AddImageToEnd(DicomDirImage *dd)
 {
    if( Patients.size() > 0 )
    {
       ListDicomDirPatient::iterator itp = Patients.end();
       itp--;
 
-      if( (*itp)->GetDicomDirStudies().size() > 0 )
+      DicomDirStudy *study = (*itp)->GetLastStudy();
+      if( study )
+      {
+         DicomDirSerie *serie = study->GetLastSerie();
+         if( serie )
+         {
+            serie->AddImage(dd);
+            return true;
+         }
+      }
+/*      if( (*itp)->GetDicomDirStudies().size() > 0 )
       {
          ListDicomDirStudy::const_iterator itst = 
             (*itp)->GetDicomDirStudies().end();
@@ -864,10 +920,10 @@ bool DicomDir::AddDicomDirImageToEnd(DicomDirImage *dd)
          {
             ListDicomDirSerie::const_iterator its = (*itst)->GetDicomDirSeries().end();
             its--;
-            (*its)->AddDicomDirImage(dd);
+            (*its)->AddImage(dd);
             return true;
          }
-      }
+      }*/
    }
    return false;
 }
@@ -965,36 +1021,6 @@ bool DicomDir::HeaderLessThan(Document *header1, Document *header2)
    return *header1 < *header2;
 }
 
-
-/**
- * \brief   Get the first entry while visiting the DicomDirPatients
- * \return  The first DicomDirPatient if found, otherwhise NULL
- */ 
-DicomDirPatient *DicomDir::GetFirstEntry()
-{
-   ItDicomDirPatient = Patients.begin();
-   if ( ItDicomDirPatient != Patients.end() )
-      return *ItDicomDirPatient;
-   return NULL;
-}
-
-/**
- * \brief   Get the next entry while visiting the DicomDirPatients
- * \note : meaningfull only if GetFirstEntry already called
- * \return  The next DicomDirPatient if found, otherwhise NULL
- */
-DicomDirPatient *DicomDir::GetNextEntry()
-{
-   gdcmAssertMacro (ItDicomDirPatient != Patients.end());
-   {
-      ++ItDicomDirPatient;
-      if ( ItDicomDirPatient != Patients.end() )
-         return *ItDicomDirPatient;
-   }
-   return NULL;
-}
-
-
 } // end namespace gdcm
 
 //-----------------------------------------------------------------------------
index eca86fbadc8c8eb30eb480c837df687fc1856ed7..f3f9b073e4f48101e4d9ec85dbad3629a886543d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:53:42 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.49 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -60,16 +60,10 @@ public:
    /// \brief   canonical Printer 
    void Print(std::ostream &os = std::cout, std::string const & indent = "" );
 
+   
    /// Informations contained in the parser
    virtual bool IsReadable();
 
-   /// Returns a pointer to the DicomDirMeta for this DICOMDIR. 
-   DicomDirMeta* GetDicomDirMeta() { return MetaElems; };
-
-   // should avoid exposing internal mechanism
-   DicomDirPatient *GetFirstEntry();
-   DicomDirPatient *GetNextEntry();
-
    /// Parsing
    void ParseDirectory();
    
@@ -88,16 +82,20 @@ public:
    void SetStartMethodArgDelete( DicomDir::Method *m );
    void SetProgressMethodArgDelete( DicomDir::Method *m );
    void SetEndMethodArgDelete( DicomDir::Method *m );
-
    /// GetProgress GetProgress
    float GetProgress()  { return Progress; };
-
    /// AbortProgress AbortProgress
    void  AbortProgress() { Abort = true; };
-
    /// IsAborted IsAborted
    bool  IsAborted() { return Abort; };
-   
+
+   /// Returns a pointer to the DicomDirMeta for this DICOMDIR. 
+   DicomDirMeta* GetMeta() { return MetaElems; };
+
+   // should avoid exposing internal mechanism
+   DicomDirPatient *GetFirstPatient();
+   DicomDirPatient *GetNextPatient();
+
    /// Adding
    DicomDirMeta    *NewMeta();
    DicomDirPatient *NewPatient();
@@ -126,11 +124,10 @@ private:
    void Initialize();
    void CreateDicomDir();
 
-   bool AddDicomDirMeta();
-   bool AddDicomDirPatientToEnd(DicomDirPatient *dd);
-   bool AddDicomDirStudyToEnd  (DicomDirStudy *dd);
-   bool AddDicomDirSerieToEnd  (DicomDirSerie *dd);
-   bool AddDicomDirImageToEnd  (DicomDirImage *dd);
+   bool AddPatientToEnd(DicomDirPatient *dd);
+   bool AddStudyToEnd  (DicomDirStudy *dd);
+   bool AddSerieToEnd  (DicomDirSerie *dd);
+   bool AddImageToEnd  (DicomDirImage *dd);
 
    void SetElements(std::string const &path, VectDocument const &list);
    void SetElement (std::string const &path, DicomDirType type,
@@ -143,10 +140,10 @@ private:
 
    /// Pointer on *the* DicomDirObject 'DicomDirMeta Elements'
    DicomDirMeta* MetaElems;
-   ListDicomDirPatient::iterator ItDicomDirPatient;
 
    /// Chained list of DicomDirPatient (to be exploited recursively) 
    ListDicomDirPatient Patients;
+   ListDicomDirPatient::iterator ItPatient;
 
    /// pointer to the initialisation method for any progress bar   
    Method* StartMethod;
index b393d5dd00b93fe579af715a671b646f36e63b2b..bf876a9ac3212aab2c33d8dd62d099c1f46cd01f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirElement.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:53:42 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -40,7 +40,8 @@ DicomDirElement::DicomDirElement()
    std::ifstream from(filename.c_str());
    if(!from)
    {
-      gdcmVerboseMacro( "Can't open dictionary" << filename.c_str());
+      gdcmVerboseMacro( "Can't open DicomDirElement dictionary" 
+                        << filename.c_str());
       FillDefaultDIRDict( this );
    }
    else
index edbd6a855c24b01871ed77c4003d9ac6618b81e3..c4501ffc2a27222d0321446ca24317c4953cc7f8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/08 15:03:59 $
-  Version:   $Revision: 1.15 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.16 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -49,25 +49,6 @@ DicomDirObject::~DicomDirObject()
 //-----------------------------------------------------------------------------
 // Public
 
-
-/**
- * \brief   Builds a hash table (multimap) containing 
- *          pointers to all Header Entries (i.e Dicom Element)
- *          related to this 'object'
- * @return
- */ 
-TagDocEntryHT DicomDirObject::GetEntryHT()
-{
-   TagDocEntryHT HT;
-   DocEntries = GetDocEntries();   
-   for(ListDocEntry::iterator i = DocEntries.begin(); 
-                              i != DocEntries.end(); ++i)
-   {
-      HT[(*i)->GetKey()] = *i;
-   }
-   return HT;
-}
-
 //-----------------------------------------------------------------------------
 // Protected
 /**
index c731f46e1f0d99c0e6c69ac1b776675be1bd8f44..2c70277b489b2a17721d76661cb1dc8a125da209 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirObject.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 15:15:38 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -30,6 +30,8 @@ namespace gdcm
 //-----------------------------------------------------------------------------
 class DicomDirObject;
 
+//-----------------------------------------------------------------------------
+typedef std::list<DicomDirObject *> ListContent;
 //-----------------------------------------------------------------------------
 /**
  * \ingroup DicomDirObject
@@ -38,9 +40,7 @@ class DicomDirObject;
  */
 class GDCM_EXPORT DicomDirObject : public SQItem
 {
-typedef std::list<DicomDirObject *> ListContent;
 public:
-   TagDocEntryHT GetEntryHT();
    void FillObject(ListDicomDirMetaElem const &elemList);
 
 protected:
index abf4d1b2f0fd4b0dc210ab71efcbe481d0b0c94e..035f6492805d66dd078277320d037ebe74948652 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.29 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -69,6 +69,8 @@ void DicomDirPatient::Print(std::ostream &os, std::string const & )
    }
 }
 
+//-----------------------------------------------------------------------------
+// Public
 /**
  * \brief   Writes the Object
  * @param fp ofstream to write to
@@ -85,8 +87,6 @@ void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t)
       (*cc)->WriteContent( fp, t );
    }
 }
-//-----------------------------------------------------------------------------
-// Public
 
 /**
  * \brief   adds a new Patient at the begining of the PatientList
@@ -100,7 +100,7 @@ DicomDirStudy* DicomDirPatient::NewStudy()
    DicomDirStudy *st = new DicomDirStudy();
    st->FillObject(elemList);
 
-   Studies.push_front(st);
+   Studies.push_back(st);
    return st; 
 }   
 
@@ -108,11 +108,11 @@ DicomDirStudy* DicomDirPatient::NewStudy()
  * \brief   Get the first entry while visiting the DicomDirStudy
  * \return  The first DicomDirStudy if found, otherwhise NULL
  */ 
-DicomDirStudy *DicomDirPatient::GetFirstEntry()
+DicomDirStudy *DicomDirPatient::GetFirstStudy()
 {
-   ItDicomDirStudy = Studies.begin();
-   if (ItDicomDirStudy != Studies.end())
-      return *ItDicomDirStudy;
+   ItStudy = Studies.begin();
+   if (ItStudy != Studies.end())
+      return *ItStudy;
    return NULL;
 }
 
@@ -121,16 +121,32 @@ DicomDirStudy *DicomDirPatient::GetFirstEntry()
  * \note : meaningfull only if GetFirstEntry already called
  * \return  The next DicomDirStudies if found, otherwhise NULL
  */
-DicomDirStudy *DicomDirPatient::GetNextEntry()
+DicomDirStudy *DicomDirPatient::GetNextStudy()
 {
-   gdcmAssertMacro (ItDicomDirStudy != Studies.end())
+   gdcmAssertMacro (ItStudy != Studies.end())
    {
-      ++ItDicomDirStudy;
-      if (ItDicomDirStudy != Studies.end())
-         return *ItDicomDirStudy;
+      ++ItStudy;
+      if (ItStudy != Studies.end())
+         return *ItStudy;
    }
    return NULL;
 }
+
+/**
+ * \brief   Get the first entry while visiting the DicomDirStudy
+ * \return  The first DicomDirStudy if found, otherwhise NULL
+ */ 
+DicomDirStudy *DicomDirPatient::GetLastStudy()
+{
+   ItStudy = Studies.end();
+   if (ItStudy != Studies.begin())
+   {
+      --ItStudy;
+      return *ItStudy;
+   }
+   return NULL;
+}
+
 //-----------------------------------------------------------------------------
 // Protected
 
index 97f78cf73ecf039b16dfec47a45e9b735f84943e..b3602e5a68460dcfefa66c0a38e381865214313b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirPatient.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:53:42 $
-  Version:   $Revision: 1.20 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.21 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -42,15 +42,13 @@ public:
    void Print(std::ostream &os = std::cout, std::string const & indent = "" );
    void WriteContent(std::ofstream *fp, FileType t);
   
-   /// Returns the STUDY chained List for this PATIENT.
-   ListDicomDirStudy const &GetDicomDirStudies() const { return Studies; };
-
    // should avoid exposing internal mechanism
-   DicomDirStudy *GetFirstEntry();
-   DicomDirStudy *GetNextEntry();
+   DicomDirStudy *GetFirstStudy();
+   DicomDirStudy *GetNextStudy();
+   DicomDirStudy *GetLastStudy();
 
    /// adds the passed STUDY to the STUDY chained List for this PATIENT.
-   void AddDicomDirStudy (DicomDirStudy *obj) { Studies.push_back(obj); };
+   void AddStudy(DicomDirStudy *obj) { Studies.push_back(obj); };
 
    DicomDirStudy *NewStudy(); 
          
@@ -59,7 +57,7 @@ private:
    /// chained list of DicomDirStudy  (to be exploited recursively)
    ListDicomDirStudy Studies;
    /// iterator on the DicomDirStudies of the current DicomDirPatient
-   ListDicomDirStudy::iterator ItDicomDirStudy;
+   ListDicomDirStudy::iterator ItStudy;
 };
 } // end namespace gdcm
 
index 50dbfa91857b619dd9de6b889c187d83fdf810cd..0abf587e748e0f0b01157f891b54d405b18f2b83 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.30 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.31 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -70,7 +70,6 @@ void DicomDirSerie::Print(std::ostream &os, std::string const &)
 
 //-----------------------------------------------------------------------------
 // Public
-
 /**
  * \brief   Writes the Object
  * @param fp ofstream to write to
@@ -97,9 +96,9 @@ DicomDirImage *DicomDirSerie::NewImage()
       Global::GetDicomDirElements()->GetDicomDirImageElements();
 
    DicomDirImage *st = new DicomDirImage();
-   FillObject(elemList);
-   Images.push_front(st);
+   st->FillObject(elemList);
 
+   Images.push_back(st);
    return st;   
 }
 
@@ -107,11 +106,11 @@ DicomDirImage *DicomDirSerie::NewImage()
  * \brief   Get the first entry while visiting the DicomDirImage
  * \return  The first DicomDirImage if found, otherwhise NULL
  */
-DicomDirImage *DicomDirSerie::GetFirstEntry()
+DicomDirImage *DicomDirSerie::GetFirstImage()
 {
-   ItDicomDirImage = Images.begin();
-   if (ItDicomDirImage != Images.end())
-      return *ItDicomDirImage;
+   ItImage = Images.begin();
+   if (ItImage != Images.end())
+      return *ItImage;
    return NULL;
 }
 
@@ -120,17 +119,32 @@ DicomDirImage *DicomDirSerie::GetFirstEntry()
  * \note : meaningfull only if GetFirstEntry already called
  * \return  The next DicomDirImages if found, otherwhise NULL
  */
-DicomDirImage *DicomDirSerie::GetNextEntry()
+DicomDirImage *DicomDirSerie::GetNextImage()
 {
-   gdcmAssertMacro (ItDicomDirImage != Images.end());
+   gdcmAssertMacro (ItImage != Images.end());
    {
-      ++ItDicomDirImage;
-      if (ItDicomDirImage != Images.end())      
-         return *ItDicomDirImage;
+      ++ItImage;
+      if (ItImage != Images.end())      
+         return *ItImage;
    }
    return NULL;
 }
  
+/**
+ * \brief   Get the first entry while visiting the DicomDirImage
+ * \return  The first DicomDirImage if found, otherwhise NULL
+ */
+DicomDirImage *DicomDirSerie::GetLastImage()
+{
+   ItImage = Images.end();
+   if (ItImage != Images.begin())
+   {
+      --ItImage;
+      return *ItImage;
+   }
+   return NULL;
+}
+
 //-----------------------------------------------------------------------------
 // Protected
 
index 4449d20d0008d84de66b3476fa72611eeb5d0ae3..751400477ed396ad5f0f7817b1ddf4cc15902424 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirSerie.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:53:42 $
-  Version:   $Revision: 1.21 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.22 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -41,15 +41,13 @@ public:
    void Print( std::ostream &os = std::cout, std::string const & indent = "" );
    void WriteContent( std::ofstream *fp, FileType t );
  
-   /// Returns the IMAGE chained List for this SERIE.
-   ListDicomDirImage const &GetDicomDirImages() const { return Images; };
-
    // should avoid exposing internal mechanism
-   DicomDirImage *GetFirstEntry();
-   DicomDirImage *GetNextEntry();
+   DicomDirImage *GetFirstImage();
+   DicomDirImage *GetNextImage();
+   DicomDirImage *GetLastImage();
         
    /// adds the passed IMAGE to the IMAGE chained List for this SERIE.    
-   void AddDicomDirImage(DicomDirImage *obj) { Images.push_back(obj); };
+   void AddImage(DicomDirImage *obj) { Images.push_back(obj); };
 
    DicomDirImage *NewImage();
 
@@ -58,7 +56,7 @@ private:
    ///chained list of DicomDirImages (to be exploited recursively)
    ListDicomDirImage Images;
    /// iterator on the DicomDirImages of the current DicomDirSerie
-   ListDicomDirImage::iterator ItDicomDirImage;
+   ListDicomDirImage::iterator ItImage;
 };
 } // end namespace gdcm
 //-----------------------------------------------------------------------------
index 92630664ab69bbbccbea9ec1f4dcf4e2ff6db468..3a552627ab61b00c08d27a445a89329094ce9f74 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 14:28:32 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.28 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -70,7 +70,6 @@ void DicomDirStudy::Print(std::ostream &os, std::string const & )
 
 //-----------------------------------------------------------------------------
 // Public
-
 /**
  * \brief   Writes the Object
  * @param fp ofstream to write to
@@ -99,21 +98,21 @@ DicomDirSerie *DicomDirStudy::NewSerie()
       Global::GetDicomDirElements()->GetDicomDirSerieElements();   
 
    DicomDirSerie* st = new DicomDirSerie();
-   FillObject(elemList);
-   Series.push_front(st);
+   st->FillObject(elemList);
 
-   return st;  
+   Series.push_back(st);
+   return st;
 } 
 
- /**
+/**
  * \brief   Get the first entry while visiting the DicomDirSeries
  * \return  The first DicomDirSerie if found, otherwhise NULL
  */
-DicomDirSerie *DicomDirStudy::GetFirstEntry()
+DicomDirSerie *DicomDirStudy::GetFirstSerie()
 {
-   ItDicomDirSerie = Series.begin();
-   if (ItDicomDirSerie != Series.end())
-      return *ItDicomDirSerie;
+   ItSerie = Series.begin();
+   if (ItSerie != Series.end())
+      return *ItSerie;
    return NULL;
 }
 
@@ -122,16 +121,32 @@ DicomDirSerie *DicomDirStudy::GetFirstEntry()
  * \note : meaningfull only if GetFirstEntry already called
  * \return  The next DicomDirSerie if found, otherwhise NULL
  */
-DicomDirSerie *DicomDirStudy::GetNextEntry()
+DicomDirSerie *DicomDirStudy::GetNextSerie()
 {
-   gdcmAssertMacro (ItDicomDirSerie != Series.end());
+   gdcmAssertMacro (ItSerie != Series.end());
    {
-      ++ItDicomDirSerie;
-      if (ItDicomDirSerie != Series.end())
-         return *ItDicomDirSerie;
+      ++ItSerie;
+      if (ItSerie != Series.end())
+         return *ItSerie;
    }
    return NULL;
 }  
+
+/**
+ * \brief   Get the last entry while visiting the DicomDirSeries
+ * \return  The first DicomDirSerie if found, otherwhise NULL
+ */
+DicomDirSerie *DicomDirStudy::GetLastSerie()
+{
+   ItSerie = Series.end();
+   if (ItSerie != Series.begin())
+   {
+     --ItSerie;
+      return *ItSerie;
+   }
+   return NULL;
+}
+
 //-----------------------------------------------------------------------------
 // Protected
 
index 1a33f86f0b9737091d52f99fb54b6fe1f7841b82..57d533af0ef4baa86ac816b9cc500017d0a53a8a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDirStudy.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/18 07:53:42 $
-  Version:   $Revision: 1.19 $
+  Date:      $Date: 2005/01/20 11:09:23 $
+  Version:   $Revision: 1.20 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -41,15 +41,13 @@ public:
    void Print(std::ostream &os = std::cout, std::string const & indent = "" );
    void WriteContent(std::ofstream *fp, FileType t);
 
-    /// Returns the SERIE chained List for this STUDY.
-   ListDicomDirSerie const &GetDicomDirSeries() const { return Series; };
-
    // should avoid exposing internal mechanism
-   DicomDirSerie *GetFirstEntry();
-   DicomDirSerie *GetNextEntry();
+   DicomDirSerie *GetFirstSerie();
+   DicomDirSerie *GetNextSerie();
+   DicomDirSerie *GetLastSerie();
 
    /// adds the passed SERIE to the SERIE chained List for this STUDY.
-   void AddDicomDirSerie(DicomDirSerie *obj) { Series.push_back(obj); };
+   void AddSerie(DicomDirSerie *obj) { Series.push_back(obj); };
 
    DicomDirSerie* NewSerie();
     
@@ -58,7 +56,7 @@ private:
    /// chained list of DicomDirSeries (to be exploited recursively)
    ListDicomDirSerie Series;
    /// iterator on the DicomDirSeries of the current DicomDirStudy
-   ListDicomDirSerie::iterator ItDicomDirSerie;
+   ListDicomDirSerie::iterator ItSerie;
 
 };
 } // end namespace gdcm