93 if (
m_verbose>=2)
Cout(
"oDynamicModelManager::CheckParameters() ..."<< endl);
98 Cerr(
"***** oDynamicModelManager::CheckParameters() -> No image dimensions provided !" << endl);
110 Cerr(
"***** oDynamicModelManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
134 Cerr(
"***** oDynamicModelManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
156 if (
m_verbose>=1)
Cout(
"oDynamicModelManager::Initialize() -> Initialize models" << endl);
161 Cerr(
"***** oDynamicModelManager::Initialize() -> A problem occurred while parsing model options and initializing them !" << endl);
188 #ifdef CASTOR_VERBOSE 189 if (
m_verbose>=3)
Cout(
"oDynamicModelManager::ParseOptionsAndInitializeModel ..."<< endl);
192 string dynamic_model =
"";
193 string list_options =
"";
194 string file_options =
"";
213 Cerr(
"***** oDynamicModelManager::CheckParameters() -> Dynamic model should be used with more than one time frame/dynamic gate !" << endl);
225 if (colon!=string::npos)
228 dynamic_model =
m_options.substr(0,colon);
230 file_options =
m_options.substr(colon+1);
235 else if (comma!=string::npos)
238 dynamic_model =
m_options.substr(0,comma);
240 list_options =
m_options.substr(comma+1);
259 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> Model '" << dynamic_model <<
"' does not exist !" << endl);
268 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while reading and checking frame dynamic model's configuration file !" << endl);
274 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while parsing and reading frame dynamic model's options !" << endl);
280 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while checking frame dynamic model parameters !" << endl);
286 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while initializing frame dynamic model !" << endl);
293 if(
m_verbose>=2)
Cout(
"oDynamicModelManager:: Setting Diagonal basis functions for the tomographic update "<< endl);
302 if(
m_verbose>=2)
Cout(
"oDynamicModelManager:: Seting model specific Time basis functions "<< endl);
337 Cerr(
"***** oDynamicModelManager::ApplyDynamicModel() -> Called while not initialized !" << endl);
345 if(
m_verbose>=2)
Cout(
"oDynamicModelManager::ApplyDynamicModel ..."<< endl);
350 Cerr(
"***** oDynamicModelManager::StepPostProcessInsideSubsetLoop() -> A problem occurred while applying dynamic model to current estimate images !" << endl);
357 Cerr(
"***** oDynamicModelManager::StepPostProcessInsideSubsetLoop() -> A problem occurred while applying dynamic model to current estimate images !" << endl);
382 if(
m_verbose>=2)
Cout(
"oDynamicModelManager::SaveParametricImages ..."<< endl);
390 Cerr(
"***** oDynamicModelManager::SaveParametricImages() -> A problem occurred while trying to apply FOV masking on parametric images !" << endl);
397 Cerr(
"***** oDynamicModelManager::SaveParametricImages() -> A problem occurred while trying to save image coefficients !" << endl);
bool GetModelBasisFunctionsRequiredFlag()
int SetDiagonalCardBasisFunctions()
Set diagonal Cardiac Basis Functions for regular gated reconstruction.
Declaration of class oDynamicModelManager.
virtual int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
void ShowHelpDynamicModel()
Show help about all implemented dynamic models.
int GetNbTimeBasisFunctions()
void SetNbTimeBasisFunctions(int a_nbTimeBasisFunctions)
Set the number of time basis functions.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the image dimensions in use.
int ReadAndCheckConfigurationFile(string a_fileOptions)
This function is used to read options from a configuration file. It looks for the parameters implem...
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...
oDynamicModelManager()
Constructor of oDynamicModelManager. Simply set all data members to default values.
int Initialize()
Set the dynamic model flag and instanciate/initialize model objects through the ParseOptionsAndInitia...
static sAddonManager * GetInstance()
void SetNbRespBasisFunctions(int a_nbRespBasisFunctions)
Set the number of respiratory basis functions.
FLTNB ** m2p_cardBasisFunctions
virtual int EstimateImage(oImageSpace *ap_Image, int a_ite, int a_sset)
int ParseOptionsAndInitializeModel()
Parse dynamic model options contained in the previously provided strings. This function is called ins...
virtual int EstimateModel(oImageSpace *ap_Image, int a_ite, int a_sset)
This function checks if the EstimateModelParameters() function (specific to each model) must be calle...
int m_nbRespBasisFunctions
void SetCardStaticFlag(bool a_flag)
Set the Cardiac Static Flag.
int m_nbTimeBasisFunctions
void SetCardBasisFunctions(FLTNB **a_m2pCardBasisFunctions)
int SaveParametricImages(int a_iteration, int a_subset=-1)
Call SaveParametricImages() function of the dynamic model object is 'm_UseModel' is on...
oImageDimensionsAndQuantification * mp_ID
int Initialize()
A public function used to initialize the dynamic model.
void SetRespStaticFlag(bool a_flag)
Set the Respiratory Static Flag.
void SetVerbose(int a_verbose)
Set the verbose level.
vDynamicModel * mp_DynamicModel
int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
FLTNB ** m2p_timeBasisFunctions
int SetDiagonalRespBasisFunctions()
Set diagonal Respiratory Basis Functions for regular gated reconstruction.
int GetNbCardGates()
Get the number of cardiac gates.
FLTNB ** GetTimeBasisFunctions()
std::map< string, maker_dynamic_model > mp_listOfDynamicModels
This class holds all the matrices in the image domain that can be used in the algorithm: image...
void SetTimeBasisFunctions(FLTNB **a_m2pTimeBasisFunctions)
Set the basis functions array, calculated by the DynamicModelManager or the DynamicModel.
int GetNbTimeFrames()
Get the number of time frames.
void SetNbCardBasisFunctions(int a_nbCardBasisFunctions)
Set the number of cardiac basis functions.
int GetNbRespGates()
Get the number of respiratory gates.
virtual void ComputeOutputParImage()
Compute output image using the m2p_parametricImages matrix Store the result in the m2p_outputParImage...
FLTNB ** m2p_respBasisFunctions
~oDynamicModelManager()
Destructor of oDynamicModelManager. Free memory from all allocated tabs.
void SetRespBasisFunctions(FLTNB **a_m2pRespBasisFunctions)
Set the basis functions array, calculated by the DynamicModelManager or the DynamicModel.
int SetDiagonalTimeBasisFunctions()
Set diagonal Time Basis Functions for regular frame-by-frame reconstruction.
int SaveParametricImages(int a_iteration, int a_subset=-1)
This function is virtual it can be overloaded by children if required.
int m_nbCardBasisFunctions
int ApplyDynamicModel(oImageSpace *ap_ImageS, int a_iteration, int a_subset)
Declaration of class sAddonManager.
void SetTimeStaticFlag(bool a_flag)
Set the Time Static Flag - to be used with Time Basis functions for direct dynamic reconstruction...