CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vDynamicModel.hh
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2018 all CASToR contributors listed below:
18 
19  --> current contributors: Thibaut MERLIN, Simon STUTE, Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Mael MILLARDET
20  --> past contributors: Valentin VIELZEUF
21 
22 This is CASToR version 2.0.
23 */
24 
31 #ifndef VDYNAMICMODEL_HH
32 #define VDYNAMICMODEL_HH 1
33 
34 #include "gVariables.hh"
36 #include "oOptimizerManager.hh"
37 
38 class oImageSpace;
39 
63 {
64  // -----------------------------------------------------------------------------------------
65  // Constructor & Destructor
66  public:
71  vDynamicModel();
76  virtual ~vDynamicModel();
77 
78 
79  // -----------------------------------------------------------------------------------------
80  // Public member functions related to the initialization of the model
81  public:
87  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
88  {mp_ID = ap_ImageDimensionsAndQuantification;}
94  inline void SetVerbose(int a_verbose)
95  {m_verbose = a_verbose;}
102  virtual int CheckParameters();
109  virtual int CheckSpecificParameters() = 0;
117  virtual int ReadAndCheckConfigurationFile(string a_fileOptions) = 0;
125  virtual int ReadAndCheckOptionsList(string a_listOptions) = 0;
132  virtual int Initialize() = 0;
138  virtual void ShowHelp() = 0;
139 
140 
141  // -----------------------------------------------------------------------------------------
142  // Public member functions called by the main iterative algorithm class
143  public:
154  virtual int EstimateModelParameters(oImageSpace* ap_Image, int a_ite, int a_sset) = 0;
164  virtual int EstimateImageWithModel(oImageSpace* ap_Image, int a_ite, int a_sset) = 0;
174  virtual int SaveParametricImages(int a_iteration, int a_subset = -1);
185  virtual void ComputeOutputParImage();
186 
187  // -----------------------------------------------------------------------------------------
188  // Data members
189  protected:
191  int m_verbose;
193  bool m_checked;
196  uint16_t m_nbModelParam;
214 };
215 
216 // ----------------------------------------------------------------------
217 // Part of code that manages the auto declaration of children classes
218 // ----------------------------------------------------------------------
219 
220 // Macro for the function that creates the object
221 #define FUNCTION_DYNAMICMODEL(CLASS) \
222  static vDynamicModel *make_dynamic_model() { return new CLASS(); };
223 
224 // Macro for the class that links the appropriate function to the map of objects
225 #define CLASS_DYNAMICMODEL(NAME,CLASS) \
226  class NAME##DynamicModelCreator \
227  { \
228  public: \
229  NAME##DynamicModelCreator() \
230  { sAddonManager::GetInstance()->mp_listOfDynamicModels[#NAME] = CLASS::make_dynamic_model; } \
231  }; \
232  static NAME##DynamicModelCreator DynamicModelCreator##NAME;
233 
234 #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...
FLTNB ** m2p_modelTACs
#define FLTNB
Definition: gVariables.hh:81
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 ApplyOutputFOVMaskingOnParametricImages()
Mask the outside of the transaxial FOV based on the m_fovOutPercent.
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...
uint16_t m_nbModelParam
FLTNB ** m2p_outputParImages
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.
FLTNB ** m2p_parametricImages
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:61
This class is designed to manage all dimensions and quantification related stuff. ...
virtual int EstimateImageWithModel(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...
Declaration of class oOptimizerManager.
virtual void ComputeOutputParImage()
Compute output image using the m2p_parametricImages matrix Store the result in the m2p_outputParImage...
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_iteration, int a_subset=-1)
This function is pure virtual so must be implemented by children Call SaveParametricImages() functi...