CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
iOptimizerBSREM Class Reference

This class implements the Block Sequential Regularized Expectation Maximization (BSREM) algorithm. More...

#include <iOptimizerBSREM.hh>

Inheritance diagram for iOptimizerBSREM:
Inheritance graph
Collaboration diagram for iOptimizerBSREM:
Collaboration graph

Public Member Functions

 iOptimizerBSREM ()
 The constructor of iOptimizerBSREM. More...
 
 ~iOptimizerBSREM ()
 The destructor of iOptimizerBSREM. 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...
 
- Public Member Functions inherited from vOptimizer
 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)
 A public function used to compute the model: forward projection of the provided event. More...
 
virtual int DataStep2Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function which does nothing but being virtual. More...
 
virtual int DataStep3BackwardProjectSensitivity (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function used to back-project the sensitivity terms for the provided event. More...
 
virtual int DataStep4Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function which does nothing but being virtual. More...
 
virtual int DataStep5ComputeCorrections (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function used to compute the correction terms in the data space, for the provided event. More...
 
virtual int DataStep6Optional (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function which does nothing but being virtual. More...
 
virtual int DataStep7BackwardProjectCorrections (oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function used to back-project the correction terms into the backward correction image. More...
 
virtual int DataStep8ComputeFOM (oProjectionLine *ap_Line, vEvent *ap_Event, int a_timeFrame, int a_respGate, int a_cardGate, int a_thread)
 A public function used to update the computation of figures-of-merit in the data space. More...
 
virtual int ImageUpdateStep ()
 A public function used to perform the image update step of the optimizer. More...
 
void SetVerbose (int a_verbose)
 Set the verbose level. More...
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 Set the pointer to the image dimensions in use. More...
 
void SetImageSpace (oImageSpace *ap_ImageSpace)
 Set the pointer to the image space in use. More...
 
void SetNbTOFBins (int a_nbTOFBins)
 Set the number of TOF bins in use. More...
 
void SetDataMode (int a_dataMode)
 Set the data mode in use. More...
 
void SetDataType (int a_dataType)
 Set the data type in use. More...
 
void SetDataSpec (int a_dataSpec)
 Set the data physical specificity in use. More...
 
void SetAttenuationImage (FLTNB *ap_attenuationImage, int a_thread)
 Set the attenuation image corresponding to the current thread and current event. More...
 
void SetFOMFlag (bool a_optimizerFOMFlag)
 Set the FOM flag specifying if figures-of-merit will be computed or not. More...
 
void SetImageStatFlag (bool a_optimizerImageStatFlag)
 Set the image stat flag specifying if basic statistics about image udpate will be computed or not. More...
 
void SetNumbersOfIterationsAndSubsets (int a_nbIterations, int *ap_nbSubsets)
 Set these numbers of iterations and subsets. More...
 
void SetCurrentIteration (int a_currentIteration)
 Set the current iteration. More...
 
void SetCurrentSubset (int a_currentSubset)
 Set the current subset. More...
 
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)
 Set the optimizer ID. More...
 
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)
 Set the penalty of the optimizer. More...
 
bool GetNeedGlobalSensitivity ()
 Get the boolean saying if the sensitivity has to be computed globally for all data channels and not per subset. More...
 

Private Member Functions

int PreImageUpdateSpecificStep ()
 A private function used to compute the penalty term of the BSREM 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 a_tbf=-1, int a_rbf=-1, int a_cbf=-1)
 This function performs the image update step specific to the optimizer. More...
 

Private Attributes

HPFLTNB m_minimumImageValue
 
HPFLTNB m_maximumImageValue
 
FLTNB **** m4p_firstDerivativePenaltyImage
 
int m_relaxationFactorType
 
HPFLTNB m_relaxationFactorInitialValue
 
HPFLTNB m_relaxationFactorStepSize
 
HPFLTNB m_relaxationFactor
 

Additional Inherited Members

- Protected Member Functions inherited from vOptimizer
FLTNB ComputeSensitivity (FLTNB ****a4p_sensitivityImage, int a_timeBasisFunction, int a_respBasisFunction, int a_cardBasisFunction, int a_voxel)
 A function used to compute the sensitivity of a given voxel and a given set of dynamic basis functions. More...
 
FLTNB ForwardProject (oProjectionLine *ap_Line, FLTNB *ap_image=NULL)
 A function used to forward project the provided image (or 1 if NULL), based on the provided oProjectionLine. More...
 
void BackwardProject (oProjectionLine *ap_Line, FLTNB *ap_image, FLTNB a_value)
 A function used to backward project the provided value into the provided image, based on the provided oProjectionLine. More...
 
- Protected Attributes inherited from vOptimizer
string m_optimizerID
 
int m_verbose
 
int m_nbBackwardImages
 
int m_nbTOFBins
 
FLTNB ** m2p_forwardValues
 
FLTNB *** m3p_backwardValues
 
FLTNB m_initialValue
 
bool m_listmodeCompatibility
 
bool m_histogramCompatibility
 
bool m_emissionCompatibility
 
bool m_transmissionCompatibility
 
oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
oImageSpacemp_ImageSpace
 
int m_dataMode
 
int m_dataType
 
int m_dataSpec
 
FLTNB ** m2p_attenuationImage
 
int m_nbIterations
 
int * mp_nbSubsets
 
int m_currentIteration
 
int m_currentSubset
 
bool m_optimizerFOMFlag
 
HPFLTNB **** m4p_FOMLogLikelihood
 
HPFLTNB **** m4p_FOMRMSE
 
uint64_t **** m4p_FOMNbBins
 
HPFLTNB **** m4p_FOMNbData
 
HPFLTNB **** m4p_FOMPenalty
 
bool m_optimizerImageStatFlag
 
INTNBmp_imageStatNbVox
 
FLTNBmp_imageStatMin
 
FLTNBmp_imageStatMax
 
HPFLTNBmp_imageStatMean
 
HPFLTNBmp_imageStatVariance
 
HPFLTNBmp_correctionStatMean
 
HPFLTNBmp_correctionStatVariance
 
int m_requiredPenaltyDerivativesOrder
 
vPenaltymp_Penalty
 
bool m_needGlobalSensitivity
 

Detailed Description

This class implements the Block Sequential Regularized Expectation Maximization (BSREM) algorithm.

This class inherits from vOptimizer and implements the BSREM algorithm. This implementation follows the BSREM II algorithm defined in Ahn and Fessler 2003.

Definition at line 46 of file iOptimizerBSREM.hh.

Constructor & Destructor Documentation

◆ iOptimizerBSREM()

iOptimizerBSREM::iOptimizerBSREM ( )

The constructor of iOptimizerBSREM.

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 38 of file iOptimizerBSREM.cc.

◆ ~iOptimizerBSREM()

iOptimizerBSREM::~iOptimizerBSREM ( )

The destructor of iOptimizerBSREM.

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 79 of file iOptimizerBSREM.cc.

Here is the call graph for this function:

Member Function Documentation

◆ CheckSpecificParameters()

int iOptimizerBSREM::CheckSpecificParameters ( )
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.

Returns
An integer reflecting the check status; 0 if no problem, another value otherwise.

Implements vOptimizer.

Definition at line 232 of file iOptimizerBSREM.cc.

◆ DataSpaceSpecificOperations()

int iOptimizerBSREM::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 
)
privatevirtual

This function performs the data space operations specific to the optimizer (computes the values to be backprojected)

Parameters
FLTNBa_data
FLTNBa_forwardModel
FLTNB*ap_backwardValues
FLTNBa_multiplicativeCorrections
FLTNBa_additiveCorrections
FLTNBa_blankValue
FLTNBa_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.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Implements vOptimizer.

Definition at line 434 of file iOptimizerBSREM.cc.

◆ ImageSpaceSpecificOperations()

int iOptimizerBSREM::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 
)
privatevirtual

This function performs the image update step specific to the optimizer.

Parameters
FLTNBa_currentImageValue
FLTNB*ap_newImageValue
FLTNBa_sensitivity
FLTNB*ap_correctionValues
INTNBa_voxel
inta_tbf
inta_rbf
inta_cbf

It is the implementation of the pure virtual function from vOptimizer. The new image value is put at the ap_newImageValue location.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Implements vOptimizer.

Definition at line 453 of file iOptimizerBSREM.cc.

◆ InitializeSpecific()

int iOptimizerBSREM::InitializeSpecific ( )
privatevirtual

This function is used to initialize specific stuff to the child optimizer.

It is called by the public Initialize() function from the mother.

Returns
An integer reflecting the initialization status; 0 if no problem, another value otherwise.

Implements vOptimizer.

Definition at line 283 of file iOptimizerBSREM.cc.

Here is the call graph for this function:

◆ PreImageUpdateSpecificStep()

int iOptimizerBSREM::PreImageUpdateSpecificStep ( )
privatevirtual

A private function used to compute the penalty term of the BSREM algorithm.

This function implements the virtual eponym function of vOptimizer. It computes the penalty term of the BSREM algorithm.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Reimplemented from vOptimizer.

Definition at line 336 of file iOptimizerBSREM.cc.

Here is the call graph for this function:

◆ ReadConfigurationFile()

int iOptimizerBSREM::ReadConfigurationFile ( const string &  a_configurationFile)
virtual

A function used to read options from a configuration file.

Parameters
conststring& 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.

Returns
An integer reflecting the reading success; 0 if success, another value otherwise.

Implements vOptimizer.

Definition at line 136 of file iOptimizerBSREM.cc.

Here is the call graph for this function:

◆ ReadOptionsList()

int iOptimizerBSREM::ReadOptionsList ( const string &  a_optionsList)
virtual

A function used to read options from a list of options.

Parameters
conststring& 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.

Returns
An integer reflecting the reading success; 0 if success, another value otherwise.

Implements vOptimizer.

Definition at line 202 of file iOptimizerBSREM.cc.

Here is the call graph for this function:

◆ SensitivitySpecificOperations()

int iOptimizerBSREM::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 
)
privatevirtual

This function compute the weight associated to the provided event (for sensitivity computation)

Parameters
FLTNBa_data
FLTNBa_forwardModel
FLTNB*ap_weight
FLTNBa_multiplicativeCorrections
FLTNBa_additiveCorrections
FLTNBa_blankValue
FLTNBa_quantificationFactor
oProjectionLine*ap_Line

It is the implementation of the pure virtual function from vOptimizer. The result is put at ap_weight location.

Returns
An integer reflecting the process status; 0 if no problem, another value otherwise.

Implements vOptimizer.

Definition at line 419 of file iOptimizerBSREM.cc.

◆ ShowHelpSpecific()

void iOptimizerBSREM::ShowHelpSpecific ( )
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 109 of file iOptimizerBSREM.cc.

Member Data Documentation

◆ m4p_firstDerivativePenaltyImage

FLTNB**** iOptimizerBSREM::m4p_firstDerivativePenaltyImage
private

Image containing the penalty terms of the algorithm

Definition at line 201 of file iOptimizerBSREM.hh.

◆ m_maximumImageValue

HPFLTNB iOptimizerBSREM::m_maximumImageValue
private

Threshold applied to the voxels to avoid too large values values and enforce convergence

Definition at line 200 of file iOptimizerBSREM.hh.

◆ m_minimumImageValue

HPFLTNB iOptimizerBSREM::m_minimumImageValue
private

Threshold applied to the voxels to avoid non-positive values and enforce convergence

Definition at line 199 of file iOptimizerBSREM.hh.

◆ m_relaxationFactor

HPFLTNB iOptimizerBSREM::m_relaxationFactor
private

Current value of the relaxation factor

Definition at line 205 of file iOptimizerBSREM.hh.

◆ m_relaxationFactorInitialValue

HPFLTNB iOptimizerBSREM::m_relaxationFactorInitialValue
private

Classic relaxation factor: initial value (alpha_0)

Definition at line 203 of file iOptimizerBSREM.hh.

◆ m_relaxationFactorStepSize

HPFLTNB iOptimizerBSREM::m_relaxationFactorStepSize
private

Classic relaxation factor: step size (gamma)

Definition at line 204 of file iOptimizerBSREM.hh.

◆ m_relaxationFactorType

int iOptimizerBSREM::m_relaxationFactorType
private

Type of relaxation factors

Definition at line 202 of file iOptimizerBSREM.hh.


The documentation for this class was generated from the following files: