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

This class is designed to generically described any penalty applied to MAP algorithms. More...

#include <vPenalty.hh>

Inheritance diagram for vPenalty:
Inheritance graph
Collaboration diagram for vPenalty:
Collaboration graph

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
 
oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
oImageSpacemp_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ vPenalty()

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.

◆ ~vPenalty()

vPenalty::~vPenalty ( )
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.

Member Function Documentation

◆ CheckParameters()

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.

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

Definition at line 75 of file vPenalty.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckSpecificParameters()

private virtual int vPenalty::CheckSpecificParameters ( )
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.

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ComputeFirstDerivative()

public virtual int vPenalty::ComputeFirstDerivative ( int  a_tbf,
int  a_rbf,
int  a_cbf,
INTNB  a_voxel,
int  a_th 
)
pure virtual

A public function computing the derivative of the penalty.

Parameters
inta_timeBasisFunction
inta_respBasisFunction
inta_cardBasisFunction
INTNBa_voxel
inta_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.

Returns
The derivative

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ComputePenaltyValue()

public virtual int vPenalty::ComputePenaltyValue ( int  a_tbf,
int  a_rbf,
int  a_cbf,
INTNB  a_voxel,
int  a_th 
)
pure virtual

A public function computing the value of the penalty function.

Parameters
inta_timeBasisFunction
inta_respBasisFunction
inta_cardBasisFunction
INTNBa_voxel
inta_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.

Returns
The penalty value

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ComputeSecondDerivative()

public virtual int vPenalty::ComputeSecondDerivative ( int  a_tbf,
int  a_rbf,
int  a_cbf,
INTNB  a_voxel,
int  a_th 
)
pure virtual

A public function computing the second derivative of the penalty (the two derivatives are according to the same variable)

Parameters
inta_timeBasisFunction
inta_respBasisFunction
inta_cardBasisFunction
INTNBa_voxel
inta_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.

Returns
The second derivative

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ GetPenaltyDerivativesOrder()

public inline int vPenalty::GetPenaltyDerivativesOrder ( )
inline

Get the penalty deratives order.

Returns
m_penaltyDerivativesOrder

Definition at line 204 of file vPenalty.hh.

Here is the caller graph for this function:

◆ GetPenaltyID()

public inline const string & vPenalty::GetPenaltyID ( )
inline
Returns
m_penaltyID

Definition at line 217 of file vPenalty.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPenaltyStrength()

public inline int vPenalty::GetPenaltyStrength ( )
inline

Get the penalty strength.

Returns
m_penaltyStrength

Definition at line 197 of file vPenalty.hh.

Here is the caller graph for this function:

◆ GlobalPreProcessingStep()

int vPenalty::GlobalPreProcessingStep ( )
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.

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

Definition at line 138 of file vPenalty.cc.

Here is the caller graph for this function:

◆ Initialize()

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.

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

Definition at line 116 of file vPenalty.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeSpecific()

private virtual int vPenalty::InitializeSpecific ( )
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.

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ LocalPreProcessingStep()

int vPenalty::LocalPreProcessingStep ( int  a_tbf,
int  a_rbf,
int  a_cbf,
INTNB  a_voxel,
int  a_th 
)
virtual

A public function computing a local pre-processing step for the penalty.

Parameters
inta_timeBasisFunction
inta_respBasisFunction
inta_cardBasisFunction
INTNBa_voxel
inta_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.

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

Reimplemented in iPenaltyMarkovRandomField, and iPenaltyMedianRootPrior.

Definition at line 149 of file vPenalty.cc.

Here is the caller graph for this function:

◆ ReadConfigurationFile()

public virtual int vPenalty::ReadConfigurationFile ( const string &  a_configurationFile)
pure virtual

A function used to read options from a configuration file and check that the corresponding values are correct.

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

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ReadOptionsList()

public virtual int vPenalty::ReadOptionsList ( const string &  a_optionsList)
pure 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 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.

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ SetImageDimensionsAndQuantification()

public inline void vPenalty::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Set the pointer to the image dimensions in use.

Parameters
oImageDimensionsAndQuantification*ap_ImageDimensionsAndQuantification

Definition at line 176 of file vPenalty.hh.

Here is the caller graph for this function:

◆ SetImageSpace()

public inline void vPenalty::SetImageSpace ( oImageSpace ap_ImageSpace)
inline

Set the pointer to the image space in use.

Parameters
oImageSpace*ap_ImageSpace

Definition at line 183 of file vPenalty.hh.

Here is the caller graph for this function:

◆ SetPenaltyID()

public inline void vPenalty::SetPenaltyID ( const string &  a_penaltyID)
inline

Set the penalty ID.

Parameters
conststring& a_penaltyID

Definition at line 211 of file vPenalty.hh.

Here is the caller graph for this function:

◆ SetPenaltyStrength()

public inline void vPenalty::SetPenaltyStrength ( FLTNB  a_penaltyStrength)
inline

Set the penalty strength.

Parameters
FLTNBa_penaltyStrength

Definition at line 190 of file vPenalty.hh.

Here is the caller graph for this function:

◆ SetVerbose()

public inline void vPenalty::SetVerbose ( int  a_verbose)
inline

Set the verbose level.

Parameters
inta_verboseLevel

Definition at line 169 of file vPenalty.hh.

Here is the caller graph for this function:

◆ ShowHelp()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowHelpSpecific()

private virtual void vPenalty::ShowHelpSpecific ( )
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.

Here is the caller graph for this function:

Member Data Documentation

◆ m_penaltyDerivativesOrder

int vPenalty::m_penaltyDerivativesOrder
protected

The derivative order of the penalty

Definition at line 293 of file vPenalty.hh.

◆ m_penaltyID

string vPenalty::m_penaltyID
protected

String containing the name provided as the class identifer in the children classes

Definition at line 285 of file vPenalty.hh.

◆ m_penaltyStrength

FLTNB vPenalty::m_penaltyStrength
protected

Regularization parameter (penalty strength)

Definition at line 294 of file vPenalty.hh.

◆ m_verbose

int vPenalty::m_verbose
protected

The verbose level

Definition at line 291 of file vPenalty.hh.

◆ mp_ImageDimensionsAndQuantification

oImageDimensionsAndQuantification* vPenalty::mp_ImageDimensionsAndQuantification
protected

The pointer to the image dimensions and quantification object

Definition at line 288 of file vPenalty.hh.

◆ mp_ImageSpace

oImageSpace* vPenalty::mp_ImageSpace
protected

The pointer to the image object

Definition at line 289 of file vPenalty.hh.


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