]> Creatis software - gdcm.git/blobdiff - src/gdcmSerieHeader.cxx
in order to be able to use fearlessly copy-paste group-elem are now called
[gdcm.git] / src / gdcmSerieHeader.cxx
index 6360e0a46ac892eaf22627468428c1bd71f12a0c..e1347e2635cc42d6901426d0e24af4c6e4165f03 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 21:03:54 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2005/01/14 22:20:11 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -34,7 +34,7 @@ typedef std::vector<Header* > GdcmHeaderVector;
 SerieHeader::SerieHeader()
 {
    CoherentGdcmFileList.clear();
-   // Later will contains: 0020 000e UI REL Series Instance UID
+   // Later will contain: 0020 000e UI REL Series Instance UID
    CurrentSerieUID = "";
 }
 
@@ -66,6 +66,8 @@ void SerieHeader::AddFileName(std::string const &filename)
    {
       // 0020 000e UI REL Series Instance UID
       std::string uid =  header->GetEntry (0x0020, 0x000e);
+      // if uid == GDCM_UNFOUND then consistenly we should find GDCM_UNFOUND
+      // no need here to do anything special
       if( CurrentSerieUID == "" )
       {
          // Set the current one
@@ -88,31 +90,17 @@ void SerieHeader::AddFileName(std::string const &filename)
    }
 }
 
-/**
- * \brief add a File to the list
- * @param   file Header to add
- */
-void SerieHeader::AddGdcmFile(Header *file)
-{
-   if( file->IsReadable() )
-   {
-      CoherentGdcmFileList.push_back( file );
-   }
-   else
-   {
-      gdcmVerboseMacro("Could not add file: " << file->GetFileName() );
-   }
-}
-
 /**
  * \brief Sets the Directory
  * @param   dir Name of the directory to deal with
  */
 void SerieHeader::SetDirectory(std::string const &dir)
 {
-   DirList filenames_list(dir);  //OS specific
+   CurrentSerieUID = ""; //Reset previous Serie Instance UID
+   DirList dirList(dir);  //OS specific
   
-   for( DirList::const_iterator it = filenames_list.begin(); 
+   DirListType filenames_list = dirList.GetFilenames();
+   for( DirListType::const_iterator it = filenames_list.begin(); 
         it != filenames_list.end(); ++it)
    {
       AddFileName( *it );