00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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 }
00079
00080
00081 #endif