8 #include "oDynamicModelManager.hh" 9 #include "sAddonManager.hh" 72 if (
m_verbose>=2)
Cout(
"oDynamicModelManager::CheckParameters() ..."<< endl);
77 Cerr(
"***** oDynamicModelManager::CheckParameters() -> No image dimensions provided !" << endl);
89 Cerr(
"***** oDynamicModelManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
113 Cerr(
"***** oDynamicModelManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
135 if (
m_verbose>=1)
Cout(
"oDynamicModelManager::Initialize() -> Initialize models" << endl);
140 Cerr(
"***** oDynamicModelManager::Initialize() -> A problem occurred while parsing model options and initializing them !" << endl);
167 #ifdef CASTOR_VERBOSE 168 if (
m_verbose>=3)
Cout(
"oDynamicModelManager::ParseOptionsAndInitializeModel ..."<< endl);
171 string dynamic_model =
"";
172 string list_options =
"";
173 string file_options =
"";
192 Cerr(
"***** oDynamicModelManager::CheckParameters() -> Dynamic model should be used with more than one time frame/dynamic gate !" << endl);
204 if (colon!=string::npos)
207 dynamic_model =
m_options.substr(0,colon);
209 file_options =
m_options.substr(colon+1);
214 else if (comma!=string::npos)
217 dynamic_model =
m_options.substr(0,comma);
219 list_options =
m_options.substr(comma+1);
238 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> Model '" << dynamic_model <<
"' does not exist !" << endl);
247 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while reading and checking frame dynamic model's configuration file !" << endl);
253 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while parsing and reading frame dynamic model's options !" << endl);
261 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while checking frame dynamic model parameters !" << endl);
267 Cerr(
"***** oDynamicModelManager::ParseOptionsAndInitializeModel() -> A problem occurred while initializing frame dynamic model !" << endl);
274 if(
m_verbose>=2)
Cout(
"oDynamicModelManager:: Setting Diagonal basis functions for the tomographic update "<< endl);
283 if(
m_verbose>=2)
Cout(
"oDynamicModelManager:: Seting model specific Time basis functions "<< endl);
318 Cerr(
"***** oDynamicModelManager::ApplyDynamicModel() -> Called while not initialized !" << endl);
326 if(
m_verbose>=2)
Cout(
"oDynamicModelManager::ApplyDynamicModel ..."<< endl);
331 Cerr(
"***** oDynamicModelManager::StepPostProcessInsideSubsetLoop() -> A problem occurred while applying dynamic model to current estimate images !" << endl);
338 Cerr(
"***** oDynamicModelManager::StepPostProcessInsideSubsetLoop() -> A problem occurred while applying dynamic model to current estimate images !" << endl);
363 if(
m_verbose>=2)
Cout(
"oDynamicModelManager::SaveParametricImages ..."<< endl);
371 Cerr(
"***** oDynamicModelManager::SaveParametricImages() -> A problem occurred while trying to apply FOV masking on parametric images !" << endl);
378 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.
void SetVerbose(int a_verbose)
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()
int ReadAndCheckConfigurationFile(string a_fileOptions)
std::map< string, maker_dynamic_model > mp_listOfDynamicModels
This is the mother class of dynamic model classes.
oImageDimensionsAndQuantification * mp_ID
virtual int ApplyOutputFOVMaskingOnParametricImages()
Mask the outside of the transaxial FOV based on the m_fovOutPercent.
FLTNB ** m2p_cardBasisFunctions
void SetTimeBasisFunctions(FLTNB **a_m2pTimeBasisFunctions)
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...
vDynamicModel * mp_DynamicModel
void SetNbRespBasisFunctions(int a_nbRespBasisFunctions)
void SetTimeStaticFlag(bool a_flag)
static sAddonManager * GetInstance()
void SetRespBasisFunctions(FLTNB **a_m2pRespBasisFunctions)
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)
void SetCardStaticFlag(bool a_flag)
int m_nbRespBasisFunctions
int m_nbTimeBasisFunctions
void SetCardBasisFunctions(FLTNB **a_m2pCardBasisFunctions)
void SetNbCardBasisFunctions(int a_nbCardBasisFunctions)
void SetUseModelInReconstruction(bool a_useModelInReconstruction)
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
int SaveParametricImages(int a_iteration, int a_subset=-1)
int Initialize()
A public function used to initialize the dynamic model.
virtual int ReadAndCheckOptionsList(string a_listOptions)=0
int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
void SetRespStaticFlag(bool a_flag)
bool m_useModelInReconstruction
int SetDiagonalRespBasisFunctions()
Set diagonal Respiratory Basis Functions for regular gated reconstruction.
int GetNbCardGates()
Get the number of cardiac gates.
FLTNB ** GetTimeBasisFunctions()
This class holds all the matrices in the image domain that can be used in the algorithm: image...
int GetNbTimeFrames()
Get the number of time frames.
int GetNbRespGates()
Get the number of respiratory gates.
void SetNbTimeBasisFunctions(int a_nbTimeBasisFunctions)
virtual void ComputeOutputParImage()
Compute output image using the m2p_parametricImages matrix Store the result in the m2p_outputParImage...
~oDynamicModelManager()
Destructor of oDynamicModelManager. Free memory from all allocated tabs.
FLTNB ** m2p_respBasisFunctions
int SetDiagonalTimeBasisFunctions()
Set diagonal Time Basis Functions for regular frame-by-frame reconstruction.
int SaveParametricImages(int a_iteration, int a_subset=-1)
int m_nbCardBasisFunctions
int ApplyDynamicModel(oImageSpace *ap_ImageS, int a_iteration, int a_subset)
FLTNB ** m2p_timeBasisFunctions