CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
vDynamicModel.hh
Go to the documentation of this file.
1 
9 #ifndef VDYNAMICMODEL_HH
10 #define VDYNAMICMODEL_HH 1
11 
12 #include "gVariables.hh"
14 #include "oOptimizerManager.hh"
15 
16 class oImageSpace;
17 
18 
19 
20 
44 {
45  // -----------------------------------------------------------------------------------------
46  // Constructor & Destructor
47  public:
52  vDynamicModel();
57  virtual ~vDynamicModel();
58 
59 
60  // -----------------------------------------------------------------------------------------
61  // Public member functions related to the initialization of the model
62  public:
68  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
69  {mp_ID = ap_ImageDimensionsAndQuantification;}
75  inline void SetVerbose(int a_verbose)
76  {m_verbose = a_verbose;}
83  virtual int CheckParameters();
90  virtual int CheckSpecificParameters() = 0;
98  virtual int ReadAndCheckConfigurationFile(string a_fileOptions) = 0;
106  virtual int ReadAndCheckOptionsList(string a_listOptions) = 0;
113  virtual int Initialize() = 0;
119  virtual void ShowHelp() = 0;
120 
121 
122  // -----------------------------------------------------------------------------------------
123  // Public member functions called by the main iterative algorithm class
124  public:
135  virtual int EstimateModelParameters(oImageSpace* ap_Image, int a_ite, int a_sset) = 0;
145  virtual int FitModel(oImageSpace* ap_Image, int a_ite, int a_sset) = 0;
154  virtual int SaveParametricImages(int a_ite) = 0;
155 
156 
157  // -----------------------------------------------------------------------------------------
158  // Data members
159  protected:
161  int m_verbose;
163  bool m_checked;
165 };
166 
167 // ----------------------------------------------------------------------
168 // Part of code that manages the auto declaration of children classes
169 // ----------------------------------------------------------------------
170 
171 // Macro for the function that creates the object
172 #define FUNCTION_DYNAMICMODEL(CLASS) \
173  static vDynamicModel *make_dynamic_model() { return new CLASS(); };
174 
175 // Macro for the class that links the appropriate function to the map of objects
176 #define CLASS_DYNAMICMODEL(NAME,CLASS) \
177  class NAME##DynamicModelCreator \
178  { \
179  public: \
180  NAME##DynamicModelCreator() \
181  { sAddonManager::GetInstance()->mp_listOfDynamicModels[#NAME] = CLASS::make_dynamic_model; } \
182  }; \
183  static NAME##DynamicModelCreator DynamicModelCreator##NAME;
184 
185 #endif
virtual int CheckSpecificParameters()=0
This function is used to check the parameters of the child functions before initialization if require...
This header file is mainly used to declare some macro definitions and all includes needed from the st...
Declaration of class oImageDimensionsAndQuantification.
virtual int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the image dimensions in use.
oImageDimensionsAndQuantification * mp_ID
This is the mother class of dynamic model classes.
virtual int ReadAndCheckOptionsList(string a_listOptions)=0
This function is used to read parameters from a string. It is pure virtual so must be implemented b...
virtual void ShowHelp()=0
This function is used to print out specific help about the deformation and its options. It is pure virtual so must be implemented by children.
virtual int Initialize()=0
This function is used to initialize specific data related to the child deformation model...
virtual int FitModel(oImageSpace *ap_Image, int a_ite, int a_sset)=0
This function is pure virtual so must be implemented by children. It is used to fit the dynamic mod...
virtual int ReadAndCheckConfigurationFile(string a_fileOptions)=0
This function is used to read options from a configuration file. It is pure virtual so must be impl...
void SetVerbose(int a_verbose)
Set the verbose level.
virtual ~vDynamicModel()
Destructor of vDynamicModel.
vDynamicModel()
Constructor of vDynamicModel. Simply set all data members to default values.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:41
This class is designed to manage all dimensions and quantification related stuff. ...
Declaration of class oOptimizerManager.
virtual int EstimateModelParameters(oImageSpace *ap_Image, int a_ite, int a_sset)=0
This function is pure virtual so must be implemented by children. It can be used to estimate any te...
virtual int SaveParametricImages(int a_ite)=0
This function is pure virtual so must be implemented by children Call SaveParametricImages() functi...