CASToR  3.2
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)
 
virtual FLTNB ComputePenaltyValue (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)=0
 
virtual FLTNB ComputeFirstDerivative (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)=0
 
virtual FLTNB ComputeSecondDerivative (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)=0
 
void SetVerbose (int a_verbose)
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 
void SetImageSpace (oImageSpace *ap_ImageSpace)
 
void SetPenaltyStrength (FLTNB a_penaltyStrength)
 
FLTNB GetPenaltyStrength ()
 Get the penalty strength. More...
 
int GetPenaltyDerivativesOrder ()
 Get the penalty deratives order. More...
 
void SetPenaltyID (const string &a_penaltyID)
 
const string & GetPenaltyID ()
 
virtual int ReadConfigurationFile (const string &a_configurationFile)=0
 
virtual int ReadOptionsList (const string &a_optionsList)=0
 
 vPenalty ()
 
virtual ~vPenalty ()
 
void ShowHelp ()
 
int CheckParameters ()
 
int Initialize ()
 
virtual int GlobalPreProcessingStep ()
 
virtual int LocalPreProcessingStep (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
 
virtual FLTNB ComputePenaltyValue (FLTNB *ap_image, INTNB a_voxel, int a_th)=0
 
virtual FLTNB ComputeFirstDerivative (FLTNB *ap_image, INTNB a_voxel, int a_th)=0
 
virtual FLTNB ComputeSecondDerivative (FLTNB *ap_image, INTNB a_voxel, int a_th)=0
 
void SetVerbose (int a_verbose)
 
void SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
 
void SetImageSpace (oImageSpace *ap_ImageSpace)
 
void SetDataFile (vDataFile *ap_DataFile)
 Set the image space in use. More...
 
void SetPenaltyStrength (FLTNB a_penaltyStrength)
 
FLTNB GetPenaltyStrength ()
 
int GetPenaltyDerivativesOrder ()
 
void SetPenaltyID (const string &a_penaltyID)
 
const string & GetPenaltyID ()
 
virtual int ReadConfigurationFile (const string &a_configurationFile)=0
 
virtual int ReadOptionsList (const string &a_optionsList)=0
 

Protected Attributes

string m_penaltyID
 
oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
oImageSpacemp_ImageSpace
 
int m_verbose
 
int m_penaltyDerivativesOrder
 
FLTNB m_penaltyStrength
 
vDataFilemp_DataFile
 

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...
 
virtual int CheckSpecificParameters ()=0
 
virtual void ShowHelpSpecific ()=0
 
virtual int InitializeSpecific ()=0
 

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 26 of file code/include/optimizer/vPenalty.hh.

Constructor & Destructor Documentation

◆ vPenalty() [1/2]

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 16 of file code/src/optimizer/vPenalty.cc.

◆ ~vPenalty() [1/2]

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 32 of file code/src/optimizer/vPenalty.cc.

◆ vPenalty() [2/2]

vPenalty::vPenalty ( )

◆ ~vPenalty() [2/2]

virtual vPenalty::~vPenalty ( )
virtual

Member Function Documentation

◆ CheckParameters() [1/2]

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 53 of file code/src/optimizer/vPenalty.cc.

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

◆ CheckParameters() [2/2]

int vPenalty::CheckParameters ( )

◆ CheckSpecificParameters() [1/2]

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, iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, iPenaltyMedianRootPrior, iPenaltyTemplate, iPenaltyQuadratic, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ CheckSpecificParameters() [2/2]

virtual int vPenalty::CheckSpecificParameters ( )
privatepure virtual

◆ ComputeFirstDerivative() [1/2]

virtual FLTNB vPenalty::ComputeFirstDerivative ( FLTNB ap_image,
INTNB  a_voxel,
int  a_th 
)
pure virtual

◆ ComputeFirstDerivative() [2/2]

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ComputePenaltyValue() [1/2]

virtual FLTNB vPenalty::ComputePenaltyValue ( FLTNB ap_image,
INTNB  a_voxel,
int  a_th 
)
pure virtual

◆ ComputePenaltyValue() [2/2]

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ComputeSecondDerivative() [1/2]

virtual FLTNB vPenalty::ComputeSecondDerivative ( FLTNB ap_image,
INTNB  a_voxel,
int  a_th 
)
pure virtual

◆ ComputeSecondDerivative() [2/2]

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

Implemented in iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ GetPenaltyDerivativesOrder() [1/2]

public inline int vPenalty::GetPenaltyDerivativesOrder ( )
inline

Get the penalty deratives order.

Returns
m_penaltyDerivativesOrder

Definition at line 182 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ GetPenaltyDerivativesOrder() [2/2]

int vPenalty::GetPenaltyDerivativesOrder ( )
inline

Definition at line 183 of file include/optimizer/vPenalty.hh.

◆ GetPenaltyID() [1/2]

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

Definition at line 195 of file code/include/optimizer/vPenalty.hh.

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

◆ GetPenaltyID() [2/2]

const string& vPenalty::GetPenaltyID ( )
inline

Definition at line 196 of file include/optimizer/vPenalty.hh.

Here is the call graph for this function:

◆ GetPenaltyStrength() [1/2]

public inline int vPenalty::GetPenaltyStrength ( )
inline

Get the penalty strength.

Returns
m_penaltyStrength

Definition at line 175 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ GetPenaltyStrength() [2/2]

FLTNB vPenalty::GetPenaltyStrength ( )
inline

Definition at line 176 of file include/optimizer/vPenalty.hh.

◆ GlobalPreProcessingStep() [1/2]

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 116 of file code/src/optimizer/vPenalty.cc.

Here is the caller graph for this function:

◆ GlobalPreProcessingStep() [2/2]

virtual int vPenalty::GlobalPreProcessingStep ( )
virtual

◆ Initialize() [1/2]

int vPenalty::Initialize ( )

◆ Initialize() [2/2]

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 94 of file code/src/optimizer/vPenalty.cc.

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

◆ InitializeSpecific() [1/2]

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, iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, iPenaltyMedianRootPrior, iPenaltyTemplate, iPenaltyQuadratic, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ InitializeSpecific() [2/2]

virtual int vPenalty::InitializeSpecific ( )
privatepure virtual

◆ LocalPreProcessingStep() [1/2]

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

Reimplemented in iPenaltyMarkovRandomField, iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, and iPenaltyMedianRootPrior.

Definition at line 127 of file code/src/optimizer/vPenalty.cc.

Here is the caller graph for this function:

◆ LocalPreProcessingStep() [2/2]

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

◆ ReadConfigurationFile() [1/2]

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

◆ ReadConfigurationFile() [2/2]

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

◆ ReadOptionsList() [1/2]

virtual int vPenalty::ReadOptionsList ( const string &  a_optionsList)
pure virtual

◆ ReadOptionsList() [2/2]

virtual int vPenalty::ReadOptionsList ( const string &  a_optionsList)
pure virtual

◆ SetDataFile()

public inline void vPenalty::SetDataFile ( vDataFile ap_DataFile)
inline

Set the image space in use.

Parameters
vDataFile*ap_DataFile

Definition at line 162 of file include/optimizer/vPenalty.hh.

◆ SetImageDimensionsAndQuantification() [1/2]

void vPenalty::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Definition at line 148 of file include/optimizer/vPenalty.hh.

◆ SetImageDimensionsAndQuantification() [2/2]

void vPenalty::SetImageDimensionsAndQuantification ( oImageDimensionsAndQuantification ap_ImageDimensionsAndQuantification)
inline

Definition at line 154 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ SetImageSpace() [1/2]

void vPenalty::SetImageSpace ( oImageSpace ap_ImageSpace)
inline

Definition at line 155 of file include/optimizer/vPenalty.hh.

◆ SetImageSpace() [2/2]

void vPenalty::SetImageSpace ( oImageSpace ap_ImageSpace)
inline

Definition at line 161 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ SetPenaltyID() [1/2]

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

Definition at line 189 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ SetPenaltyID() [2/2]

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

Definition at line 190 of file include/optimizer/vPenalty.hh.

◆ SetPenaltyStrength() [1/2]

void vPenalty::SetPenaltyStrength ( FLTNB  a_penaltyStrength)
inline

Definition at line 168 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ SetPenaltyStrength() [2/2]

void vPenalty::SetPenaltyStrength ( FLTNB  a_penaltyStrength)
inline

Definition at line 169 of file include/optimizer/vPenalty.hh.

◆ SetVerbose() [1/2]

void vPenalty::SetVerbose ( int  a_verbose)
inline

Definition at line 141 of file include/optimizer/vPenalty.hh.

◆ SetVerbose() [2/2]

void vPenalty::SetVerbose ( int  a_verbose)
inline

Definition at line 147 of file code/include/optimizer/vPenalty.hh.

Here is the caller graph for this function:

◆ ShowHelp() [1/2]

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 41 of file code/src/optimizer/vPenalty.cc.

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

◆ ShowHelp() [2/2]

void vPenalty::ShowHelp ( )

◆ ShowHelpSpecific() [1/2]

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, iPenaltyMarkovRandomField, iPenaltyMedianRootPrior, iPenaltyMedianRootPrior, iPenaltyTemplate, iPenaltyQuadratic, and iPenaltyTemplate.

Here is the caller graph for this function:

◆ ShowHelpSpecific() [2/2]

virtual void vPenalty::ShowHelpSpecific ( )
privatepure virtual

Member Data Documentation

◆ m_penaltyDerivativesOrder

int vPenalty::m_penaltyDerivativesOrder
protected

The derivative order of the penalty

Definition at line 271 of file code/include/optimizer/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 263 of file code/include/optimizer/vPenalty.hh.

◆ m_penaltyStrength

FLTNB vPenalty::m_penaltyStrength
protected

Regularization parameter (penalty strength)

Definition at line 272 of file code/include/optimizer/vPenalty.hh.

◆ m_verbose

int vPenalty::m_verbose
protected

The verbose level

Definition at line 269 of file code/include/optimizer/vPenalty.hh.

◆ mp_DataFile

vDataFile* vPenalty::mp_DataFile
protected

Pointer to the data file object in use

Definition at line 269 of file include/optimizer/vPenalty.hh.

◆ mp_ImageDimensionsAndQuantification

oImageDimensionsAndQuantification * vPenalty::mp_ImageDimensionsAndQuantification
protected

The pointer to the image dimensions and quantification object

Definition at line 266 of file code/include/optimizer/vPenalty.hh.

◆ mp_ImageSpace

oImageSpace * vPenalty::mp_ImageSpace
protected

The pointer to the image object

Definition at line 267 of file code/include/optimizer/vPenalty.hh.


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