9 #include "iLinearModel.hh" 119 cout <<
"-- This class implements a general linear dynamic model applied between the images of a dynamic acquisition." << endl;
120 cout <<
"-- The model is applied on a voxel-by-voxel basis between the images of the frames and/or respiratory/cardiac gates. " << endl;
121 cout <<
"-- The main keywords 'DYNAMIC FRAMING', 'RESPIRATORY GATING' and 'CARDIAC GATING' ahead of the parameters allow to define at which level the model parameters must be applied. " << endl;
122 cout <<
"-- Main parameters to define are:" << endl;
123 cout <<
" -> The number of basis functions / parametric images defined in the model" << endl;
124 cout <<
" -> Basis function initial values" << endl;
125 cout <<
" -> Parametric images initialization (optional)" << endl;
126 cout <<
" -> Optimisation_method : x (mandatory) optimization method for voxelwise parameters estimation." << endl;
128 cout <<
" It can be initialized using a configuration text file with the following keywords and information :" << endl;
129 cout <<
" - Mandatory keywords :" << endl;
130 cout <<
" The following keywords are mandatory for at least one dynamic image level (Dynamic frame, Respiratory gating or Cardiac gating) :" << endl;
131 cout <<
" 'Number_basis_functions:' Enter the number of basis function for each image of time frame or respiratory/cardiac gate " << endl;
132 cout <<
" 'Basis_functions:' Enter the basis function (bf) coefficients for each image (im) of time frame or respiratory/cardiac gate " << endl;
133 cout <<
" on successive lines, separated by ',' :" << endl;
134 cout <<
" -> basis_functions: " << endl;
135 cout <<
" -> coeff_bf1_im1,coeff_bf1_im2,...,coeff_bf1_imn" << endl;
136 cout <<
" -> coeff_bf2_im1,coeff_bf2_im2,...,coeff_bf2_imn" << endl;
137 cout <<
" -> etc..." << endl;
138 cout <<
" Optimisation_method : x (mandatory) optimization method available options: " << endl;
139 cout <<
" x=0: Direct ( Implementation of basis functions side by system matrix in each tomographic iterative loop " << endl;
140 cout <<
" (! Currently not compatible with motion correction)" << endl;
141 cout <<
" x=1: Nested EM " << endl;
142 cout <<
" x=2: Iterative non-negative Least-Square " << endl;
143 cout <<
" (C.L. Lawson and R.J. Hanson, Solving Least Squares Problems)" << endl;
145 cout <<
" - Optional keywords :" << endl;
146 cout <<
" 'Parametric_image_init: image_file' Set an image file to initialize the parametric images of each dynamic model. Default initialization: '1.0 for each voxel." << endl;
148 cout <<
" 'Number_weight_values:' Enter the number of weights to be applied for each dynamic frame for performing WLS optimisation (Optimisation method=2) " << endl;
149 cout <<
" 'Weight_values:' Enter the weight values to be applied for each dynamic frame ( within DYNAMIC FRAMING/ENDDF) " << endl;
150 cout <<
" on one single line, separated by ',' " << endl;
151 cout <<
" The previous parameters must be declared inside the couple of the following specific tags: " << endl;
152 cout <<
" - DYNAMIC FRAMING/ENDDF for chronological frame model (dynamic model applied to chronological frames of a dynamic aquisition)" << endl;
153 cout <<
" - RESPIRATORY GATING/ENDRG for respiratory model (dynamic model applied to respiratory gates of a dynamic aquisition)" << endl;
154 cout <<
" - CARDIAC GATING/ENDCG for cardiac model (dynamic model applied to cardiac gates of a dynamic aquisition)" << endl;
155 cout <<
" Different levels of dynamic model can be enabled simultaneously (i.e a dynamic frame model can be used simultaneously with respiratory and/or cardiac gating model) " << endl;
158 cout <<
" The following keywords are optional and common to each dynamic model (Dynamic frame, Respiratory gating or Cardiac gating) :" << endl;
159 cout <<
" 'Number_model_iterations: x' Number of iterations of the model parameters and basis functions updates in one cycle of Nested EM" << endl;
160 cout <<
" (Default x == 1) (one cycle consists in x iterations in which either the parametric images or the basis functions are updated) " << endl;
161 cout <<
" The ratio of parametric images / basis functions updates depends on the following parameter:" << endl;
162 cout <<
" 'Basis_function_update_ratio: x' Ratio of update between parametric images and basis functions updates cycle " << endl;
163 cout <<
" (Default x == 0) Cycles consist in x iterations of the parametric images, following by x iterations of the basis functions" << endl;
164 cout <<
" If x == 0, only the parametric images are updated" << endl;
165 cout <<
" 'Basis_function_start_ite : x' Starting iteration for the update of basis functions " << endl;
166 cout <<
" (Default x == -1) If negative, no update of the basis functions is performed (only parametric images are updated) " << endl;
169 cout <<
" ---------------------------" << endl;
170 cout <<
" Example of initialization: " << endl;
171 cout <<
" DYNAMIC FRAMING" << endl;
172 cout <<
" Number_basis_functions : 2" << endl;
173 cout <<
" Basis_functions :" << endl;
174 cout <<
" 23682.79, 25228.74, 26636.99, 27923.61, 29101.16" << endl;
175 cout <<
" 5.4, 4.91, 4.48, 4.1, 3.75" << endl;
176 cout <<
" ENDDF" << endl;
178 cout <<
" RESPIRATORY GATING" << endl;
179 cout <<
" Number_basis_functions : 6" << endl;
180 cout <<
" Basis_functions :" << endl;
181 cout <<
" 1, 0.8, 0.6, 0.4, 0.2, 0.01" << endl;
182 cout <<
" 0.7, 0.9, 0.7, 0.5, 0.3, 0.1" << endl;
183 cout <<
" 0.4, 0.6, 0.8, 0.6, 0.4, 0.2" << endl;
184 cout <<
" 0.2, 0.4, 0.6, 0.8, 0.6, 0.4" << endl;
185 cout <<
" 0.1, 0.3, 0.5, 0.7, 0.9, 0.7" << endl;
186 cout <<
" 0.01, 0.2, 0.4, 0.6, 0.8, 1" << endl;
187 cout <<
" ENDRG" << endl;
189 cout <<
" Number_model_iterations : 1" << endl;
190 cout <<
" Basis_function_start_ite : -1" << endl;
191 cout <<
" Basis_function_update_ratio : 0" << endl;
192 cout <<
" ---------------------------" << endl;
214 if(
m_verbose >=3)
Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecific ..."<< endl);
219 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecific -> Error while trying to read and check specific configuration " <<
m_fileOptions << endl);
238 if(
m_verbose >=3)
Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels ..."<< endl);
246 bool file_is_good =
false;
248 string line=
"", kword_to_search=
"";
249 while(!in_file.eof())
251 getline(in_file, line);
254 if (line.find(
"#") != string::npos) line = line.substr(0, line.find_first_of(
"#")) ;
256 if (line.find(
"DYNAMIC FRAMING") != string::npos)
258 if(kword_to_search !=
"")
260 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, found an end tag 'END**' before 'DYNAMIC FRAMING' in configuration file: " <<
m_fileOptions << endl);
264 kword_to_search =
"ENDDF";
267 else if (line.find(
"RESPIRATORY GATING") != string::npos)
269 if(kword_to_search !=
"")
271 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, found an end tag 'END**' before 'RESPIRATORY GATING' in configuration file: " <<
m_fileOptions << endl);
275 kword_to_search =
"ENDRG";
278 else if (line.find(
"CARDIAC GATING") != string::npos)
280 if(kword_to_search !=
"")
282 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, found an end tag 'END**' before 'CARDIAC GATING' in configuration file: " <<
m_fileOptions << endl);
286 kword_to_search =
"ENDCG";
289 else if (kword_to_search !=
"" 290 && line.find(kword_to_search) != string::npos)
292 kword_to_search =
"";
299 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error, no mandatory tags ('DYNAMIC FRAMING'/'ENDDF', 'RESPIRATORY GATING'/'ENDRG', 'CARDIAC GATING'/'ENDCG' detected in configuration file: " 306 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
312 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
318 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
324 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_basis_functions' flag in " <<
m_fileOptions << endl);
330 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Number_model_iterations' flag in " <<
m_fileOptions << endl);
336 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Basis_function_start_ite' flag in " <<
m_fileOptions << endl);
342 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Basis_function_update_ratio' flag in " <<
m_fileOptions << endl);
348 Cerr(
"***** ***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read 'Optimisation_method' keyword in " <<
m_fileOptions << endl);
356 Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels() -> Selected optimization method : NNLS (2)" << endl);
358 Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels() -> Selected optimization method : Nested-EM (1)" << endl);
360 Cout(
"iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels() -> Selected optimization method : Direct Dynamic (0)" << endl);
365 Cerr(
"***** iLinearModel::ReadAndCheckConfigurationFileSpecificToAllLinearModels -> Error while trying to read configuration file at: " <<
m_fileOptions << endl);
393 if(
m_verbose >=3)
Cout(
"iLinearModel::ReadAndCheckOptionsList ..."<< endl);
400 Cerr(
"***** iLinearModel::ReadAndCheckOptionsList() -> Initialization with command line options is not implemented for this class. Please use a configuration file instead" << endl);
426 Cerr(
"***** iLinearModel::CheckSpecificParameters -> A problem occurred while checking specific parameters ! " << endl);
450 if(
m_verbose >=2)
Cout(
"iLinearModel::CheckSpecificParametersForAllLinearModels ..."<< endl);
455 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels() -> Error, the variables corresponding to the number of basis function has not been initialized. There might be an error in the configuration process/file !" << endl);
471 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels() -> Error, the number of weight factors doesn't match the number of input frames. There might be an error in the configuration process/file !" << endl);
480 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Either a file or a list of options have to be selected to initialize the model, but not both ! " << endl);
487 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Either a file or a list of options should have been provided at this point ! " << endl);
494 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Optimization method Linear Regression (=3) only available when using two time basis functions ! " << endl);
501 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels -> Optimization method 'Direct' (=0) only available when using castor-recon ! " << endl);
522 if(
m_verbose >=2)
Cout(
"iLinearModel::InitializeSpecificToAllLinearModels ..."<< endl);
527 Cerr(
"***** iLinearModel::InitializeSpecificToAllLinearModels() -> Must call CheckParameters functions before Initialize() !" << endl);
671 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read frame basis functions coefficients !" << endl);
672 Cerr(
" 'Basis_functions' keyword inside DYNAMIC FRAMING / ENDDF paragraph in " <<
m_fileOptions << endl);
684 "RESPIRATORY GATING",
687 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read respiratory gates basis functions coefficients !" << endl);
688 Cerr(
" 'Basis_functions' keyword inside RESPIRATORY GATING / ENDRG paragraph in " <<
m_fileOptions << endl);
703 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read cardiac gates basis functions coefficients !" << endl);
704 Cerr(
" 'Basis_functions' keyword inside CARDIAC GATING / ENDCG paragraph in " <<
m_fileOptions << endl);
710 "Optimisation_method",
715 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read 'Optimisation_method' keyword in " <<
m_fileOptions << endl);
730 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read frame weight factor coefficients !" << endl);
731 Cerr(
" 'Weight_values' keyword inside DYNAMIC FRAMING / ENDDF paragraph in " <<
m_fileOptions << endl);
739 string input_image =
"";
740 int return_value = 0;
743 "Parametric_images_init",
750 if( return_value == 0)
760 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
764 else if( return_value == 1)
766 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read dynamic frame model parametric images !" << endl);
784 "Parametric_images_init",
788 "RESPIRATORY GATING",
791 if( return_value == 0)
801 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
805 else if( return_value == 1)
807 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read respiratory gate model parametric images !" << endl);
826 "Parametric_images_init",
833 if( return_value == 0)
843 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read the provided initialization parametric images : " << input_image << endl);
847 else if( return_value == 1)
849 Cerr(
"***** iLinearModel::Initialize -> Error while trying to read cardiac gate model parametric images !" << endl);
864 Cerr(
"***** iLinearModel::Initialize() -> Error while trying to read configuration file at: " <<
m_fileOptions << endl);
875 Cerr(
"***** iLinearModel::CheckSpecificParametersForAllLinearModels() -> Error, negative weight factors found. Only positive non-zero factors allowed !" << endl);
878 if(
m_verbose >=4)
Cout(
"iLinearModel::NNLS optimisation weight for frame: "<< t <<
" set at "<<
mp_w[t]<< endl);
925 Cout(
"***** iLinearModel::InitializeSpecificToAllLinearModels() -> Time Basis Function coefficients :" << endl);
929 Cout(
"Basis function["<<b+1<<
"] : ");
953 if(
m_verbose >=2)
Cout(
"iLinearModel::InitializeSpecific ..."<< endl);
958 Cerr(
"***** oDynamicModelManager::InitializeSpecific() -> Must call CheckParameters functions before Initialize() !" << endl);
965 Cerr(
"***** iLinearModel::InitializeSpecific() -> Error while performing generic initialisations for linear models !" << endl);
996 Cerr(
"***** iLinearModel::EstimateModelParameters() -> Called while not initialized !" << endl);
1008 Cerr(
"***** iLinearModel::EstimateModelParameters() -> An error occured while using the nested EM parametric image estimation method !" << endl);
1015 Cout(
"iLinearModel::EstimateModelParameters() -> Skipping nested calculation, not required for direct method " << endl);
1023 Cerr(
"***** iLinearModel::EstimateModelParameters() -> An error occured while using the Patlak LS Estimation Method !" << endl);
1032 Cerr(
"***** iLinearModel::EstimateModelParameters() -> An error occured while using the Least-Squares linear regression Estimation Method !" << endl);
1039 Cerr(
"***** iLinearModel::EstimateModelParameters() -> Error : unknown method to estimate images ! !" << endl);
1053 Cout(
"iLinearModel::EstimateModelParameters() -> Frame parametric image["<<fb<<
"] avg value:" << avg << endl);
1074 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() ..." <<endl);
1078 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() cycle "<< it+1 <<
"/" << m_nbLinearModelCycles <<endl);
1084 #pragma omp parallel for private(v) schedule(static, 1) 1134 FLTNB parametric_image_norm = 0;
1138 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Basis Functions - Frame basis functions estimation step" <<endl);
1143 parametric_image_norm = 0;
1169 #pragma omp parallel for private(v) schedule(static, 1) 1178 th = omp_get_thread_num();
1184 * m2p_CGParametricImages[cb][v];
1202 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Basis Functions - Respiratory gate basis functions estimation step" <<endl);
1207 parametric_image_norm = 0;
1232 #pragma omp parallel for private(v) schedule(static, 1) 1241 th = omp_get_thread_num();
1246 * m2p_CGParametricImages[cb][v];
1265 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Basis Functions - Cardiac gate basis functions estimation step" <<endl);
1270 parametric_image_norm = 0;
1295 #pragma omp parallel for private(v) schedule(static, 1) 1304 th = omp_get_thread_num();
1309 * m2p_CGParametricImages[cb][v];
1336 Cout(
"iLinearModel::NestedEM() -> Basis function ["<<rb<<
"] coefficients for resp gate ["<<rg<<
"] :" <<
m2p_respBasisFunctions[rb][rg] << endl);
1340 Cout(
"iLinearModel::NestedEM() -> Basis function ["<<cb<<
"] coefficients for card gate ["<<cg<<
"] :" <<
m2p_cardBasisFunctions[cb][cg] << endl);
1350 FLTNB basis_functions_norm = 0.;
1355 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Coefficients - Frame coeffs estimation step" <<endl);
1363 basis_functions_norm = 0.;
1377 #pragma omp parallel for private(v) schedule(static, 1) 1407 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Coefficients - Respiratory Gate coeffs estimation step" <<endl);
1415 basis_functions_norm = 0.;
1428 #pragma omp parallel for private(v) schedule(static, 1) 1458 if(
m_verbose >=3)
Cout(
"iLinearModel::NestedEM() -> Estimate Coefficients - Cardiac Gate coeffs estimation step" <<endl);
1466 basis_functions_norm = 0.;
1479 #pragma omp parallel for private(v) schedule(static, 1) 1519 Cout(
"iLinearModel::NestedEM() -> Frame parametric image["<<fb<<
"] avg value:" << avg << endl);
1532 Cout(
"iLinearModel::NestedEM() -> Resp gate parametric image["<<rb<<
"] avg value:" << avg << endl);
1545 Cout(
"iLinearModel::NestedEM() -> Card gate parametric image["<<cb<<
"] avg value:" << avg << endl);
1571 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() ..." <<endl);
1576 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Estimate Coefficients - Frame coeffs estimation step" <<endl);
1582 #pragma omp parallel for private(v) schedule(guided) 1591 th = omp_get_thread_num();
1597 FLTNB *p_nnls_zz=NULL;
1607 p_nnls_B[ t ]=ap_ImageS->
m4p_image[ t ][ rg ][ cg ][ v ] *
mp_w[ t ];
1635 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Estimate Coefficients - Respiratory Gate coeffs estimation step" <<endl);
1641 #pragma omp parallel for private(v) schedule(guided) 1650 th = omp_get_thread_num();
1656 FLTNB *p_nnls_zz=NULL;
1666 p_nnls_B[ rg ]=ap_ImageS->
m4p_image[ fr ][ rg ][ cg ][ v ];
1694 if(
m_verbose >=3)
Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Estimate Coefficients - Cardiac Gate coeffs estimation step" <<endl);
1700 #pragma omp parallel for private(v) schedule(guided) 1709 th = omp_get_thread_num();
1715 FLTNB *p_nnls_zz=NULL;
1725 p_nnls_B[ cg ]=ap_ImageS->
m4p_image[ fr ][ rg ][ cg ][ v ];
1762 Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Frame parametric image["<<fb<<
"] avg value:" << avg << endl);
1775 Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Resp gate parametric image["<<rb<<
"] avg value:" << avg << endl);
1788 Cout(
"iLinearModel::EstimateParametersWithNNLS() -> Card gate parametric image["<<cb<<
"] avg value:" << avg << endl);
1810 if(
m_verbose >=3)
Cout(
"iLinearPatlakModel::Patlak_LS ..." <<endl);
1813 #pragma omp parallel for private(v) schedule(guided) 1845 Cov += (Xt-xmean) * (Yt-ymean);
1846 Var += (Xt-xmean) * (Xt-xmean);
1850 K = (Var != 0) ? Cov/Var : 0.;
1856 Vd = ymean - K*xmean;
1883 if(
m_verbose >= 3)
Cout(
"iLinearModel::EstimateImageWithModel ... " <<endl);
1888 Cerr(
"***** iLinearModel::EstimateImageWithModel() -> Called while not initialized !" << endl);
1894 #pragma omp parallel for private(v) schedule(static, 1) 1905 ap_ImageS->
m4p_image[fr][rg][cg][v] = 0.;
#define INTF_LERP_DISABLED
int NNLS(FLTNB **A, int m, int n, FLTNB *B, FLTNB *X, FLTNB *rnorm, FLTNB *wp, FLTNB *zzp, int *indexp)
oImageDimensionsAndQuantification * mp_ID
void ShowHelp()
This function is used to print out general help about dynamic models.
int EstimateImageWithModel(oImageSpace *ap_Image, int a_ite, int a_sset)
FLTNB ** m2p_parametricImages
FLTNB * mp_corrBasisFunctions
FLTNB ** m2p_cardBasisFunctions
This is the mother class of dynamic model classes.
#define OPTIMISATION_METHOD_DR
int InitializeSpecificToAllLinearModels()
This function is used to initialize the parametric images and basis functions for all Linear Models...
bool m_useModelInReconstruction
FLTNB * mp_blackListedvoxelsImage
void ShowHelpModelSpecific()
This function is used to print out specific help about the dynamic model and its options. It is pure virtual so must be implemented by children.
FLTNB ****** m6p_backwardImage
int ReadAndCheckOptionsList(string a_listOptions)
iLinearModel()
Constructor of iLinearModel. Simply set all data members to default values.
void ShowBasisFunctions()
This function is used to print the basis functions.
FLTNB ** m2p_respBasisFunctions
FLTNB ** m2p_nestedModelTimeBasisFunctions
int CheckSpecificParametersForAllLinearModels()
This function is used to check parameters for all Linear Models. .
virtual int ReadAndCheckConfigurationFileSpecific()
This function is used to read options from a configuration file.
int EstimateParametersWithNNLS(oImageSpace *ap_ImageS, int a_ite)
bool m_ModelSpecificBasisFunctionsRequired
#define KEYWORD_MANDATORY
uint32_t m_nbLinearModelCycles
#define OPTIMISATION_METHOD_LS
int InitializeSpecific()
This function is used to initialize the parametric images and basis functions for all Linear Models...
int IntfReadImgDynCoeffFile(const string &a_pathToHeaderFile, FLTNB **a2p_ImgMatrix, oImageDimensionsAndQuantification *ap_ID, int a_nbFbases, int vb, bool a_lerpFlag)
Function dedicated to Interfile image reading for dynamic coefficients images.
int m_basisFunctionsUpdIdx
int GetNbCardGates()
Get the number of cardiac gates.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
int CheckSpecificParameters()
This function is used to check whether all member variables have been correctly initialized or not...
FLTNB * mp_corrBasisCoeffs
int GetNbThreadsForImageComputation()
Get the number of threads used for image operations.
int GetNbTimeFrames()
Get the number of time frames.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
~iLinearModel()
Destructor of iLinearModel.
int Patlak_LS(oImageSpace *ap_ImageS, int a_ite)
FLTNB ** m2p_outputParImages
#define OPTIMISATION_METHOD_NNLS
int GetNbThreadsForProjection()
Get the number of threads used for projections.
#define OPTIMISATION_METHOD_NESTEM
int m_basisFunctionsUpdRatio
int GetNbRespGates()
Get the number of respiratory gates.
int NestedEM(oImageSpace *ap_ImageS, int a_ite)
int m_basisFunctionsUpdStartIte
int ReadDataASCIIFile(const string &a_file, const string &a_keyword, T *ap_return, int a_nbElts, bool a_mandatoryFlag)
Look for "a_nbElts" elts in the "a_file" file matching the "a_keyword" string passed as parameter a...
int ReadAndCheckConfigurationFileSpecificToAllLinearModels()
This function is used to read parameters that are generic for all Linear Models. ...
int EstimateModelParameters(oImageSpace *ap_Image, int a_ite, int a_sset)
FLTNB ** m2p_RGParametricImages
FLTNB ** m2p_CGParametricImages