CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
vDeformation.hh
Go to the documentation of this file.
1 
9 #ifndef VDEFORMATION_HH
10 #define VDEFORMATION_HH 1
11 
12 #include "gVariables.hh"
13 
14 // These definitions are used to simply discriminate between forward and backward deformation
15 #define FORWARD_DEFORMATION 0
16 #define BACKWARD_DEFORMATION 1
17 
18 class oImageSpace;
20 
21 
45 {
46  // -----------------------------------------------------------------------------------------
47  // Constructor & Destructor
48  public:
53  vDeformation();
58  virtual ~vDeformation();
59 
60 
61  // -----------------------------------------------------------------------------------------
62  // Public member functions
63  public:
69  inline void SetImageDimensionsAndQuantification( oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification )
70  {mp_ID = ap_ImageDimensionsAndQuantification;}
76  inline void SetVerbose( int a_verbose )
77  {m_verbose = a_verbose;}
84  inline void SetNbTransformations( int a_nbTransformations )
85  {m_nbTransformations = a_nbTransformations;}
92  virtual int CheckParameters();
99  virtual int CheckSpecificParameters() = 0;
107  virtual int ReadAndCheckConfigurationFile( const string& a_fileOptions ) = 0;
115  virtual int ReadAndCheckOptionsList( const string& a_listOptions ) = 0;
122  virtual int Initialize() = 0;
128  virtual void ShowHelp() = 0;
129 
130 
131  // -----------------------------------------------------------------------------------------
132  // Reconstruction deformation function
133  public:
148  virtual int PerformDeformation( oImageSpace* ap_Image, int a_defIdx, int fr, int rimg, int cimg );
162  virtual int PerformHistoSensitivityDeformation( oImageSpace* ap_Image, int a_defIdx, int fr, int rimg, int cimg );
173  virtual int ApplyDeformationsToBackwardImage( oImageSpace* ap_Image, int a_defIdx );
184  virtual int ApplyDeformationsToHistoSensitivityImage( oImageSpace* ap_Image, int a_defIdx );
199  virtual int PerformSensitivityDeformation( oImageSpace* ap_Image, int a_defDirection, int a_defIdx, int fr, int rg, int cg );
210  virtual int ApplyDeformations( FLTNB* ap_inputImage, FLTNB* ap_outputImage, int a_direction, int a_defIdx ) = 0;
211 
212 
213  // -----------------------------------------------------------------------------------------
214  // Data members
215  protected:
217  int m_verbose;
219  int m_checked;
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_DEFORMATION(CLASS) \
230  static vDeformation *make_deformation() { return new CLASS(); };
231 
232 // Macro for the class that links the appropriate function to the map of objects
233 #define CLASS_DEFORMATION(NAME,CLASS) \
234  class NAME##DeformationCreator \
235  { \
236  public: \
237  NAME##DeformationCreator() \
238  { sAddonManager::GetInstance()->mp_listOfDeformations[#NAME] = CLASS::make_deformation; } \
239  }; \
240  static NAME##DeformationCreator DeformationCreator##NAME;
241 
242 #endif
void SetVerbose(int a_verbose)
Set the verbose level.
Definition: vDeformation.hh:76
This header file is mainly used to declare some macro definitions and all includes needed from the st...
vDeformation()
Constructor of vDeformation. Simply set all data members to default values.
Definition: vDeformation.cc:31
virtual ~vDeformation()
Destructor of vDeformation.
Definition: vDeformation.cc:51
oImageDimensionsAndQuantification * mp_ID
#define FLTNB
Definition: gVariables.hh:55
void SetNbTransformations(int a_nbTransformations)
Set the number of transformation in the data to be performed on the dataset (equal to the number of g...
Definition: vDeformation.hh:84
int m_nbTransformations
virtual int ReadAndCheckConfigurationFile(const string &a_fileOptions)=0
This function is used to read options from a configuration file. It is pure virtual so must be impl...
virtual int PerformHistoSensitivityDeformation(oImageSpace *ap_Image, int a_defIdx, int fr, int rimg, int cimg)
Apply deformations on the sensitivity image during reconstruction in histogram mode.
virtual int Initialize()=0
This function is used to initialize specific data related to the child deformation model...
virtual int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
Definition: vDeformation.cc:66
virtual int ApplyDeformationsToBackwardImage(oImageSpace *ap_Image, int a_defIdx)
Apply backward transformation of the backward image to the reference position.
virtual int ApplyDeformations(FLTNB *ap_inputImage, FLTNB *ap_outputImage, int a_direction, int a_defIdx)=0
This function prepares the deformation to perform It is a virtual pure deformation function to be i...
virtual int PerformDeformation(oImageSpace *ap_Image, int a_defIdx, int fr, int rimg, int cimg)
Apply deformations during reconstruction.
This is the mother class of image-based transformation class.
Definition: vDeformation.hh:44
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the image dimensions in use.
Definition: vDeformation.hh:69
virtual int PerformSensitivityDeformation(oImageSpace *ap_Image, int a_defDirection, int a_defIdx, int fr, int rg, int cg)
Apply image deformations during sensitivity image generation for list-mode.
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 ReadAndCheckOptionsList(const string &a_listOptions)=0
This function is used to read parameters from a string. It is pure virtual so must be implemented b...
virtual int CheckSpecificParameters()=0
This function is used to check the parameters of the child functions before initialization if require...
virtual int ApplyDeformationsToHistoSensitivityImage(oImageSpace *ap_Image, int a_defIdx)
Apply backward transformations of the sensitivity image to the reference position (histogram mode) ...
virtual void ShowHelp()=0
This function is used to print out specific help about the deformation and its options. It is pure virtual so must be implemented by children.