CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
include/image/vImageConvolver.hh
Go to the documentation of this file.
1 
8 #ifndef VIMAGECONVOLVER_HH
9 #define VIMAGECONVOLVER_HH 1
10 
11 #include "gVariables.hh"
12 #include "gOptions.hh"
13 
14 class oImageSpace;
16 
35 class vImageConvolver
36 {
37  // -----------------------------------------------------------------------------------------
38  // Constructor & Destructor
39  public:
54  virtual ~vImageConvolver();
55 
56 
57  // -----------------------------------------------------------------------------------------
58  // Public member functions
59  public:
68  int CheckParameters();
78  int Initialize();
89  int ApplyConvolution(FLTNB* ap_image);
101  int ApplyConvolutionTranspose(FLTNB* ap_image);
102 
103 
104  // -----------------------------------------------------------------------------------------
105  // Private member functions
106  protected:
114  void CopyToPaddedImage(FLTNB* ap_inputImage);
115  private:
126  virtual int Convolve(FLTNB* ap_outputImage);
138  virtual int ConvolveTranspose(FLTNB* ap_outputImage);
139 
140 
141  // -----------------------------------------------------------------------------------------
142  // Pure virtual public member functions that need to be implemented by children
143  public:
154  virtual int ReadConfigurationFile(const string& a_fileOptions) = 0;
165  virtual int ReadOptionsList(const string& a_listOptions) = 0;
174  virtual void ShowHelp() = 0;
175 
176 
177  // -----------------------------------------------------------------------------------------
178  // Pure virtual private member functions that need to be implemented by children
179  private:
188  virtual int CheckSpecificParameters() = 0;
200  virtual int BuildConvolutionKernel() = 0;
201 
202 
203  // -----------------------------------------------------------------------------------------
204  // Public Get & Set functions
205  public:
211  inline void SetVerbose(int a_verbose)
212  {m_verbose = a_verbose;}
218  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
219  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
220 
221  // -----------------------------------------------------------------------------------------
222  // Data members
223  protected:
224  // Standards
227  int m_verbose;
228  // Booleans
229  bool m_checked;
230  bool m_initialized;
231  bool m_stationary;
232  // Padded image
234  INTNB m_offsetX;
235  INTNB m_offsetY;
236  INTNB m_offsetZ;
237  INTNB m_dimPadX;
238  INTNB m_dimPadY;
239  INTNB m_dimPadZ;
240  INTNB m_dimPadXY;
242  // Convolution kernel
247  FLTNB** m2p_kernel;
248 };
249 
250 
251 // ----------------------------------------------------------------------
252 // Part of code that manages the auto declaration of children classes
253 // ----------------------------------------------------------------------
254 
255 // Macro for the function that creates the object
256 #define FUNCTION_IMAGE_CONVOLVER(CLASS) \
257  static vImageConvolver *make_image_convolver() { return new CLASS(); };
258 
259 // Macro for the class that links the appropriate function to the map of objects
260 #define CLASS_IMAGE_CONVOLVER(NAME,CLASS) \
261  class NAME##ImageConvolverCreator \
262  { \
263  public: \
264  NAME##ImageConvolverCreator() \
265  { sAddonManager::GetInstance()->mp_listOfImageConvolvers[#NAME] = CLASS::make_image_convolver; } \
266  }; \
267  static NAME##ImageConvolverCreator ImageConvolverCreator##NAME;
268 
269 #endif
void SetVerbose(int a_verbose)
virtual int ConvolveTranspose(FLTNB *ap_outputImage)
int Initialize()
A public function used to initialize the module.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
virtual int ReadConfigurationFile(const string &a_fileOptions)=0
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
virtual int BuildConvolutionKernel()=0
A private function used to build the convolution kernel specific to the child convolver.
virtual int ReadOptionsList(const string &a_listOptions)=0
int CheckParameters()
A public function used to check the parameters settings.
virtual void ShowHelp()=0
A function used to show help about the child module.
int ApplyConvolutionTranspose(FLTNB *ap_image)
virtual ~vImageConvolver()
The destructor of vImageConvolver.
vImageConvolver()
The constructor of vImageConvolver.
int ApplyConvolution(FLTNB *ap_image)
virtual int CheckSpecificParameters()=0
A private function used to check the parameters settings specific to the child convolver.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
This class is designed to manage all dimensions and quantification related stuff. ...
virtual int Convolve(FLTNB *ap_outputImage)
void CopyToPaddedImage(FLTNB *ap_inputImage)
This abstract class is the generic image convolver class used by the oImageConvolverManager.