CASToR
3.0
Tomographic Reconstruction (PET/SPECT/CT)
|
This class is designed to generically described any penalty applied to MAP algorithms. More...
#include <vPenalty.hh>
Public Member Functions | |
vPenalty () | |
The constructor of vPenalty. More... | |
virtual | ~vPenalty () |
The destructor of vPenalty. More... | |
void | ShowHelp () |
A function used to show help about the penalty. More... | |
int | CheckParameters () |
A public function used to check the parameters settings. More... | |
int | Initialize () |
A public function used to initialize the penalty. More... | |
virtual int | GlobalPreProcessingStep () |
A public function computing a global pre-processing step for the penalty. More... | |
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. More... | |
virtual FLTNB | ComputePenaltyValue (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)=0 |
A public function computing the value of the penalty function. More... | |
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. More... | |
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 to the same variable) 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 | SetPenaltyStrength (FLTNB a_penaltyStrength) |
Set the penalty strength. More... | |
FLTNB | GetPenaltyStrength () |
Get the penalty strength. More... | |
int | GetPenaltyDerivativesOrder () |
Get the penalty deratives order. More... | |
void | SetPenaltyID (const string &a_penaltyID) |
Set the penalty ID. More... | |
const string & | GetPenaltyID () |
virtual int | ReadConfigurationFile (const string &a_configurationFile)=0 |
A function used to read options from a configuration file and check that the corresponding values are correct. More... | |
virtual int | ReadOptionsList (const string &a_optionsList)=0 |
A function used to read options from a list of options. More... | |
Protected Attributes | |
string | m_penaltyID |
oImageDimensionsAndQuantification * | mp_ImageDimensionsAndQuantification |
oImageSpace * | mp_ImageSpace |
int | m_verbose |
int | m_penaltyDerivativesOrder |
FLTNB | m_penaltyStrength |
Private Member Functions | |
virtual int | CheckSpecificParameters ()=0 |
A private function used to check the parameters settings specific to the child penalty. More... | |
virtual void | ShowHelpSpecific ()=0 |
A function used to show help about the child module. More... | |
virtual int | InitializeSpecific ()=0 |
A private function used to initialize everything specific to the child penalty. More... | |
This class is designed to generically described any penalty applied to MAP algorithms.
This class is an abstract one, in the sense that it cannot be used on its own because several pure virtual functions belong to it. Its children are implementations of actual penalties. Everywhere in the code, this parent class should be used instead of any of its children. Nothing is yet implemented. To be designed.
Definition at line 48 of file vPenalty.hh.
vPenalty::vPenalty | ( | ) |
The constructor of vPenalty.
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 vPenalty.cc.
|
virtual |
The destructor of vPenalty.
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. It is virtual, so that it is automatically called when a child object is deleted.
Definition at line 54 of file vPenalty.cc.
int vPenalty::CheckParameters | ( | ) |
A public function used to check the parameters settings.
This function does not take any parameter and is used to check that all mandatory members were correctly parameterized. At the end, it calls the pure virtual CheckSpecificParameters() function implemented by children.
Definition at line 75 of file vPenalty.cc.
|
privatepure virtual |
A private function used to check the parameters settings specific to the child penalty.
This function is used to check that all parameters specific to the penalty are correctly set within allowed values. It is called by the CheckParameters() function. It is pure virtual so is implemented by children.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
pure virtual |
A public function computing the derivative of the penalty.
int | a_timeBasisFunction |
int | a_respBasisFunction |
int | a_cardBasisFunction |
INTNB | a_voxel |
int | a_th |
This function computes the first derivative of the penalty for the provided indices. This function is supposed to be called within a multi-threaded loop, so the thread index is provided.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
pure virtual |
A public function computing the value of the penalty function.
int | a_timeBasisFunction |
int | a_respBasisFunction |
int | a_cardBasisFunction |
INTNB | a_voxel |
int | a_th |
This function computes the value of the penalty function for the provided indices. This function is supposed to be called within a multi-threaded loop, so the thread index is provided.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
pure virtual |
A public function computing the second derivative of the penalty (the two derivatives are according to the same variable)
int | a_timeBasisFunction |
int | a_respBasisFunction |
int | a_cardBasisFunction |
INTNB | a_voxel |
int | a_th |
This function compute the second derivative of the penalty for the provided indices. (the two derivatives are according to the same variable) This function is supposed to be called within a multi-threaded loop, so the thread index is provided.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
inline |
Get the penalty deratives order.
Definition at line 204 of file vPenalty.hh.
|
inline |
Definition at line 217 of file vPenalty.hh.
|
inline |
Get the penalty strength.
Definition at line 197 of file vPenalty.hh.
|
virtual |
A public function computing a global pre-processing step for the penalty.
This function of this mother class does nothing but can be overloaded by children in order to compute some required pre-processing step before going through the loops on dimensions.
Definition at line 138 of file vPenalty.cc.
int vPenalty::Initialize | ( | ) |
A public function used to initialize the penalty.
This function does not take any parameter and is used to initialize everything that should be initialized. At the end, it calls the pure virtual InitializeSpecific() function implemented by children.
Definition at line 116 of file vPenalty.cc.
|
privatepure virtual |
A private function used to initialize everything specific to the child penalty.
This function is used to initialize everything specific to the penalty that should be initialized. It is called by the Initialize() function. It is pure virtual so is implemented by children.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
virtual |
A public function computing a local pre-processing step for the penalty.
int | a_timeBasisFunction |
int | a_respBasisFunction |
int | a_cardBasisFunction |
INTNB | a_voxel |
int | a_th |
This function of this mother class does nothing but can be overloaded by children in order to compute some required pre-processing step before being able to compute the first and second derivatives for a given voxel, or the actual penalty value.
Reimplemented in iPenaltyMarkovRandomField, and iPenaltyMedianRootPrior.
Definition at line 149 of file vPenalty.cc.
|
pure virtual |
A function used to read options from a configuration file and check that the corresponding values are correct.
const | string& a_configurationFile |
This function implements the reading of all options associated to a child penalty, from a configuration file. It is pure virtual so is implemented by children. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
pure 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 a child penalty, from a list of options. It is pure virtual so is implemented by children. It checks the reading status but not the options values that will be checked by the CheckSpecificParameters() function.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
inline |
Set the pointer to the image dimensions in use.
oImageDimensionsAndQuantification* | ap_ImageDimensionsAndQuantification |
Definition at line 176 of file vPenalty.hh.
|
inline |
Set the pointer to the image space in use.
oImageSpace* | ap_ImageSpace |
Definition at line 183 of file vPenalty.hh.
|
inline |
Set the penalty ID.
const | string& a_penaltyID |
Definition at line 211 of file vPenalty.hh.
|
inline |
Set the penalty strength.
FLTNB | a_penaltyStrength |
Definition at line 190 of file vPenalty.hh.
|
inline |
Set the verbose level.
int | a_verboseLevel |
Definition at line 169 of file vPenalty.hh.
void vPenalty::ShowHelp | ( | ) |
A function used to show help about the penalty.
This function simply calls the ShowHelpSpecific() function implemented by children.
Definition at line 63 of file vPenalty.cc.
|
privatepure virtual |
A function used to show help about the child module.
This function must describe what the penalty does and how to use it. It describes in details the different parameters of the penalty, and how to set them through the use of a configuration file or a list of options. It is pure virtual so is implemented by children. It is private because called by the public ShowHelp() function.
Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.
|
protected |
The derivative order of the penalty
Definition at line 293 of file vPenalty.hh.
|
protected |
String containing the name provided as the class identifer in the children classes
Definition at line 285 of file vPenalty.hh.
|
protected |
Regularization parameter (penalty strength)
Definition at line 294 of file vPenalty.hh.
|
protected |
The verbose level
Definition at line 291 of file vPenalty.hh.
|
protected |
The pointer to the image dimensions and quantification object
Definition at line 288 of file vPenalty.hh.
|
protected |
The pointer to the image object
Definition at line 289 of file vPenalty.hh.