8 #include "iOptimizerMLTR.hh" 9 #include "sOutputManager.hh" 67 cout <<
"This optimizer is a version of the MLTR algorithm implemented from equation 16 of the paper from K. Van Slambrouck and J. Nuyts:" << endl;
68 cout <<
"\"Reconstruction scheme for accelerated maximum lihelihood reconstruction: the patchwork structure\"," << endl;
69 cout <<
"IEEE Trans. Nucl. Sci., vol. 61, pp. 173-81, 2014." << endl;
70 cout <<
"An additional empiric relaxation factor has been added onto the additive update. Its value onto the first and last updates" << endl;
71 cout <<
"can be parameterized. Its value for all updates in between is computed linearly from these first and last provided values." << endl;
72 cout <<
"The design parameter 'alpha' is not used here." << endl;
73 cout <<
"Subsets can be used." << endl;
74 cout <<
"The following options can be used (in this particular order when provided as a list):" << endl;
75 cout <<
" initial image value: to set the uniform voxel value for the initial image" << endl;
77 cout <<
" initial relaxation factor: to set the empiric multiplicative factor on the additive update used at the first update" << endl;
78 cout <<
" final relaxation factor: to set the empiric multiplicative factor on the additive update used at the last update" << endl;
79 cout <<
" non-negativity constraint: 0 if no constraint or 1 in order to apply the constraint during the image update" << endl;
91 key_word =
"initial image value";
94 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
107 key_word =
"initial relaxation factor";
110 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
114 key_word =
"final relaxation factor";
117 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
121 key_word =
"non-negativity constraint";
124 Cerr(
"***** iOptimizerMLTR::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
139 const int nb_options = 4;
140 FLTNB options[nb_options];
142 if (
ReadStringOption(a_optionsList, options, nb_options,
",",
"MLTR configuration"))
144 Cerr(
"***** iOptimizerMLTR::ReadOptionsList() -> Failed to correctly read the list of options !" << endl);
176 Cerr(
"***** iOptimizerMLTR->CheckSpecificParameters() -> Provided initial relaxation factor (" <<
m_initialRelaxationFactor <<
") must be positive !" << endl);
181 Cerr(
"***** iOptimizerMLTR->CheckSpecificParameters() -> Provided final relaxation factor (" <<
m_finalRelaxationFactor <<
") must be positive !" << endl);
198 Cout(
"iOptimizerMLTR::InitializeSpecific() -> Use the MLTR optimizer" << endl);
292 Cerr(
"***** iOptimizerMLTR::PreImageUpdateSpecificStep() -> Initial and final relaxation differ while there is only one update to do !" << endl);
300 int total_number_of_updates_minus_one = -1;
303 int current_update_index = 0;
307 FLTNB ratio_of_updates = ((
FLTNB)current_update_index) / ((
FLTNB)total_number_of_updates_minus_one);
325 FLTNB a_multiplicativeCorrections,
FLTNB a_additiveCorrections,
FLTNB a_blankValue,
341 FLTNB a_multiplicativeCorrections,
FLTNB a_additiveCorrections,
FLTNB a_blankValue,
345 if (a_data<0.) a_data = 0.;
347 *ap_backwardValues = a_forwardModel - a_data;
358 FLTNB a_sensitivity,
FLTNB* ap_correctionValues,
359 INTNB a_voxel,
int a_tbf,
int a_rbf,
int a_cbf )
365 *ap_newImageValue = a_currentImageValue + image_update_factor;
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &sep, const string &a_option)
Parse the 'a_input' string corresponding to the 'a_option' into 'a_nbElts' elements, using the 'sep' separator. The results are returned in the templated 'ap_return' dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.
~iOptimizerMLTR()
The destructor of iOptimizerMLTR.
bool m_listmodeCompatibility
FLTNB m_initialRelaxationFactor
void ShowHelpSpecific()
A function used to show help about the child optimizer.
FLTNB ForwardProject(oProjectionLine *ap_Line, FLTNB *ap_image=NULL)
int DataSpaceSpecificOperations(FLTNB a_data, FLTNB a_forwardModel, FLTNB *ap_backwardValues, FLTNB a_multiplicativeCorrections, FLTNB a_additiveCorrections, FLTNB a_blankValue, FLTNB a_quantificationFactor, oProjectionLine *ap_Line)
FLTNB m_currentRelaxationFactor
bool m_emissionCompatibility
iOptimizerMLTR()
The constructor of iOptimizerMLTR.
int CheckSpecificParameters()
A private function used to check the parameters settings specific to the child optimizer.
int ReadOptionsList(const string &a_optionsList)
bool m_histogramCompatibility
int InitializeSpecific()
This function is used to initialize specific stuff to the child optimizer.
#define KEYWORD_MANDATORY
bool m_transmissionCompatibility
This class is designed to generically described any iterative optimizer.
This class is designed to manage and store system matrix elements associated to a vEvent...
bool m_nonNegativityConstraint
FLTNB m_finalRelaxationFactor
int ImageSpaceSpecificOperations(FLTNB a_currentImageValue, FLTNB *ap_newImageValue, FLTNB a_sensitivity, FLTNB *ap_correctionValues, INTNB a_voxel, int a_tbf=-1, int a_rbf=-1, int a_cbf=-1)
int PreImageUpdateSpecificStep()
This function is overloaded from the vOptimizer that does nothing by default.
int ReadConfigurationFile(const string &a_configurationFile)
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 SensitivitySpecificOperations(FLTNB a_data, FLTNB a_forwardModel, FLTNB *ap_weight, FLTNB a_multiplicativeCorrections, FLTNB a_additiveCorrections, FLTNB a_blankValue, FLTNB a_quantificationFactor, oProjectionLine *ap_Line)