CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
code/include/optimizer/iPenaltyMarkovRandomField.hh
Go to the documentation of this file.
1 
8 #ifndef IPENALTYMARKOVRANDOMFIELD_HH
9 #define IPENALTYMARKOVRANDOMFIELD_HH 1
10 
11 #include "vPenalty.hh"
12 #include "sAddonManager.hh"
13 #include "sOutputManager.hh"
14 
15 #define MRF_POTENTIAL_QUADRATIC 0
16 #define MRF_POTENTIAL_RELATIVE_DIFFERENCE 1
17 #define MRF_POTENTIAL_GEMAN_MCCLURE 2
18 #define MRF_POTENTIAL_GREEN 3
19 #define MRF_POTENTIAL_HEBERT_LEAHY 4
20 #define MRF_POTENTIAL_HUBER 5
21 
22 #define MRF_PROXIMITY_NONE 0
23 #define MRF_PROXIMITY_EUCLIDIAN 1
24 #define MRF_PROXIMITY_VOXEL 2
25 //#define MRF_PROXIMITY_EXP_DIST_SQUARED 3
26 
27 #define MRF_SIMILARITY_NONE 0
28 #define MRF_SIMILARITY_BOWSHER 1
29 
30 #define MRF_NEIGHBORHOOD_SPHERE 0
31 #define MRF_NEIGHBORHOOD_BOX 1
32 #define MRF_NEIGHBORHOOD_6_NEAREST 2
33 
34 #define MRF_NOT_DEFINED -1
35 
36 #define MRF_NEIGHBOR_X 0
37 #define MRF_NEIGHBOR_Y 1
38 #define MRF_NEIGHBOR_Z 2
39 
46 {
47  // -------------------------------------------------------------------
48  // Constructor & Destructor
49  public:
50 
65 
66  // -------------------------------------------------------------------
67  // Public member functions
68  public:
69  // Function for automatic insertion (put the class name as the parameter and do not add semi-column at the end of the line)
81  int ReadConfigurationFile(const string& a_configurationFile);
92  int ReadOptionsList(const string& a_optionsList);
105  int LocalPreProcessingStep(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th);
118  FLTNB ComputePenaltyValue(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th);
131  FLTNB ComputeFirstDerivative(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th);
144  FLTNB ComputeSecondDerivative(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th);
156  int BuildSpecificNeighborhood(INTNB a_voxel, int a_th);
157 
158  // -------------------------------------------------------------------
159  // Public Get & Set functions
160  public:
165  inline int GetPotentialType() {return m_potentialType;}
176  inline FLTNB* GetSimilarityFactors(int a_th) {return m2p_similarityFactors[a_th];}
187 
188  // -------------------------------------------------------------------
189  // Private member functions
190  private:
200  void ShowHelpSpecific();
217  int InitializeSpecific();
233  int BuildProximityFactors();
245  int ComputeSimilarityFactors(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th);
246 
247  // -------------------------------------------------------------------
248  // Data members
249  private:
250  // Potential functions
257  // Proximity factors
261  // Similarity factors
266  // Neighborhood
275 };
276 
277 // Class for automatic insertion (set here the visible optimizer's name as the first parameter,
278 // put the class name as the second parameter and do NOT add semi-colon at the end of the line)
280 
281 #endif
282 
This class implements the general Markov Random Field kind of penalties.
int BuildProximityFactors()
A function used to build the kernel of the proximity factors.
int LocalPreProcessingStep(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
FLTNB ComputeSecondDerivative(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
int ReadConfigurationFile(const string &a_configurationFile)
FLTNB ComputeFirstDerivative(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
int InitializeSpecific()
This function is used to initialize specific stuff to the child penalty.
#define CLASS_PENALTY(NAME, CLASS)
#define FUNCTION_PENALTY(CLASS)
iPenaltyMarkovRandomField()
The constructor of iPenaltyMarkovRandomField.
This class is designed to generically described any penalty applied to MAP algorithms.
FLTNB ComputePenaltyValue(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
int ComputeSimilarityFactors(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th)
~iPenaltyMarkovRandomField()
The destructor of iPenaltyMarkovRandomField.
int CheckSpecificParameters()
A private function used to check the parameters settings specific to the child penalty.
int BuildNeighborhoodKernel()
A function used to build the neighborhood kernel.
void ShowHelpSpecific()
A function used to show help about the child penalty.
Declaration of class vPenalty.