CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
i1TCModel.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-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
31 #ifndef I1TCMODEL_HH
32 #define I1TCMODEL_HH 1
33 
34 
43 #define METHOD_1CPT_NNLS 0
44 
45 #define METHOD_1CPT_LS 1
46 
47 #define METHOD_1CPT_BF 2
48 
59 #define METHOD_INT_WPO 0
60 
61 #define METHOD_INT_TRAP 1
62 
65 #include "vDynamicModel.hh"
66 #include "sAddonManager.hh"
67 
68 
73 class i1TCModel : public vDynamicModel
74 {
75  // -----------------------------------------------------------------------------------------
76  // Constructor & Destructor
77  public:
82  i1TCModel();
87  ~i1TCModel();
88 
89 
90  // -----------------------------------------------------------------------------------------
91  // Public member functions related to the initialization of the model
92  public:
93  // Function for automatic insertion (put the class name as the parameters and do not add semi-colon at the end of the line)
114  int ReadAndCheckOptionsList(string a_listOptions);
121  int InitializeSpecific();
127  void ShowHelp();
128 
129 
130  // -------------------------------------------------------------------
131  // Public member functions called by the main iterative algorithm class
140  int EstimateModelParameters(oImageSpace* ap_Image, int a_ite, int a_sset);
141 
150  int EstimateImageWithModel(oImageSpace* ap_Image, int a_ite, int a_sset);
151 
152 
153  // -------------------------------------------------------------------
154  // Private member functions
155  private:
163 
171 
179 
203  int RRLS(uint16_t a_nP,
204  uint16_t a_nT,
205  FLTNB **a2p_model,
206  FLTNB *ap_data,
207  FLTNB *ap_w,
208  FLTNB *ap_result
209  );
210 
230  int LS(uint16_t a_nP,
231  uint16_t a_nT,
232  FLTNB **a2p_model,
233  FLTNB *ap_data,
234  FLTNB *ap_w,
235  FLTNB *ap_result
236  );
237 
238 
249  FLTNB WPOinc(uint32_t a_time, FLTNB tac, FLTNB b_tac, FLTNB bb_tac, FLTNB n_tac);
250 
259  int IntegrateTAC(FLTNB* ap_tac, FLTNB* ap_citac, int a_th);
260 
269  int WPO(FLTNB* ap_tac, FLTNB* ap_citac, int a_th);
277  int Trapz(FLTNB* ap_tac, FLTNB* ap_citac);
278 
279 
280 
281  // -----------------------------------------------------------------------------------------
282  // Data members
283  protected:
293  uint16_t m_nnlsN=3;
301  // WPO
309  // Least-Square matrices for LS estimation
318  // Least-Square with Ridge Regression variables
324 };
325 
326 
327 
328 
329 // Class for automatic insertion (set here the visible dynamic model's name, put the class name as the parameters and do not add semi-colon at the end of the line)
331 
332 #endif
oMatrix ** mp_RRnum
Definition: i1TCModel.hh:321
FLTNB * mp_wpoQ
Definition: i1TCModel.hh:302
FLTNB ** m2p_wpoBD
Definition: i1TCModel.hh:306
int CheckSpecificParameters()
This function is used to check whether all member variables have been correctly initialized or not...
Definition: i1TCModel.cc:455
FLTNB * mp_parLowerBounds
Definition: i1TCModel.hh:296
#define FLTNB
Definition: gVariables.hh:81
oMatrix ** mp_LSden
Definition: i1TCModel.hh:315
oMatrix * mp_RRm
Definition: i1TCModel.hh:319
oMatrix ** mp_XtX
Definition: i1TCModel.hh:313
i1TCModel()
Constructor of i1TCModel. Simply set all data members to default values.
Definition: i1TCModel.cc:51
oMatrix ** mp_Y
Definition: i1TCModel.hh:310
int InitializeSpecific()
This function is used to initialize parametric images and basis functions.
Definition: i1TCModel.cc:518
bool m_ridgeRegressionFlag
Definition: i1TCModel.hh:298
This class implements a 1 compartiment model, to model kinetics of radiotracers such as radiowater...
Definition: i1TCModel.hh:73
FLTNB m_RRcst
Definition: i1TCModel.hh:297
This is the mother class of dynamic model classes.
~i1TCModel()
Destructor of i1TCModel.
Definition: i1TCModel.cc:110
oMatrix ** mp_LSnum
Definition: i1TCModel.hh:314
int Trapz(FLTNB *ap_tac, FLTNB *ap_citac)
return integral for each time point t (WPO_S), and cumulative integral (cumWPO_S ) ...
Definition: i1TCModel.cc:1990
FLTNB * mp_DT2
Definition: i1TCModel.hh:300
FLTNB * mp_wpoA
Definition: i1TCModel.hh:303
#define FUNCTION_DYNAMICMODEL(CLASS)
FLTNB * mp_w
Definition: i1TCModel.hh:289
FLTNB ** m2p_nnlsMat
Definition: i1TCModel.hh:292
int EstimateModelParametersWithBF(oImageSpace *ap_ImageS)
Estimate K1, k2, Va parametric images using basis functions approach.
Definition: i1TCModel.cc:1181
int RRLS(uint16_t a_nP, uint16_t a_nT, FLTNB **a2p_model, FLTNB *ap_data, FLTNB *ap_w, FLTNB *ap_result)
Non-linear least square estimator with Ridge-Regression.
Definition: i1TCModel.cc:1376
oMatrix ** mp_Xt
Definition: i1TCModel.hh:312
FLTNB ** m2p_ct
Definition: i1TCModel.hh:287
int WPO(FLTNB *ap_tac, FLTNB *ap_citac, int a_th)
return integral for each time point t (WPO_S), and cumulative integral (cumWPO_S ) ...
Definition: i1TCModel.cc:1920
bool m_savePImgFlag
Definition: i1TCModel.hh:284
FLTNB * mp_parUpperBounds
Definition: i1TCModel.hh:295
int ReadAndCheckOptionsList(string a_listOptions)
This function is used to read parameters from a string.
Definition: i1TCModel.cc:430
int EstimateModelParameters(oImageSpace *ap_Image, int a_ite, int a_sset)
Estimate K1, k2, Va parametric images.
Definition: i1TCModel.cc:898
int ReadAndCheckConfigurationFileSpecific()
This function is used to read options from a configuration file.
Definition: i1TCModel.cc:316
int EstimateImageWithModel(oImageSpace *ap_Image, int a_ite, int a_sset)
Estimate image using model parametric images and basis functions.
Definition: i1TCModel.cc:1737
FLTNB ** m2p_nnlsB
Definition: i1TCModel.hh:291
void ShowHelp()
Print out specific help about the implementation of the model model and its initialization.
Definition: i1TCModel.cc:201
oMatrix ** mp_Theta
Definition: i1TCModel.hh:316
int EstimateModelParametersWithLS(oImageSpace *ap_ImageS)
Estimate K1, k2, Va parametric images using LS.
Definition: i1TCModel.cc:1216
uint16_t m_nnlsN
Definition: i1TCModel.hh:293
FLTNB ** m2p_wpoFD
Definition: i1TCModel.hh:305
FLTNB * mp_VaImage
Definition: i1TCModel.hh:323
FLTNB ** m2p_wpoP
Definition: i1TCModel.hh:304
#define CLASS_DYNAMICMODEL(NAME, CLASS)
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:60
int m_OptimisationMethodFlag
Definition: i1TCModel.hh:285
oMatrix * mp_RRw
Definition: i1TCModel.hh:320
oMatrix ** mp_X
Definition: i1TCModel.hh:311
Structure designed for basic matrices operations.
Definition: oMatrix.hh:41
bool m_intMethodFlag
Definition: i1TCModel.hh:307
int EstimateModelParametersWithNNLS(oImageSpace *ap_ImageS)
Estimate K1, k2, Va parametric images using NNLS.
Definition: i1TCModel.cc:1002
Declaration of class vDynamicModel.
int LS(uint16_t a_nP, uint16_t a_nT, FLTNB **a2p_model, FLTNB *ap_data, FLTNB *ap_w, FLTNB *ap_result)
Non-linear least square estimator.
Definition: i1TCModel.cc:1578
FLTNB WPOinc(uint32_t a_time, FLTNB tac, FLTNB b_tac, FLTNB bb_tac, FLTNB n_tac)
Estimate the next integration value for a specific time point of a tac using WPO. ...
Definition: i1TCModel.cc:1846
FLTNB *** m3p_nnlsA
Definition: i1TCModel.hh:290
FLTNB ** m2p_cti
Definition: i1TCModel.hh:288
Declaration of class sAddonManager.
int IntegrateTAC(FLTNB *ap_tac, FLTNB *ap_citac, int a_th)
Call one of the TAC integration method.
Definition: i1TCModel.cc:1898