CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
vImageConvolver.hh
Go to the documentation of this file.
1 
9 #ifndef VIMAGECONVOLVER_HH
10 #define VIMAGECONVOLVER_HH 1
11 
12 #include "gVariables.hh"
13 #include "gOptions.hh"
14 
15 class oImageSpace;
17 
18 
38 {
39  // -----------------------------------------------------------------------------------------
40  // Constructor & Destructor
41  public:
56  virtual ~vImageConvolver();
57 
58 
59  // -----------------------------------------------------------------------------------------
60  // Public member functions
61  public:
70  int CheckParameters();
80  int Initialize();
91  int ApplyConvolution(FLTNB* ap_image);
103  int ApplyConvolutionTranspose(FLTNB* ap_image);
104 
105 
106  // -----------------------------------------------------------------------------------------
107  // Private member functions
108  private:
116  void CopyToPaddedImage(FLTNB* ap_inputImage);
127  virtual int Convolve(FLTNB* ap_outputImage);
139  virtual int ConvolveTranspose(FLTNB* ap_outputImage);
140 
141 
142  // -----------------------------------------------------------------------------------------
143  // Pure virtual public member functions that need to be implemented by children
144  public:
155  virtual int ReadConfigurationFile(const string& a_fileOptions) = 0;
166  virtual int ReadOptionsList(const string& a_listOptions) = 0;
175  virtual void ShowHelp() = 0;
176 
177 
178  // -----------------------------------------------------------------------------------------
179  // Pure virtual private member functions that need to be implemented by children
180  private:
189  virtual int CheckSpecificParameters() = 0;
201  virtual int BuildConvolutionKernel() = 0;
202 
203 
204  // -----------------------------------------------------------------------------------------
205  // Public Get & Set functions
206  public:
212  inline void SetVerbose(int a_verbose)
213  {m_verbose = a_verbose;}
219  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
220  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
221 
222  // -----------------------------------------------------------------------------------------
223  // Data members
224  protected:
225  // Standards
228  int m_verbose;
229  // Booleans
230  bool m_checked;
233  // Padded image
243  // Convolution kernel
249 };
250 
251 
252 // ----------------------------------------------------------------------
253 // Part of code that manages the auto declaration of children classes
254 // ----------------------------------------------------------------------
255 
256 // Macro for the function that creates the object
257 #define FUNCTION_IMAGE_CONVOLVER(CLASS) \
258  static vImageConvolver *make_image_convolver() { return new CLASS(); };
259 
260 // Macro for the class that links the appropriate function to the map of objects
261 #define CLASS_IMAGE_CONVOLVER(NAME,CLASS) \
262  class NAME##ImageConvolverCreator \
263  { \
264  public: \
265  NAME##ImageConvolverCreator() \
266  { sAddonManager::GetInstance()->mp_listOfImageConvolvers[#NAME] = CLASS::make_image_convolver; } \
267  }; \
268  static NAME##ImageConvolverCreator ImageConvolverCreator##NAME;
269 
270 #endif
This header file is mainly used to declare some macro definitions and all includes needed from the st...
#define FLTNB
Definition: gVariables.hh:55
virtual int ConvolveTranspose(FLTNB *ap_outputImage)
A private function used to apply the transpose convolution on the padded image to the provided output...
int Initialize()
A public function used to initialize the module.
virtual int ReadConfigurationFile(const string &a_fileOptions)=0
A function used to read options from a configuration file.
virtual int BuildConvolutionKernel()=0
A private function used to build the convolution kernel specific to the child convolver.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
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)
A public function used to apply the transpose convolution module on the provided image.
virtual ~vImageConvolver()
The destructor of vImageConvolver.
vImageConvolver()
The constructor of vImageConvolver.
#define INTNB
Definition: gVariables.hh:64
int ApplyConvolution(FLTNB *ap_image)
A public function used to apply the convolution module on the provided 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...
Definition: oImageSpace.hh:41
This class is designed to manage all dimensions and quantification related stuff. ...
virtual int Convolve(FLTNB *ap_outputImage)
A private function used to apply the convolution on the padded image to the provided output image...
This file is used for all kind of different functions designed for options parsing and ASCII file rea...
void SetVerbose(int a_verbose)
Set the member m_verboseLevel to the provided value.
virtual int ReadOptionsList(const string &a_listOptions)=0
A function used to read options from a list of options.
void CopyToPaddedImage(FLTNB *ap_inputImage)
A private function used to copy the provided image into the padded buffer.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the member mp_ImageDimensionsAndQuantification to the provided value.
This abstract class is the generic image convolver class used by the oImageConvolverManager.