CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
oDeformationManager.hh
Go to the documentation of this file.
1 
9 #ifndef ODEFORMATIONMANAGER_HH
10 #define ODEFORMATIONMANAGER_HH 1
11 
12 #include "gVariables.hh"
13 #include "vDeformation.hh"
14 #include "vDataFile.hh"
15 
16 // =====================================================================
17 // ---------------------------------------------------------------------
18 // ---------------------------------------------------------------------
19 // =====================================================================
28 #define DEF_RESP_MOT 0
29 
30 #define DEF_CARD_MOT 1
31 
32 #define DEF_IPAT_MOT 2
33 
34 #define DEF_DUAL_MOT 3
35 
37 class vDataFile;
38 
39 
40 
52 {
53  // Constructor & Destructor
54  public:
60 
66 
67 
68  // -------------------------------------------------------------------
69  // Public member functions
70  public:
77  int CheckParameters();
84  int Initialize();
105  void InitImageForDeformation(oImageSpace* ap_Image);
106 
107 
108  // -------------------------------------------------------------------
109  // Public Get & Set functions
110  public:
116  inline void SetVerbose(int a_verboseLevel)
117  {m_verbose = a_verboseLevel;}
124  inline void SetDataMode(int a_dataMode)
125  {m_dataMode = a_dataMode;}
131  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
132  {mp_ID = ap_ImageDimensionsAndQuantification;}
139  inline void SetOptions(const string& a_options)
140  {m_options = a_options;}
141 
147  inline void SetNbTransformations(int a_nbTransformations)
148  {m_nbTransformations = a_nbTransformations;}
149 
155  void SetMotionType(int a_motionType);
156 
162  inline bool UseDeformationResp()
163  {return m_UseDeformationResp;}
169  inline bool UseDeformationCard()
170  {return m_UseDeformationCard;}
176  inline bool UseDeformationInv()
177  {return m_UseDeformationIPat;}
184  inline int GetNbSensImagesRespDeformation(int a_value)
185  {if (UseDeformationResp()) return 0; else return a_value;}
192  inline int GetNbSensImagesCardDeformation(int a_value)
193  {if (UseDeformationCard()) return 0; else return a_value;}
194 
195 
196  // -------------------------------------------------------------------
197  // Deformation functions
212  int ApplyDeformationForSensitivityGeneration(oImageSpace* ap_Image, int a_defDirection, int fr, int rg, int cg);
231  int PerformDeformation(oImageSpace* ap_Image);
232 
233 
234  // -------------------------------------------------------------------
235  // Private member functions
236  private:
250 
251 
252  // -------------------------------------------------------------------
253  // Data members
254  private:
255  // Image dimensions
257  // Options for each deformation type
258  string m_options;
260  // Deformation objects and associated bool
266  // Variable indicating the current gate/index of the motion
269  // Number of gates for cyclic motion
272  // Verbose level
273  int m_verbose;
274  // Data mode
276  // Has been checked ?
277  bool m_checked;
278  // Has been initialized ?
280 };
281 
282 #endif
int GetNbSensImagesCardDeformation(int a_value)
return the required number of cardiac images in the sensitivity image depending on the cardiac deform...
int ApplyDeformationForSensitivityGeneration(oImageSpace *ap_Image, int a_defDirection, int fr, int rg, int cg)
Apply deformations during the list-mode sensitivity image generation.
This class is designed to be a mother virtual class for Datafile.
Definition: vDataFile.hh:67
This header file is mainly used to declare some macro definitions and all includes needed from the st...
int GetNbSensImagesRespDeformation(int a_value)
return the required number of respiratory images in the sensitivity image depending on the respirator...
int PerformDeformation(oImageSpace *ap_Image)
Apply deformations during reconstruction.
oImageDimensionsAndQuantification * mp_ID
int ParseOptionsAndInitializeDeformations()
Parse respiratory/cardiac/involuntary patient motion options contained in the previously provided str...
bool UseDeformationInv()
Indicate if the involuntary patient motion deformation is enabled.
void SetMotionType(int a_motionType)
Set the nature of motion correction (Deformation type macro)
void SetDataMode(int a_dataMode)
Set the mode of reconstruction.
int ApplyDeformationsToBackwardImage(oImageSpace *ap_Image)
Apply final backward deformations on the backward image.
bool UseDeformationCard()
Indicate if the cardiac motion deformation is enabled.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the image dimensions in use.
Declaration of class vDataFile.
This is the mother class of image-based transformation class.
Definition: vDeformation.hh:44
void InstantiateImageForDeformation(oImageSpace *ap_Image)
If deformation is enabled, ask the Image Space to Instantiate the temporary backward image for deform...
Declaration of class vDeformation.
int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
void SetVerbose(int a_verboseLevel)
Set the verbose level.
void InitImageForDeformation(oImageSpace *ap_Image)
If deformation is enabled, ask the Image Space to initialize the temporary backward image for deforma...
This class is designed to manage the image-based deformation part of the reconstruction.
~oDeformationManager()
Destructor of oDeformationManager. Free memory from all allocated tabs.
bool UseDeformationResp()
Indicate if the respiratory motion deformation is enabled.
int Initialize()
Set the flags for the different motion types and instanciate/initialize deformation objects through t...
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. ...
oDeformationManager()
Constructor of oDeformationManager. Simply set all data members to default values.
vDeformation * mp_Deformation
void SetNbTransformations(int a_nbTransformations)
Set the total number of transformations/deformations.
void DeallocateImageForDeformation(oImageSpace *ap_Image)
If deformation is enabled, ask the Image Space to free memory of the temporary backward image for def...
void SetOptions(const string &a_options)
Set the motion options contained in the provided string, and the related number of gates...