Go to the documentation of this file.00001 #ifndef __creaImageIOoutputModel_h_INCLUDED__
00002 #define __creaImageIOoutputModel_h_INCLUDED__
00003 #if defined (USE_XERCES)
00004 #include <creaImageIOOutputModelParser.h>
00005 #endif
00006 #if defined(USE_GDCM2)
00007 #include <gdcmScanner.h>
00008 #endif
00009
00010 #include <vector>
00011 #include <string>
00012
00013 #define OUTPUTMODEL_TAG_i ""
00014 #define OUTPUTMODEL_TAG_0 "TAG_BEGIN"
00015 #define OUTPUTMODEL_TAG_1 "TAG_END"
00016 #define OUTPUTMODEL_TAG_2 "TAG_STEP"
00017 #define OUTPUTMODEL_TAG_3 "DICOM_TAG"
00018 #define OUTPUTMODEL_TAG_4 "ANCHOR"
00019 #define OUTPUTMODEL_TAG(i) OUTPUTMODEL_TAG_ ## i
00020
00021 namespace creaImageIO
00022 {
00023
00024 class OutputModel
00025 {
00026 public:
00027 OutputModel(){}
00028 virtual ~OutputModel();
00029 double orderFilesWithZspacing(std::vector<std::string> &im);
00030
00031 #if defined(USE_XERCES)
00032 OutputModel(OutputModelParser *i_outparser);
00033
00034
00035 void setDB(const std::string i_db, const std::string i_table);
00036
00037 const std::string getTag();
00038
00039 private:
00040
00041 OutputModelParser *m_outparser;
00042
00043
00044 int dim;
00045
00046
00047 bool bmodel;
00048
00049
00050
00051
00052 bool bDicom;
00053
00054
00055 std::string m_dbname;
00056
00057 std::string m_tag;
00058 #if defined(USE_GDCM)
00059
00060 template<typename T>
00061
00062 double orderFiles(std::vector<std::string> im, std::vector<std::string> &out);
00063
00064 #endif
00065 #if defined(USE_GDCM2)
00066 gdcm::Tag m_tag2;
00067
00068 template<typename T>
00069 void getScanValues(const std::vector<std :: string> i_filenames, const std::string i_stag, std::map<std::string,T> &o_val);
00070
00071
00072
00073 #endif
00074
00075
00076 int tag_begin;
00077
00078
00079 int tag_end;
00080
00081
00082 int tag_step;
00083
00084
00085
00086 OutputModel *m_model;
00087
00088
00089 bool b_db;
00090
00091 std::string m_db;
00092
00093 std::string m_table;
00094
00095 template<typename T>
00096 void getValues(const std::vector<std::string> i_filenames,const std::string i_tag, std::map< std::string, T> &o_val);
00097 template<typename T>
00098 void getDBValues(const std::vector<std::string> i_filenames, const std::string i_stag, std::map<std::string,T> &o_val);
00099
00100 void sort(const std::vector<std::string> i_filenames, std::vector<std::string> &o_sort, int level);
00101
00102 bool checkModel(std::map<std::string, std::string> i_model, const std::string i_val);
00103 #endif
00104 };
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 }
00139 #endif //__creaImageIOoutputModel_h_INCLUDED__