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

This class implements the "median root prior". More...

#include <iPenaltyMedianRootPrior.hh>

Inheritance diagram for iPenaltyMedianRootPrior:
Inheritance graph
Collaboration diagram for iPenaltyMedianRootPrior:
Collaboration graph

Public Member Functions

 iPenaltyMedianRootPrior ()
 The constructor of iPenaltyMedianRootPrior. More...
 
 ~iPenaltyMedianRootPrior ()
 The destructor of iPenaltyMedianRootPrior. 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...
 
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...
 
FLTNB ComputePenaltyValue (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
 Implementation of the pure virtual vPenalty::ComputePenaltyValue() More...
 
FLTNB ComputeFirstDerivative (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
 Implementation of the pure virtual vPenalty::ComputeFirstDerivative() More...
 
FLTNB ComputeSecondDerivative (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
 Implementation of the pure virtual vPenalty::ComputeSecondDerivative() More...
 
- Public Member Functions inherited from vPenalty
 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...
 
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 ()
 

Private Member Functions

void ShowHelpSpecific ()
 A function used to show help about the child penalty. More...
 
int CheckSpecificParameters ()
 A private function used to check the parameters settings specific to the child penalty. More...
 
int InitializeSpecific ()
 This function is used to initialize specific stuff to the child penalty. More...
 
int BuildNeighborhoodKernel ()
 A function used to build the neighborhood kernel. More...
 
int BuildSpecificNeighborhood (INTNB a_voxel, int a_th)
 
int ComputeMedianInNeighborhood (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
 A private function computing the median in the neighborhood of the provided index. More...
 

Private Attributes

int m_neighborhoodShape
 
FLTNB m_neighborhoodSphereRadius
 
int m_neighborhoodBoxOrder
 
int m_neighborhoodBoxExcludeCorners
 
INTNB m_neighborhoodMaxNbVoxels
 
INTNB ** m2p_neighborhoodKernel
 
INTNBmp_neighborhoodNbVoxels
 
INTNB ** m2p_neighborhoodIndices
 
FLTNBmp_medianValue
 

Additional Inherited Members

- Protected Attributes inherited from vPenalty
string m_penaltyID
 
oImageDimensionsAndQuantificationmp_ImageDimensionsAndQuantification
 
oImageSpacemp_ImageSpace
 
int m_verbose
 
int m_penaltyDerivativesOrder
 
FLTNB m_penaltyStrength
 

Detailed Description

This class implements the "median root prior".

This class inherits from vPenalty and implements the "median root prior".

Definition at line 52 of file iPenaltyMedianRootPrior.hh.

Constructor & Destructor Documentation

◆ iPenaltyMedianRootPrior()

iPenaltyMedianRootPrior::iPenaltyMedianRootPrior ( )

The constructor of iPenaltyMedianRootPrior.

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 37 of file iPenaltyMedianRootPrior.cc.

◆ ~iPenaltyMedianRootPrior()

iPenaltyMedianRootPrior::~iPenaltyMedianRootPrior ( )

The destructor of iPenaltyMedianRootPrior.

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 60 of file iPenaltyMedianRootPrior.cc.

Here is the call graph for this function:

Member Function Documentation

◆ BuildNeighborhoodKernel()

int iPenaltyMedianRootPrior::BuildNeighborhoodKernel ( )
private

A function used to build the neighborhood kernel.

This function build the table m2p_neighborhoodKernel, that prepare neighborhood indices operations. It is called only one time at initialization. The kernel will be used when computing the specific neighborhood of any voxel later on.

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

Definition at line 277 of file iPenaltyMedianRootPrior.cc.

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

◆ BuildSpecificNeighborhood()

int iPenaltyMedianRootPrior::BuildSpecificNeighborhood ( INTNB  a_voxel,
int  a_th 
)
private

Definition at line 410 of file iPenaltyMedianRootPrior.cc.

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

◆ CheckSpecificParameters()

int iPenaltyMedianRootPrior::CheckSpecificParameters ( )
privatevirtual

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 of the mother class. It is the implementation of the pure virtual function inherited from the abstract mother class vPenalty.

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

Implements vPenalty.

Definition at line 197 of file iPenaltyMedianRootPrior.cc.

◆ ComputeFirstDerivative()

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

Implementation of the pure virtual vPenalty::ComputeFirstDerivative()

Parameters
inta_tbf
inta_rbf
inta_cbf
INTNBa_voxel
inta_th

This function computes the first derivative of the penalty. It is the implementation of the pure virtual vPenalty::ComputeFirstDerivative().

Returns
The derivative

Implements vPenalty.

Definition at line 527 of file iPenaltyMedianRootPrior.cc.

◆ ComputeMedianInNeighborhood()

int iPenaltyMedianRootPrior::ComputeMedianInNeighborhood ( int  a_tbf,
int  a_rbf,
int  a_cbf,
INTNB  a_voxel,
int  a_th 
)
private

A private function computing the median in the neighborhood of the provided index.

Parameters
inta_tbf
inta_rbf
inta_cbf
INTNBa_voxel
inta_th

This function sorts the values of neighbors and store the median in the m2p_medianValue table for the current thread.

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

Definition at line 476 of file iPenaltyMedianRootPrior.cc.

Here is the caller graph for this function:

◆ ComputePenaltyValue()

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

Implementation of the pure virtual vPenalty::ComputePenaltyValue()

Parameters
inta_tbf
inta_rbf
inta_cbf
INTNBa_voxel
inta_th

This function computes the value of the penalty function for the provided indices. It is the implementation of the pure virtual vPenalty::ComputePenaltyValue().

Returns
The penalty value

Implements vPenalty.

Definition at line 510 of file iPenaltyMedianRootPrior.cc.

◆ ComputeSecondDerivative()

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

Implementation of the pure virtual vPenalty::ComputeSecondDerivative()

Parameters
inta_tbf
inta_rbf
inta_cbf
INTNBa_voxel
inta_th

This function computes the second derivative of the penalty. It is the implementation of the pure virtual vPenalty::ComputeSecondDerivative().

Returns
The derivative

Implements vPenalty.

Definition at line 542 of file iPenaltyMedianRootPrior.cc.

◆ InitializeSpecific()

int iPenaltyMedianRootPrior::InitializeSpecific ( )
privatevirtual

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

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 vPenalty.

Definition at line 225 of file iPenaltyMedianRootPrior.cc.

Here is the call graph for this function:

◆ LocalPreProcessingStep()

int iPenaltyMedianRootPrior::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_tbf
inta_rbf
inta_cbf
INTNBa_voxel
inta_th

This function overloads the mother class function that does nothing. The idea here is to build the specific neighborhood of the given voxel.

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

Reimplemented from vPenalty.

Definition at line 453 of file iPenaltyMedianRootPrior.cc.

Here is the call graph for this function:

◆ ReadConfigurationFile()

int iPenaltyMedianRootPrior::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 penalty, from a configuration file. It is the implementation of the pure virtual function inherited from the abstract class vPenalty. 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 vPenalty.

Definition at line 119 of file iPenaltyMedianRootPrior.cc.

Here is the call graph for this function:

◆ ReadOptionsList()

int iPenaltyMedianRootPrior::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 penalty, from a list of options. It is the implementation of the pure virtual function inherited from the abstract class vPenalty. 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 vPenalty.

Definition at line 185 of file iPenaltyMedianRootPrior.cc.

◆ ShowHelpSpecific()

void iPenaltyMedianRootPrior::ShowHelpSpecific ( )
privatevirtual

A function used to show help about the child penalty.

This function must describe what the module 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 the implementation of the pure virtual function inherited from the abstract class vPenalty. It is called by the public ShowHelp() function.

Implements vPenalty.

Definition at line 94 of file iPenaltyMedianRootPrior.cc.

Member Data Documentation

◆ m2p_neighborhoodIndices

INTNB** iPenaltyMedianRootPrior::m2p_neighborhoodIndices
private

Neighborhood indices of a specific voxel. First index is on the threads, second one contains the list of the voxels in the neighborhood (as many as m_neighborhoodMaxNbVoxels). It follows strictly the same order than m2p_neighborhoodKernel, with the convention -1: out of image boundaries

Definition at line 228 of file iPenaltyMedianRootPrior.hh.

◆ m2p_neighborhoodKernel

INTNB** iPenaltyMedianRootPrior::m2p_neighborhoodKernel
private

Neighborhood of a virtual voxel of coordinates 0, 0, 0 without boundary. First index on neighboring voxels, second one on indexes

Definition at line 226 of file iPenaltyMedianRootPrior.hh.

◆ m_neighborhoodBoxExcludeCorners

int iPenaltyMedianRootPrior::m_neighborhoodBoxExcludeCorners
private

In case of a box neighborhood, remove the corners as in some papers, or not (keep them by default)

Definition at line 224 of file iPenaltyMedianRootPrior.hh.

◆ m_neighborhoodBoxOrder

int iPenaltyMedianRootPrior::m_neighborhoodBoxOrder
private

In case of a box neighborhood, order of the box

Definition at line 223 of file iPenaltyMedianRootPrior.hh.

◆ m_neighborhoodMaxNbVoxels

INTNB iPenaltyMedianRootPrior::m_neighborhoodMaxNbVoxels
private

Maximum number of voxels in the neighborhood

Definition at line 225 of file iPenaltyMedianRootPrior.hh.

◆ m_neighborhoodShape

int iPenaltyMedianRootPrior::m_neighborhoodShape
private

Type of neighborhood (sphere, box)

Definition at line 221 of file iPenaltyMedianRootPrior.hh.

◆ m_neighborhoodSphereRadius

FLTNB iPenaltyMedianRootPrior::m_neighborhoodSphereRadius
private

In case of a spherical neighborhood, radius of the sphere

Definition at line 222 of file iPenaltyMedianRootPrior.hh.

◆ mp_medianValue

FLTNB* iPenaltyMedianRootPrior::mp_medianValue
private

Used to store the median value of the neighborhood, per thread

Definition at line 230 of file iPenaltyMedianRootPrior.hh.

◆ mp_neighborhoodNbVoxels

INTNB* iPenaltyMedianRootPrior::mp_neighborhoodNbVoxels
private

Number of voxels in a specific neighborhood. The index is on threads

Definition at line 227 of file iPenaltyMedianRootPrior.hh.


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