CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
vImageProcessingModule.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 VIMAGEPROCESSINGMODULE_HH
32 #define VIMAGEPROCESSINGMODULE_HH 1
33 
34 #include "gVariables.hh"
36 #include "oImageSpace.hh"
37 
54 {
55  // -----------------------------------------------------------------------------------------
56  // Constructor & Destructor
57  public:
72  virtual ~vImageProcessingModule();
73 
74  // -----------------------------------------------------------------------------------------
75  // Public member functions
76  public:
85  int CheckParameters();
95  int Initialize();
96 
97 
98  // -----------------------------------------------------------------------------------------
99  // Pure virtual public member functions that need to be implemented by children
100  public:
111  virtual int ReadConfigurationFile(const string& a_configurationFile) = 0;
122  virtual int ReadOptionsList(const string& a_optionsList) = 0;
131  virtual void ShowHelp() = 0;
143  virtual int Process(FLTNB**** a4p_image) = 0;
144 
145 
146  // -----------------------------------------------------------------------------------------
147  // Pure virtual private member functions that need to be implemented by children
148  private:
157  virtual int CheckSpecificParameters() = 0;
167  virtual int InitializeSpecific() = 0;
168 
169 
170  // -----------------------------------------------------------------------------------------
171  // Public Get & Set functions
172  public:
178  inline void SetVerbose(int a_verbose)
179  {m_verbose = a_verbose;}
185  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
186  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
193  {return m_affectTimeDimensionFlag;}
200  {return m_affectRespDimensionFlag;}
207  {return m_affectCardDimensionFlag;}
208 
209 
210  // -----------------------------------------------------------------------------------------
211  // Data members
212  protected:
218  bool m_checked;
220  int m_verbose;
221 };
222 
223 
224 // ----------------------------------------------------------------------
225 // Part of code that manages the auto declaration of children classes
226 // ----------------------------------------------------------------------
227 
228 // Macro for the function that creates the object
229 #define FUNCTION_IMAGE_PROCESSING_MODULE(CLASS) \
230  static vImageProcessingModule *make_image_processing_module() { return new CLASS(); };
231 
232 // Macro for the class that links the appropriate function to the map of objects
233 #define CLASS_IMAGE_PROCESSING_MODULE(NAME,CLASS) \
234  class NAME##ImageProcessingModuleCreator \
235  { \
236  public: \
237  NAME##ImageProcessingModuleCreator() \
238  { sAddonManager::GetInstance()->mp_listOfImageProcessingModules[#NAME] = CLASS::make_image_processing_module; } \
239  }; \
240  static NAME##ImageProcessingModuleCreator ImageProcessingModuleCreator##NAME;
241 
242 #endif
This header file is mainly used to declare some macro definitions and all includes needed from the st...
Declaration of class oImageDimensionsAndQuantification.
#define FLTNB
Definition: gVariables.hh:81
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the member mp_ImageDimensionsAndQuantification to the provided value.
bool GetAffectCardDimensionFlag()
Return the boolean value of m_affectCardDimensionFlag member.
bool GetAffectTimeDimensionFlag()
Return the boolean value of m_affectTimeDimensionFlag member.
virtual ~vImageProcessingModule()
The destructor of vImageProcessingModule.
virtual int InitializeSpecific()=0
A private function used to initialize everything specific to the child module.
virtual void ShowHelp()=0
A function used to show help about the child module.
int Initialize()
A public function used to initialize the module.
This abstract class is the generic image processing module class used by the oImageProcessingManager...
virtual int CheckSpecificParameters()=0
A private function used to check the parameters settings specific to the child module.
bool GetAffectRespDimensionFlag()
Return the boolean value of m_affectRespDimensionFlag member.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
Declaration of class oImageSpace.
virtual int ReadOptionsList(const string &a_optionsList)=0
A function used to read options from a list of options.
virtual int ReadConfigurationFile(const string &a_configurationFile)=0
A function used to read options from a configuration file.
void SetVerbose(int a_verbose)
Set the member m_verboseLevel to the provided value.
This class is designed to manage all dimensions and quantification related stuff. ...
vImageProcessingModule()
The constructor of vImageProcessingModule.
int CheckParameters()
A public function used to check the parameters settings.
virtual int Process(FLTNB ****a4p_image)=0
A function used to actually perform the processing.