CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
include/image/oDeformationManager.hh
Go to the documentation of this file.
1 
8 #ifndef ODEFORMATIONMANAGER_HH
9 #define ODEFORMATIONMANAGER_HH 1
10 
11 #include "gVariables.hh"
12 #include "vDeformation.hh"
13 #include "vDataFile.hh"
14 
15 // =====================================================================
16 // ---------------------------------------------------------------------
17 // ---------------------------------------------------------------------
18 // =====================================================================
27 #define DEF_RESP_MOT 0
28 
29 #define DEF_CARD_MOT 1
30 
31 #define DEF_IPAT_MOT 2
32 
33 #define DEF_DUAL_MOT 3
34 
36 class vDataFile;
37 
38 
39 
51 {
52  // Constructor & Destructor
53  public:
59 
65 
66 
67  // -------------------------------------------------------------------
68  // Public member functions
69  public:
76  int CheckParameters();
83  int Initialize();
105  int 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()
186  || UseDeformationInv() ) return 0;
187  else return a_value;}
194  inline int GetNbSensImagesCardDeformation(int a_value)
195  {if (UseDeformationCard()) return 0; else return a_value;}
196 
197  #ifdef CASTOR_OMP
198 
203  inline void SetDeformationRequirement(INTNB a_th)
204  {mp_deformationRequirement[a_th] = true;}
211  inline bool GetDeformationRequirement(INTNB a_th)
212  {return mp_deformationRequirement[a_th];}
218  bool AllThreadsRequireDeformation();
223  void UnsetDeformationRequirements();
224  #endif
225 
226  // -------------------------------------------------------------------
227  // Deformation functions
243  //int ApplyDeformationForSensitivityGeneration(oImageSpace* ap_Image, int a_defDirection, int fr, int rg, int cg);
244  int ApplyDeformationForSensitivityGeneration(oImageSpace* ap_Image, int a_defDirection, int idx, int fr, int rg, int cg);
263  int PerformDeformation(oImageSpace* ap_Image);
273  int TestDeformationOnImage(FLTNB* ap_inputImage, FLTNB* ap_outputImage, int a_direction, int a_defIdx);
274 
275  // -------------------------------------------------------------------
276  // Private member functions
277  private:
291 
292 
293  // -------------------------------------------------------------------
294  // Data members
295  private:
296  // Image dimensions
298  // Options for each deformation type
299  string m_options;
301  // Deformation objects and associated bool
303  bool m_UseDeformationResp;
304  bool m_UseDeformationCard;
305  bool m_UseDeformationIPat;
307  // Variable indicating the current gate/index of the motion
308  int m_curMotIdx;
310  // Number of gates for cyclic motion
311  int m_nbTransformations;
313  // Verbose level
314  int m_verbose;
315  // Data mode
316  int m_dataMode;
317  // Has been checked ?
318  bool m_checked;
319  // Has been initialized ?
320  bool m_initialized;
321  #ifdef CASTOR_OMP
322  bool* mp_deformationRequirement;
324  #endif
325 };
326 
327 #endif
This class is designed to be a mother virtual class for DataFile.
int PerformDeformation(oImageSpace *ap_Image)
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.
Declaration of class vDeformation.
int ApplyDeformationForSensitivityGeneration(oImageSpace *ap_Image, int a_defDirection, int idx, int fr, int rg, int cg)
int ApplyDeformationsToBackwardImage(oImageSpace *ap_Image)
bool UseDeformationCard()
Indicate if the cardiac motion deformation is enabled.
int InitImageForDeformation(oImageSpace *ap_Image)
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
This is the mother class of image-based transformation class.
void InstantiateImageForDeformation(oImageSpace *ap_Image)
int CheckParameters()
This function is used to check parameters after the latter have been all set using Set functions...
This class is designed to manage the image-based deformation part of the reconstruction.
void SetOptions(const string &a_options)
~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...
int TestDeformationOnImage(FLTNB *ap_inputImage, FLTNB *ap_outputImage, int a_direction, int a_defIdx)
This class is designed to manage all dimensions and quantification related stuff. ...
oDeformationManager()
Constructor of oDeformationManager. Simply set all data members to default values.
void SetNbTransformations(int a_nbTransformations)
oImageDimensionsAndQuantification * mp_ID
void DeallocateImageForDeformation(oImageSpace *ap_Image)