![]() |
CASToR
3.2
Tomographic Reconstruction (PET/SPECT/CT)
|
This class implements the A-Preconditioned Gradient MAP algorithm. More...
#include <iOptimizerAPPGML.hh>
Public Member Functions | |
iOptimizerAPPGML () | |
The constructor of iOptimizerAPPGML. More... | |
~iOptimizerAPPGML () | |
The destructor of iOptimizerAPPGML. More... | |
int | ReadConfigurationFile (const string &a_configurationFile) |
A function used to read options from a configuration file. More... | |
int | ReadOptionsList (const string &a_optionsList) |
A function used to read options from a list of options. More... | |
![]() | |
vOptimizer () | |
The constructor of vOptimizer. More... | |
virtual | ~vOptimizer () |
The destructor of vOptimizer. More... | |
void | ShowHelp () |
A function used to show help about the optimizer. More... | |
int | CheckParameters () |
A public function used to check the parameters settings. More... | |
int | Initialize () |
A public function used to initialize the optimizer. More... | |
int | UpdateVisitedVoxels () |
A public function used to update the 'visited' voxels after each subset. More... | |
int | PreDataUpdateStep () |
A public function used to do stuff that need to be done at the beginning of a subset (before the data update step; i.e. the loop over all events) More... | |
int | PreImageUpdateStep () |
A public function used to do stuff that need to be done between the loop over events and the image update step. More... | |
virtual int | DataStep1ForwardProjectModel (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep2Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep3BackwardProjectSensitivity (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep4Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep5ComputeCorrections (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep6Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep7BackwardProjectCorrections (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep8ComputeFOM (oProjectionLine *ap_Line, vEvent *ap_Event, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | ImageUpdateStep () |
A public function used to perform the image update step of the optimizer. More... | |
void | SetVerbose (int a_verbose) |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification) |
void | SetImageSpace (oImageSpace *ap_ImageSpace) |
void | SetNbTOFBins (int a_nbTOFBins) |
void | SetDataMode (int a_dataMode) |
void | SetDataType (int a_dataType) |
void | SetDataSpec (int a_dataSpec) |
void | SetAttenuationImage (FLTNB *ap_attenuationImage, int a_thread) |
void | SetFOMFlag (bool a_optimizerFOMFlag) |
void | SetImageStatFlag (bool a_optimizerImageStatFlag) |
void | SetNumbersOfIterationsAndSubsets (int a_nbIterations, int *ap_nbSubsets) |
void | SetCurrentIteration (int a_currentIteration) |
void | SetCurrentSubset (int a_currentSubset) |
int | GetNbBackwardImages () |
Get the number of backward images used by the specific optimizer. More... | |
FLTNB | GetInitialValue () |
Get the initial image value (for initialization) More... | |
void | SetOptimizerID (const string &a_optimizerID) |
const string & | GetOptimizerID () |
int | GetRequiredPenaltyDerivativesOrder () |
Get the penalty derivative order needed for this algorithm. More... | |
bool | GetAcceptPenalty () |
Get the boolean saying if the optimizer accepts penalties. More... | |
void | SetPenalty (vPenalty *ap_penalty) |
bool | GetNeedGlobalSensitivity () |
Get the boolean saying if the sensitivity has to be computed globally for all data channels and not per subset. More... | |
vOptimizer () | |
virtual | ~vOptimizer () |
void | ShowHelp () |
int | CheckParameters () |
int | Initialize () |
int | UpdateVisitedVoxels () |
int | PreDataUpdateStep () |
int | PreImageUpdateStep () |
virtual int | DataStep1ForwardProjectModel (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep2Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep3BackwardProjectSensitivity (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep4Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep5ComputeCorrections (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep6Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep7BackwardProjectCorrections (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | DataStep8ComputeFOM (oProjectionLine *ap_Line, vEvent *ap_Event, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread) |
virtual int | ImageUpdateStep () |
void | SetVerbose (int a_verbose) |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification) |
void | SetImageSpace (oImageSpace *ap_ImageSpace) |
void | SetDataFile (vDataFile *ap_DataFile) |
Set the data file in use. More... | |
void | SetNbTOFBins (int a_nbTOFBins) |
void | SetDataMode (int a_dataMode) |
void | SetDataType (int a_dataType) |
void | SetDataSpec (int a_dataSpec) |
void | SetAttenuationImage (FLTNB *ap_attenuationImage, int a_thread) |
void | SetFOMFlag (bool a_optimizerFOMFlag) |
void | SetImageStatFlag (bool a_optimizerImageStatFlag) |
void | SetNumbersOfIterationsAndSubsets (int a_nbSubIterationsTotal, int *ap_nbSubsets) |
void | SetOutputIterations (bool *ap_outputIterations) |
Set the selected output iterations. More... | |
void | SetCurrentIteration (int a_currentTotalSubIteration) |
int | GetNbSubIterationsInOneIteration () |
Get the number of sub iterations in one iteration. More... | |
void | SetImageConvolverManager (oImageConvolverManager *ap_ImageConvolverManager) |
Set the Image Convolver Manager Object. More... | |
void | SetCurrentSubset (int a_currentSubset) |
int | GetNbBackwardImages () |
FLTNB | GetInitialValue () |
void | SetOptimizerID (const string &a_optimizerID) |
const string & | GetOptimizerID () |
int | GetRequiredPenaltyDerivativesOrder () |
bool | GetAcceptPenalty () |
void | SetPenalty (vPenalty *ap_penalty) |
bool | GetNeedGlobalSensitivity () |
void | EnterPreIteration () |
Set pre-process flag to true. More... | |
void | ExitPreIteration () |
Set pre-process flag to false. More... | |
bool | NeedPreIteration () |
Say if the optimizer needs a pre-process loop before iterations are done. More... | |
void | EnterPostIteration () |
Set post-process flag to true. More... | |
void | ExitPostIteration () |
Set post-process flag to false. More... | |
bool | NeedPostIteration () |
Say if the optimizer needs a post-process loop after iterations are done. More... | |
Private Member Functions | |
virtual int | PreDataUpdateSpecificStep () |
A private function used to compute some norms for the image update. More... | |
int | PreImageUpdateSpecificStep () |
A private function used to compute the penalty term update adaptive alpha of the ADMM algorithm. More... | |
void | ShowHelpSpecific () |
A function used to show help about the child optimizer. More... | |
int | CheckSpecificParameters () |
A private function used to check the parameters settings specific to the child optimizer. More... | |
int | InitializeSpecific () |
This function is used to initialize specific stuff to the child optimizer. More... | |
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) More... | |
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 backprojected) More... | |
int | ImageSpaceSpecificOperations (FLTNB a_currentImageValue, FLTNB *ap_newImageValue, FLTNB a_sensitivity, FLTNB *ap_correctionValues, INTNB a_voxel, int tbf=-1, int rbf=-1, int cbf=-1) |
This function perform the image update step specific to the optimizer. More... | |
This class implements the A-Preconditioned Gradient MAP algorithm.
This class inherits from vOptimizer and implements the a sort of "penalized AML"
Definition at line 21 of file iOptimizerAPPGML.hh.
iOptimizerAPPGML::iOptimizerAPPGML | ( | ) |
The constructor of iOptimizerAPPGML.
This is the default and unique constructor. It does not take any parameter and its role is only to affect default values to each member of the class.
Definition at line 16 of file iOptimizerAPPGML.cc.
iOptimizerAPPGML::~iOptimizerAPPGML | ( | ) |
The destructor of iOptimizerAPPGML.
This is the default and unique destructor. It does not take any parameter and its role is only to free or delete all structures that were built by this class.
Definition at line 58 of file iOptimizerAPPGML.cc.
|
privatevirtual |
A private function used to check the parameters settings specific to the child optimizer.
This function is used to check that all parameters specific to the optimizer are correctly set within allowed values. It is called by the CheckParameters() function of the mother class. It is the implementation of the pure virtual function inherited from the abstract mother class vOptimizer.
Implements vOptimizer.
Definition at line 227 of file iOptimizerAPPGML.cc.
|
privatevirtual |
This function performs the data space operations specific to the optimizer (computes the values to be backprojected)
FLTNB | a_data |
FLTNB | a_forwardModel |
FLTNB* | ap_backwardValues |
FLTNB | a_multiplicativeCorrections |
FLTNB | a_additiveCorrections |
FLTNB | a_quantificationFactor |
oProjectionLine* | ap_Line |
It is the implementation of the pure virtual function from vOptimizer. The results to be backprojected is put at ap_backwardValues location.
Implements vOptimizer.
Definition at line 437 of file iOptimizerAPPGML.cc.
|
privatevirtual |
This function perform the image update step specific to the optimizer.
FLTNB | a_currentImageValue |
FLTNB* | ap_newImageValue |
FLTNB | a_sensitivity |
FLTNB* | ap_correctionValues |
It is the implementation of the pure virtual function from vOptimizer. The new image value is put at the ap_newImageValue location.
Implements vOptimizer.
Definition at line 538 of file iOptimizerAPPGML.cc.
|
privatevirtual |
This function is used to initialize specific stuff to the child optimizer.
It is called by the public Initialize() function from the mother.
Implements vOptimizer.
Definition at line 262 of file iOptimizerAPPGML.cc.
|
privatevirtual |
A private function used to compute some norms for the image update.
This function computes some norms for the optimized stepsize used for the image update. so it can be overloaded by the child optimizer if needed.
Reimplemented from vOptimizer.
Definition at line 371 of file iOptimizerAPPGML.cc.
|
privatevirtual |
A private function used to compute the penalty term update adaptive alpha of the ADMM algorithm.
This function implements the virtual eponym function of vOptimizer. It computes the penalty term of the ADMM algorithm, and the residuals to compute adaptive alpha.
Reimplemented from vOptimizer.
Definition at line 466 of file iOptimizerAPPGML.cc.
|
virtual |
A function used to read options from a configuration file.
const | string& a_configurationFile |
This function implements the reading of all options associated to the child optimizer, from a configuration file. It is the implementation of the pure virtual function inherited from the abstract class vOptimizer. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.
Implements vOptimizer.
Definition at line 159 of file iOptimizerAPPGML.cc.
|
virtual |
A function used to read options from a list of options.
const | string& a_optionsList |
This function implements the reading of all options associated to the child optimizer, from a list of options. It is the implementation of the pure virtual function inherited from the abstract class vOptimizer. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.
Implements vOptimizer.
Definition at line 215 of file iOptimizerAPPGML.cc.
|
privatevirtual |
This function compute the weight associated to the provided event (for sensitivity computation)
FLTNB | a_data |
FLTNB | a_forwardModel |
FLTNB* | ap_weight |
FLTNB | a_multiplicativeCorrections |
FLTNB | a_additiveCorrections |
FLTNB | a_quantificationFactor |
oProjectionLine* | ap_Line |
It is the implementation of the pure virtual function from vOptimizer. The result is put at ap_weight location.
Implements vOptimizer.
Definition at line 422 of file iOptimizerAPPGML.cc.
|
privatevirtual |
A function used to show help about the child optimizer.
This function must describe what the module does and how to use it. It describes in details the different parameters of the optimizer, and how to set them through the use of a configuration file or a list of options. It is the implementation of the pure virtual function inherited from the abstract class vOptimizer. It is called by the public ShowHelp() function.
Implements vOptimizer.
Definition at line 132 of file iOptimizerAPPGML.cc.
|
private |
Image containing the penalty terms of the algorithm
Definition at line 182 of file iOptimizerAPPGML.hh.
|
private |
Image without being shifted with bound, to be used in penalty computation
Definition at line 181 of file iOptimizerAPPGML.hh.
|
private |
Image containing the second order derivative penalty terms of the algorithm
Definition at line 183 of file iOptimizerAPPGML.hh.
|
private |
The low bound of the APPGML algorithm, expressed in the same units as the reconstructed image; must be negative or null (=PreconditionedGradientMAP)
Definition at line 179 of file iOptimizerAPPGML.hh.
|
private |
Threshold applied to the denominator of the data space operation to avoid 0-divisions or too high ratios
Definition at line 176 of file iOptimizerAPPGML.hh.
|
private |
Maximum allowed image update factor (null or negative values mean no restriction)
Definition at line 178 of file iOptimizerAPPGML.hh.
|
private |
Minimum allowed image update factor, useful to avoid voxels trapped in 0 value (null or negative values mean no restriction)
Definition at line 177 of file iOptimizerAPPGML.hh.
|
private |
Path to image defining region to apply the shift
Definition at line 180 of file iOptimizerAPPGML.hh.
|
private |
Image to apply the shift in a specific region of interest
Definition at line 184 of file iOptimizerAPPGML.hh.
|
private |
Image to be convolved by psf to apply the shift (for projection data) in a specific region of interest
Definition at line 185 of file iOptimizerAPPGML.hh.