CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vPenalty.hh
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2018 all CASToR contributors listed below:
18 
19  --> current contributors: Thibaut MERLIN, Simon STUTE, Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Mael MILLARDET
20  --> past contributors: Valentin VIELZEUF
21 
22 This is CASToR version 2.0.
23 */
24 
31 #ifndef VPENALTY_HH
32 #define VPENALTY_HH 1
33 
34 #include "gVariables.hh"
36 
46 class vPenalty
47 {
48  // -------------------------------------------------------------------
49  // Constructor & Destructor
50  public:
57  vPenalty();
65  virtual ~vPenalty();
66 
67 
68  // -------------------------------------------------------------------
69  // Public member functions
70  public:
71 
72 
73  // -------------------------------------------------------------------
74  // Public Get & Set functions
75  public:
81  inline void SetVerbose(int a_verbose)
82  {m_verbose = a_verbose;}
88  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
89  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
90  /*
91  inline int GetPenaltyEnergyFunctionDerivativesOrder()
92  {return m_penaltyEnergyFunctionDerivativesOrder;}
93  */
94 
95 
96  // -------------------------------------------------------------------
97  // Private member functions
98  private:
99 
100 
101  // -------------------------------------------------------------------
102  // Data members
103  protected:
104  // Image dimensions
107  // Verbosity
108  int m_verbose;
109  // Order of penalty energy function derivatives
110  //int m_penaltyEnergyFunctionDerivativesOrder; /*!< The derivative order of the penalty function */
111 };
112 
113 
114 // ---------------------------------------------------------------------
115 // Part of code that manages the auto declaration of children classes
116 // ---------------------------------------------------------------------
117 
118 // Macro for the function that creates the object
119 #define FUNCTION_PENALTY(CLASS) \
120  static vPenalty *make_penalty() { return new CLASS(); };
121 
122 // Macro for the class that links the appropriate function to the map of objects
123 #define CLASS_PENALTY(NAME,CLASS) \
124  class NAME##PenaltyCreator \
125  { \
126  public: \
127  NAME##PenaltyCreator() \
128  { sAddonManager::GetInstance()->mp_listOfPenalties[#NAME] = CLASS::make_penalty; } \
129  }; \
130  static NAME##PenaltyCreator PenaltyCreator##NAME;
131 
132 #endif
This header file is mainly used to declare some macro definitions and all includes needed from the st...
Declaration of class oImageDimensionsAndQuantification.
int m_verbose
Definition: vPenalty.hh:108
vPenalty()
The constructor of vPenalty.
Definition: vPenalty.cc:39
virtual ~vPenalty()
The destructor of vPenalty.
Definition: vPenalty.cc:51
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
Definition: vPenalty.hh:106
This class is designed to generically described any penalty applied to MAP algorithms.
Definition: vPenalty.hh:46
void SetVerbose(int a_verbose)
Set the verbose level.
Definition: vPenalty.hh:81
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use.
Definition: vPenalty.hh:88
This class is designed to manage all dimensions and quantification related stuff. ...