Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

gdcmSerieHelper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmSerieHelper.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/02/06 14:43:28 $
00007   Version:   $Revision: 1.6 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #ifndef GDCMSERIEHELPER_H
00020 #define GDCMSERIEHELPER_H
00021 
00022 #include "gdcmCommon.h" 
00023 
00024 #include <vector>
00025 #include <iostream>
00026 #include <map>
00027 
00028 namespace gdcm 
00029 {
00030 class File;
00031 typedef std::vector<File* > GdcmFileList;
00032 
00033 //-----------------------------------------------------------------------------
00041 class GDCM_EXPORT SerieHelper 
00042 {
00043 public:
00044    typedef std::map<std::string, GdcmFileList *> CoherentFileListmap;
00045    typedef std::vector<File* > GdcmFileVector;
00046 
00047    SerieHelper();
00048    ~SerieHelper();
00049    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
00050 
00052    void AddFileName(std::string const &filename);
00053    void SetDirectory(std::string const &dir, bool recursive=false);
00054    void OrderGdcmFileList(GdcmFileList *CoherentGdcmFileList);
00055    
00060    const GdcmFileList &GetGdcmFileList() { return
00061                        *CoherentGdcmFileListHT.begin()->second; }
00062   
00063    GdcmFileList *GetFirstCoherentFileList();
00064    GdcmFileList *GetNextCoherentFileList();
00065    GdcmFileList *GetCoherentFileList(std::string SerieUID);
00066 
00067 private:
00068    bool ImagePositionPatientOrdering(GdcmFileList *CoherentGdcmFileList);
00069    bool ImageNumberOrdering(GdcmFileList *CoherentGdcmFileList);
00070    bool FileNameOrdering(GdcmFileList *CoherentGdcmFileList);
00071    
00072    static bool ImageNumberLessThan(File *file1, File *file2);
00073    static bool FileNameLessThan(File *file1, File *file2);
00074    CoherentFileListmap CoherentGdcmFileListHT;
00075    CoherentFileListmap::iterator ItListHt;
00076 };
00077 
00078 } // end namespace gdcm
00079 
00080 //-----------------------------------------------------------------------------
00081 #endif

Generated on Thu Feb 10 22:18:00 2005 for gdcm by doxygen 1.3.6