]> Creatis software - gdcm.git/commitdiff
ENH: Simplify gdcmSerieHeader API. SerieHeader should focus only on sorting DICOM...
authormalaterre <malaterre>
Fri, 14 Jan 2005 21:30:53 +0000 (21:30 +0000)
committermalaterre <malaterre>
Fri, 14 Jan 2005 21:30:53 +0000 (21:30 +0000)
src/gdcmSerieHeader.cxx
src/gdcmSerieHeader.h

index 6360e0a46ac892eaf22627468428c1bd71f12a0c..2c61c933570722ddcdfa74871eeb61beaae317d6 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 21:30:53 $
+  Version:   $Revision: 1.7 $
                                                                                 
   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 = "";
 }
 
@@ -88,28 +88,13 @@ 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)
 {
+   CurrentSerieUID = ""; //Reset previous Serie Instance UID
    DirList filenames_list(dir);  //OS specific
   
    for( DirList::const_iterator it = filenames_list.begin(); 
index 55893b9e54c7df1a50d2d57a47440eb671211391..b6a8a76da083d6e308a6452055b68c6027611e10 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHeader.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 21:03:55 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/01/14 21:30:53 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -42,16 +42,12 @@ public:
 
    /// \todo should return bool or throw error ?
    void AddFileName(std::string const &filename);
-   void AddGdcmFile(Header *file);
    void SetDirectory(std::string const &dir);
    void OrderGdcmFileList();
    
-   /// \warning Assumes all elements in the list have the same global infos.
-   ///          Assumes the list is not empty.
-   Header *GetGdcmHeader() { return CoherentGdcmFileList.front(); }
-
    /// \brief Gets the *coherent* File List
    /// @return the *coherent* File List
+   /// Caller must call OrderGdcmFileList first
    const GdcmHeaderList &GetGdcmFileList() { return CoherentGdcmFileList; }
 
 private: