![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
00001 00008 #ifndef VPENALTY_HH 00009 #define VPENALTY_HH 1 00010 00011 #include "gVariables.hh" 00012 #include "oImageDimensionsAndQuantification.hh" 00013 00023 class vPenalty 00024 { 00025 // ------------------------------------------------------------------- 00026 // Constructor & Destructor 00027 public: 00034 vPenalty(); 00042 virtual ~vPenalty(); 00043 00044 00045 // ------------------------------------------------------------------- 00046 // Public member functions 00047 public: 00048 00049 00050 // ------------------------------------------------------------------- 00051 // Public Get & Set functions 00052 public: 00058 inline void SetVerbose(int a_verbose) 00059 {m_verbose = a_verbose;} 00065 inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification) 00066 {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;} 00067 /* 00068 inline int GetPenaltyEnergyFunctionDerivativesOrder() 00069 {return m_penaltyEnergyFunctionDerivativesOrder;} 00070 */ 00071 00072 00073 // ------------------------------------------------------------------- 00074 // Private member functions 00075 private: 00076 00077 00078 // ------------------------------------------------------------------- 00079 // Data members 00080 protected: 00081 // Image dimensions 00082 oImageDimensionsAndQuantification* 00083 mp_ImageDimensionsAndQuantification; 00084 // Verbosity 00085 int m_verbose; 00086 // Order of penalty energy function derivatives 00087 //int m_penaltyEnergyFunctionDerivativesOrder; /*!< The derivative order of the penalty function */ 00088 }; 00089 00090 00091 // --------------------------------------------------------------------- 00092 // Part of code that manages the auto declaration of children classes 00093 // --------------------------------------------------------------------- 00094 00095 // Macro for the function that creates the object 00096 #define FUNCTION_PENALTY(CLASS) \ 00097 static vPenalty *make_penalty() { return new CLASS(); }; 00098 00099 // Macro for the class that links the appropriate function to the map of objects 00100 #define CLASS_PENALTY(NAME,CLASS) \ 00101 class NAME##PenaltyCreator \ 00102 { \ 00103 public: \ 00104 NAME##PenaltyCreator() \ 00105 { sAddonManager::GetInstance()->mp_listOfPenalties[#NAME] = CLASS::make_penalty; } \ 00106 }; \ 00107 static NAME##PenaltyCreator PenaltyCreator##NAME; 00108 00109 #endif