CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
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_VOXEL 1
24 #define MRF_PROXIMITY_EUCLIDIAN 2
25 #define MRF_PROXIMITY_GAUSSIAN 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);
116  FLTNB ComputePenaltyValue(FLTNB* ap_image, INTNB a_voxel, int a_th);
127  FLTNB ComputeFirstDerivative(FLTNB* ap_image, INTNB a_voxel, int a_th);
138  FLTNB ComputeSecondDerivative(FLTNB* ap_image, INTNB a_voxel, int a_th);
150  int BuildSpecificNeighborhood(INTNB a_voxel, int a_th);
151 
152  // -------------------------------------------------------------------
153  // Public Get & Set functions
154  public:
159  inline int GetPotentialType() {return m_potentialType;}
170  inline FLTNB* GetSimilarityFactors(int a_th) {return m2p_similarityFactors[a_th];}
181 
182  // -------------------------------------------------------------------
183  // Private member functions
184  private:
194  void ShowHelpSpecific();
211  int InitializeSpecific();
227  int BuildProximityFactors();
239  int ComputeSimilarityFactors(int a_tbf, int a_rbf, int a_cbf, INTNB a_voxel, int a_th);
240 
241  // -------------------------------------------------------------------
242  // Data members
243  private:
244  // Potential functions
245  int m_potentialType;
251  // Proximity factors
252  int m_proximityType;
255  // Similarity factors
256  int m_similarityType;
260  // Neighborhood
261  int m_neighborhoodShape;
270 };
271 
272 // Class for automatic insertion (set here the visible optimizer's name as the first parameter,
273 // put the class name as the second parameter and do NOT add semi-colon at the end of the line)
275 
276 #endif
277 
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)
Declaration of class vPenalty.
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.