129 cout <<
"This optimizer is the Penalized Preconditioned Gradient algorithm from J. Nuyts et al, IEEE TNS, Feb 2002, vol. 49, pp. 56-60." << endl;
130 cout <<
"As usually described by its inventor, it is a heuristic but effective gradient ascent algorithm" << endl;
131 cout <<
"for penalized maximum-likelihood reconstruction. It addresses the shortcoming of One-Step-Late when large" << endl;
132 cout <<
"penalty strengths can create numerical problems. Penalty terms must have a derivative order of at least two." << endl;
133 cout <<
"Subsets can be used as for OSEM. Without penalty, it is equivalent to the gradient ascent form of the MLEM algorithm." << endl;
134 cout <<
"Based on likelihood gradient and penalty, a multiplicative update factor is computed and its range is limited by provided parameters." << endl;
135 cout <<
"Thus, negative values cannot occur and voxels cannot be trapped into 0 values, providing a first positive estimate." << endl;
136 cout <<
"The following options can be used (in this particular order when provided as a list):" << endl;
137 cout <<
" initial image value: to set the uniform voxel value for the initial image" << endl;
138 cout <<
" denominator threshold: to set the threshold of the data space denominator under which the ratio is set to 1" << endl;
139 cout <<
" minimum image update: to set the minimum of the image update factor under which it stays constant (0 or a negative value" << endl;
140 cout <<
" means no minimum thus allowing a 0 update)" << endl;
141 cout <<
" maximum image update: to set the maximum of the image update factor over which it stays constant (0 or a negative value means" << endl;
142 cout <<
" no maximum)" << endl;
152 string key_word =
"";
155 key_word =
"initial image value";
158 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
162 key_word =
"denominator threshold";
165 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
169 key_word =
"minimum image update";
172 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
176 key_word =
"maximum image update";
179 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::ReadConfigurationFile() -> Failed to get the '" << key_word <<
"' keyword !" << endl);
194 const int nb_options = 4;
195 FLTNB options[nb_options];
197 if (
ReadStringOption(a_optionsList, options, nb_options,
",",
"PenalizedPreconditionedGradient configuration"))
199 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::ReadOptionsList() -> Failed to correctly read the list of options !" << endl);
221 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML->CheckSpecificParameters() -> Provided initial image value (" <<
m_initialValue <<
") must be strictly positive !" << endl);
227 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML->CheckSpecificParameters() -> Provided data space denominator threshold (" <<
m_dataSpaceDenominatorThreshold <<
") must be strictly positive !" << endl);
290 Cout(
"iOptimizerPenalizedPreconditionedGradientML::InitializeSpecific() -> Use the Penalized Preconditioned Gradient optimizer" << endl);
296 else Cerr(
"!!!!! The minimum update value is not set, if using subsets, voxels could be trapped in 0 value causing some negative bias !" << endl);
319 if (
m_verbose>=1)
Cout(
"iOptimizerPenalizedPreconditionedGradientML::PreImageUpdateSpecificStep() -> Compute penalty term" << endl);
324 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::PreImageUpdateSpecificStep() -> A problem occurred while computing the penalty pre-processing step !" << endl);
338 bool problem =
false;
342 #pragma omp parallel for private(v) schedule(guided) 348 th = omp_get_thread_num();
353 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::PreImageUpdateSpecificStep() -> A problem occurred while computing the penalty local pre-processing step for voxel " << v <<
" !" << endl);
363 Cerr(
"***** iOptimizerPenalizedPreconditionedGradientML::PreImageUpdateSpecificStep() -> A problem occurred inside the multi-threaded loop, stop now !" << endl);
379 FLTNB a_multiplicativeCorrections,
FLTNB a_additiveCorrections,
FLTNB a_blankValue,
394 FLTNB a_multiplicativeCorrections,
FLTNB a_additiveCorrections,
FLTNB a_blankValue,
398 if (a_data<0.) a_data = 0.;
400 FLTNB numerator = a_data - a_forwardModel;
404 else *ap_backwardValues = 0.;
422 FLTNB a_sensitivity,
FLTNB* ap_correctionValues,
423 INTNB a_voxel,
int a_tbf,
int a_rbf,
int a_cbf )
433 FLTNB image_update_factor = 1. + numerator / denominator;
439 *ap_newImageValue = a_currentImageValue * image_update_factor;
441 if (!isfinite(*ap_newImageValue)) *ap_newImageValue = a_currentImageValue;
int m_requiredPenaltyDerivativesOrder
int GetNbCardBasisFunctions()
Get the number of cardiac basis functions.
Declaration of class iOptimizerPenalizedPreconditionedGradient.
bool m_listmodeCompatibility
int ReadOptionsList(const string &a_optionsList)
A function used to read options from a list of options.
void ShowHelpSpecific()
A function used to show help about the child optimizer.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
~iOptimizerPenalizedPreconditionedGradientML()
The destructor of iOptimizerPenalizedPreconditionedGradientML.
virtual int LocalPreProcessingStep(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
A public function computing a local pre-processing step for the penalty.
int GetNbTimeBasisFunctions()
Get the number of time basis functions.
virtual FLTNB ComputeSecondDerivative(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)=0
A public function computing the second derivative of the penalty (the two derivatives are according t...
int CheckSpecificParameters()
A private function used to check the parameters settings specific to the child optimizer.
bool m_emissionCompatibility
iOptimizerPenalizedPreconditionedGradientML()
The constructor of iOptimizerPenalizedPreconditionedGradientML.
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)
This function compute the weight associated to the provided event (for sensitivity computation) ...
virtual int GlobalPreProcessingStep()
A public function computing a global pre-processing step for the penalty.
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...
bool m_histogramCompatibility
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)
This function perform the image update step specific to the optimizer.
FLTNB m_minimumImageUpdateFactor
int ReadConfigurationFile(const string &a_configurationFile)
A function used to read options from a configuration file.
FLTNB **** m4p_firstDerivativePenaltyImage
#define KEYWORD_MANDATORY
FLTNB m_maximumImageUpdateFactor
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...
FLTNB **** m4p_secondDerivativePenaltyImage
FLTNB m_dataSpaceDenominatorThreshold
Declaration of class sOutputManager.
oImageSpace * mp_ImageSpace
int GetNbThreadsForImageComputation()
Get the number of threads used for image operations.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
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)
This function performs the data space operations specific to the optimizer (computes the values to be...
int PreImageUpdateSpecificStep()
A private function used to compute the penalty term of the PreconditionedGradientMAP algorithm...
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.
int GetNbRespBasisFunctions()
Get the number of respiratory basis functions.
virtual FLTNB ComputeFirstDerivative(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)=0
A public function computing the derivative of the penalty.
int InitializeSpecific()
This function is used to initialize specific stuff to the child optimizer.