CASToR
3.0
Tomographic Reconstruction (PET/SPECT/CT)
|
This class implements the general Markov Random Field kind of penalties. More...
#include <iPenaltyMarkovRandomField.hh>
Public Member Functions | |
iPenaltyMarkovRandomField () | |
The constructor of iPenaltyMarkovRandomField. More... | |
~iPenaltyMarkovRandomField () | |
The destructor of iPenaltyMarkovRandomField. 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... | |
int | BuildSpecificNeighborhood (INTNB a_voxel, int a_th) |
Computes the specific neighborhood of a voxel, m2p_neighborhoodIndices, as well as mp_neighborhoodNbVoxels. More... | |
int | GetPotentialType () |
FLTNB * | GetProximityKernel () |
INTNB | GetNeighborhoodMaxNbVoxels () |
INTNB ** | GetNeighborhoodIndices () |
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 | BuildProximityFactors () |
A function used to build the kernel of the proximity factors. More... | |
int | ComputeSimilarityFactors (int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th) |
Computes the similarity factors of this specific voxel with respect to the similarity type used. More... | |
Additional Inherited Members | |
Protected Attributes inherited from vPenalty | |
string | m_penaltyID |
oImageDimensionsAndQuantification * | mp_ImageDimensionsAndQuantification |
oImageSpace * | mp_ImageSpace |
int | m_verbose |
int | m_penaltyDerivativesOrder |
FLTNB | m_penaltyStrength |
This class implements the general Markov Random Field kind of penalties.
This class inherits from vPenalty and implements the general MRF penalties.
Definition at line 67 of file iPenaltyMarkovRandomField.hh.
iPenaltyMarkovRandomField::iPenaltyMarkovRandomField | ( | ) |
The constructor of iPenaltyMarkovRandomField.
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 iPenaltyMarkovRandomField.cc.
iPenaltyMarkovRandomField::~iPenaltyMarkovRandomField | ( | ) |
The destructor of iPenaltyMarkovRandomField.
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 73 of file iPenaltyMarkovRandomField.cc.
|
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.
Definition at line 659 of file iPenaltyMarkovRandomField.cc.
|
private |
A function used to build the kernel of the proximity factors.
This function build the table FLTNB* mp_proximityKernel
Definition at line 804 of file iPenaltyMarkovRandomField.cc.
int iPenaltyMarkovRandomField::BuildSpecificNeighborhood | ( | INTNB | a_voxel, |
int | a_th | ||
) |
Computes the specific neighborhood of a voxel, m2p_neighborhoodIndices, as well as mp_neighborhoodNbVoxels.
INTNB | a_voxel |
int | a_th |
This function computes the specific neighborhood of a voxel, from the neighborhood kernel and the provided index. From the neighborhood kernel that contains indices shifts, it computes the actual voxel indices of each neighbor and check if it is outside of boundaries. It records the index voxel if valid and -1 if not. This function use a thread index to be thread safe during computations.
Definition at line 895 of file iPenaltyMarkovRandomField.cc.
|
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.
Implements vPenalty.
Definition at line 430 of file iPenaltyMarkovRandomField.cc.
|
virtual |
Implementation of the pure virtual vPenalty::ComputeFirstDerivative()
int | a_tbf |
int | a_rbf |
int | a_cbf |
INTNB | a_voxel |
int | a_th |
This function computes the first derivative of the penalty. It is the implementation of the pure virtual vPenalty::ComputeFirstDerivative().
Implements vPenalty.
Definition at line 1092 of file iPenaltyMarkovRandomField.cc.
|
virtual |
Implementation of the pure virtual vPenalty::ComputePenaltyValue()
int | a_tbf |
int | a_rbf |
int | a_cbf |
INTNB | a_voxel |
int | a_th |
This function computes the value of the penalty function for the provided indices. It is the implementation of the pure virtual vPenalty::ComputePenaltyValue().
Implements vPenalty.
Definition at line 1006 of file iPenaltyMarkovRandomField.cc.
|
virtual |
Implementation of the pure virtual vPenalty::ComputeSecondDerivative()
int | a_tbf |
int | a_rbf |
int | a_cbf |
INTNB | a_voxel |
int | a_th |
This function computes the second derivative of the penalty. It is the implementation of the pure virtual vPenalty::ComputeSecondDerivative().
Implements vPenalty.
Definition at line 1187 of file iPenaltyMarkovRandomField.cc.
|
private |
Computes the similarity factors of this specific voxel with respect to the similarity type used.
int | a_tbf |
int | a_rbf |
int | a_cbf |
INTNB | a_voxel |
int | a_th |
Store the results in m2p_similarityFactors
Definition at line 938 of file iPenaltyMarkovRandomField.cc.
|
inline |
Definition at line 202 of file iPenaltyMarkovRandomField.hh.
|
inline |
Definition at line 197 of file iPenaltyMarkovRandomField.hh.
|
inline |
Definition at line 187 of file iPenaltyMarkovRandomField.hh.
|
inline |
Definition at line 192 of file iPenaltyMarkovRandomField.hh.
|
privatevirtual |
This function is used to initialize specific stuff to the child penalty.
It is called by the public Initialize() function from the mother.
Implements vPenalty.
Definition at line 532 of file iPenaltyMarkovRandomField.cc.
|
virtual |
A public function computing a local pre-processing step for the penalty.
int | a_tbf |
int | a_rbf |
int | a_cbf |
INTNB | a_voxel |
int | a_th |
This function overloads the mother class function that does nothing. The idea here is to build the specific neighborhood of the given voxel and to compute all related weights.
Reimplemented from vPenalty.
Definition at line 983 of file iPenaltyMarkovRandomField.cc.
|
virtual |
A function used to read options from a configuration file.
const | string& 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.
Implements vPenalty.
Definition at line 193 of file iPenaltyMarkovRandomField.cc.
|
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 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.
Implements vPenalty.
Definition at line 418 of file iPenaltyMarkovRandomField.cc.
|
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 119 of file iPenaltyMarkovRandomField.cc.
|
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 290 of file iPenaltyMarkovRandomField.hh.
|
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 288 of file iPenaltyMarkovRandomField.hh.
|
private |
Similarity factors of the neighborhood. First index on threads, second on neighboring voxels, as for m2p_neighborhoodIndices
Definition at line 280 of file iPenaltyMarkovRandomField.hh.
|
private |
In case of a box neighborhood, remove the corners as in some papers, or not (keep them by default)
Definition at line 286 of file iPenaltyMarkovRandomField.hh.
|
private |
In case of a box neighborhood, order of the box
Definition at line 285 of file iPenaltyMarkovRandomField.hh.
|
private |
Maximum number of voxels in the neighborhood
Definition at line 287 of file iPenaltyMarkovRandomField.hh.
|
private |
Type of neighborhood (sphere, box)
Definition at line 283 of file iPenaltyMarkovRandomField.hh.
|
private |
In case of a spherical neighborhood, radius of the sphere
Definition at line 284 of file iPenaltyMarkovRandomField.hh.
|
private |
Parameter of the Geman and McClure's potential function
Definition at line 269 of file iPenaltyMarkovRandomField.hh.
|
private |
Parameter of the Green's log-cosh potential function
Definition at line 270 of file iPenaltyMarkovRandomField.hh.
|
private |
Parameter of the Hebert and Leahy's potential function
Definition at line 271 of file iPenaltyMarkovRandomField.hh.
|
private |
Parameter of the piecewise Huber potential function
Definition at line 272 of file iPenaltyMarkovRandomField.hh.
|
private |
Parameter of the relative difference potential function
Definition at line 268 of file iPenaltyMarkovRandomField.hh.
|
private |
Type of the potential function used (e.g. quadratic)
Definition at line 267 of file iPenaltyMarkovRandomField.hh.
|
private |
When the proximity factors are the exponential distance squared, this is the characteristic distance
Definition at line 275 of file iPenaltyMarkovRandomField.hh.
|
private |
Type of weighting based on proximity (e.g. the inverse of the euclidian distance between voxels)
Definition at line 274 of file iPenaltyMarkovRandomField.hh.
|
private |
The number of voxels kept from the Bowsher's threashold
Definition at line 281 of file iPenaltyMarkovRandomField.hh.
|
private |
Percentage of the neighborhood voxels for defining the most similar Bowsher neighbor voxels
Definition at line 279 of file iPenaltyMarkovRandomField.hh.
|
private |
Type of weighting based on similarity (e.g. joint entropy)
Definition at line 278 of file iPenaltyMarkovRandomField.hh.
|
private |
Number of voxels in a specific neighborhood. The index is on threads
Definition at line 289 of file iPenaltyMarkovRandomField.hh.
|
private |
Precomputation of the proximity factors. Index is on neighboring voxels, as for m2p_neighborhoodKernel
Definition at line 276 of file iPenaltyMarkovRandomField.hh.