CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
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-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
30 #ifndef VIMAGEPROCESSINGMODULE_HH
31 #define VIMAGEPROCESSINGMODULE_HH 1
32 
33 #include "gVariables.hh"
35 #include "oImageSpace.hh"
36 
53 {
54  // -----------------------------------------------------------------------------------------
55  // Constructor & Destructor
56  public:
71  virtual ~vImageProcessingModule();
72 
73  // -----------------------------------------------------------------------------------------
74  // Public member functions
75  public:
84  int CheckParameters();
94  int Initialize();
95 
96 
97  // -----------------------------------------------------------------------------------------
98  // Pure virtual public member functions that need to be implemented by children
99  public:
110  virtual int ReadConfigurationFile(const string& a_configurationFile) = 0;
121  virtual int ReadOptionsList(const string& a_optionsList) = 0;
130  virtual void ShowHelp() = 0;
142  virtual int Process(FLTNB**** a4p_image) = 0;
143 
144 
145  // -----------------------------------------------------------------------------------------
146  // Pure virtual private member functions that need to be implemented by children
147  private:
156  virtual int CheckSpecificParameters() = 0;
166  virtual int InitializeSpecific() = 0;
167 
168 
169  // -----------------------------------------------------------------------------------------
170  // Public Get & Set functions
171  public:
177  inline void SetVerbose(int a_verbose)
178  {m_verbose = a_verbose;}
184  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
185  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;}
192  {return m_affectTimeDimensionFlag;}
199  {return m_affectRespDimensionFlag;}
206  {return m_affectCardDimensionFlag;}
207 
208 
209  // -----------------------------------------------------------------------------------------
210  // Data members
211  protected:
217  bool m_checked;
219  int m_verbose;
220 };
221 
222 
223 // ----------------------------------------------------------------------
224 // Part of code that manages the auto declaration of children classes
225 // ----------------------------------------------------------------------
226 
227 // Macro for the function that creates the object
228 #define FUNCTION_IMAGE_PROCESSING_MODULE(CLASS) \
229  static vImageProcessingModule *make_image_processing_module() { return new CLASS(); };
230 
231 // Macro for the class that links the appropriate function to the map of objects
232 #define CLASS_IMAGE_PROCESSING_MODULE(NAME,CLASS) \
233  class NAME##ImageProcessingModuleCreator \
234  { \
235  public: \
236  NAME##ImageProcessingModuleCreator() \
237  { sAddonManager::GetInstance()->mp_listOfImageProcessingModules[#NAME] = CLASS::make_image_processing_module; } \
238  }; \
239  static NAME##ImageProcessingModuleCreator ImageProcessingModuleCreator##NAME;
240 
241 #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.