![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00009 #ifndef VDYNAMICMODEL_HH 00010 #define VDYNAMICMODEL_HH 1 00011 00012 #include "gVariables.hh" 00013 #include "oImageDimensionsAndQuantification.hh" 00014 #include "oOptimizerManager.hh" 00015 00016 class oImageSpace; 00017 00018 00019 00020 00043 class vDynamicModel 00044 { 00045 // ----------------------------------------------------------------------------------------- 00046 // Constructor & Destructor 00047 public: 00052 vDynamicModel(); 00057 virtual ~vDynamicModel(); 00058 00059 00060 // ----------------------------------------------------------------------------------------- 00061 // Public member functions related to the initialization of the model 00062 public: 00068 inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification) 00069 {mp_ID = ap_ImageDimensionsAndQuantification;} 00075 inline void SetVerbose(int a_verbose) 00076 {m_verbose = a_verbose;} 00083 virtual int CheckParameters(); 00090 virtual int CheckSpecificParameters() = 0; 00098 virtual int ReadAndCheckConfigurationFile(string a_fileOptions) = 0; 00106 virtual int ReadAndCheckOptionsList(string a_listOptions) = 0; 00113 virtual int Initialize() = 0; 00119 virtual void ShowHelp() = 0; 00120 00121 00122 // ----------------------------------------------------------------------------------------- 00123 // Public member functions called by the main iterative algorithm class 00124 public: 00135 virtual int EstimateModelParameters(oImageSpace* ap_Image, int a_ite, int a_sset) = 0; 00145 virtual int FitModel(oImageSpace* ap_Image, int a_ite, int a_sset) = 0; 00154 virtual int SaveParametricImages(int a_ite) = 0; 00155 00156 00157 // ----------------------------------------------------------------------------------------- 00158 // Data members 00159 protected: 00160 oImageDimensionsAndQuantification* mp_ID; 00161 int m_verbose; 00162 int m_nbTimeBF; 00163 bool m_checked; 00164 bool m_initialized; 00165 }; 00166 00167 // ---------------------------------------------------------------------- 00168 // Part of code that manages the auto declaration of children classes 00169 // ---------------------------------------------------------------------- 00170 00171 // Macro for the function that creates the object 00172 #define FUNCTION_DYNAMICMODEL(CLASS) \ 00173 static vDynamicModel *make_dynamic_model() { return new CLASS(); }; 00174 00175 // Macro for the class that links the appropriate function to the map of objects 00176 #define CLASS_DYNAMICMODEL(NAME,CLASS) \ 00177 class NAME##DynamicModelCreator \ 00178 { \ 00179 public: \ 00180 NAME##DynamicModelCreator() \ 00181 { sAddonManager::GetInstance()->mp_listOfDynamicModels[#NAME] = CLASS::make_dynamic_model; } \ 00182 }; \ 00183 static NAME##DynamicModelCreator DynamicModelCreator##NAME; 00184 00185 #endif