CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
oDynamicDataManager.hh
Go to the documentation of this file.
1 
9 #ifndef ODYNAMICDATAMANAGER_HH
10 #define ODYNAMICDATAMANAGER_HH 1
11 
12 #define DYNAMIC_SWITCH_NOTHING 0
13 #define DYNAMIC_SWITCH_CONTINUE 1
14 #define DYNAMIC_SWITCH_DEFORMATION 2
15 
16 #include "gVariables.hh"
17 #include "gOptions.hh"
18 #include "sOutputManager.hh"
19 
21 class vDataFile;
22 
23 
24 
25 
34 {
35  // -------------------------------------------------------------------
36  // Constructor & Destructor
37  public:
47 
48  // -------------------------------------------------------------------
49  // Public member functions
50  public:
64  int InitDynamicData( int a_nbRespGates, int a_nbCardGates, const string& a_pathTo4DDataSplittingFile,
65  int a_rmMCorrFlag, int a_cMmCorrFlag, int a_dmCorrFlag, int a_pMotionCorrFlag );
73  int SetDynamicSpecificQuantificationFactors(FLTNB** a2p_quantificationFactors);
80  int CheckParameters(int64_t a_nbEvents);
99  int DynamicSwitch(int64_t a_index, uint32_t a_time, int a_bed, int a_th);
100 
101  // -------------------------------------------------------------------
102  // Public Get & Set functions
103  public:
109  inline void SetVerbose(int a_verboseLevel)
110  {m_verbose = a_verboseLevel;};
116  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
117  {mp_ID = ap_ImageDimensionsAndQuantification;};
122  inline void SetRespMotionFlagOn()
123  {m_rMotionCorrFlag = true;}
128  inline void SetCardMotionFlagOn()
129  {m_cMotionCorrFlag = true;}
134  inline void SetPMotionFlagOn()
135  {m_pMotionCorrFlag = true;}
140  inline bool IsRespMotionEnabled()
141  {return m_rMotionCorrFlag;}
146  inline bool IsCardMotionEnabled()
147  {return m_cMotionCorrFlag;}
152  inline bool IsPMotionEnabled()
153  {return m_pMotionCorrFlag;}
160  inline int GetCurrentPMotionIndex(int a_th)
161  {return mp_currentPMotionIndex[a_th] ;}
168  inline int GetCurrentTimeFrame(int a_th)
169  {return mp_currentFrameIndex[a_th];}
176  inline int GetCurrentRespGate(int a_th)
177  {return mp_currentRespGateIndex[a_th];}
185  inline int GetCurrentRespImage(int a_th)
186  {return m_rMotionCorrFlag ? 0 : mp_currentRespGateIndex[a_th];}
193  inline int GetCurrentCardGate(int a_th)
194  {return mp_currentCardGateIndex[a_th];}
202  inline int GetCurrentCardImage(int a_th)
203  {return m_cMotionCorrFlag ? 0 : mp_currentCardGateIndex[a_th];}
209  inline int GetSensNbCardGates()
210  {return m_nbCardGates;}
216  inline int GetSensNbRespGates()
217  {return m_nbRespGates;}
224  {return m_nbPMotionTriggers;}
225 
226 
227  // -------------------------------------------------------------------
228  // Private member functions
229  private:
237  int InitDynamicDataGating(const string& a_pathToGateFile);
245  int InitDynamicDataPatientMotion(const string& a_pathToFile);
246 
247 
248 
249  // -------------------------------------------------------------------
250  // Data members
251  private:
253  int m_verbose;
255  // Framing
259  // Respiratory gating
267  // Cardiac gating
275  // Involuntary motion
280 };
281 #endif
int InitDynamicDataGating(const string &a_pathToGateFile)
Initialisation of arrays containing informations about the data splitting and respiratory/cardiac gat...
int GetCurrentRespGate(int a_th)
Return the index indicating the current respiratory gate for this thread.
int CheckParameters(int64_t a_nbEvents)
Check all mandatory parameters.
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...
void SetVerbose(int a_verboseLevel)
set verbosity
void SetRespMotionFlagOn()
set the respiratory motion flag to 'true'
#define FLTNB
Definition: gVariables.hh:55
void SetCardMotionFlagOn()
set the cardiac motion flag to 'true'
int GetCurrentCardImage(int a_th)
return the number of the current cardiac gated image, to be used in the ImageSpace matrices for the r...
This class gathers the information about the dynamic splitting of the data.
void ResetCurrentDynamicIndices()
Reset to 0 the multithreaded dynamic arrays gathering the indices of current frame, gates and involuntary motion.
int GetCurrentCardGate(int a_th)
Return the index indicating the current cardiac gate for this thread.
int GetNbIPatMotionSubsets()
return the number of involuntary patient motion transformations
int GetCurrentRespImage(int a_th)
return the number of the current respiratory gated image, to be used in the ImageSpace matrices for t...
int DynamicSwitch(int64_t a_index, uint32_t a_time, int a_bed, int a_th)
This function is called in the reconstruction event loop. It is used to check if the current event be...
~oDynamicDataManager()
oDynamicDataManager destructor.
int GetCurrentTimeFrame(int a_th)
Return the index indicating the current time frame for this thread.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
set the pointer to the oImageDimensionsAndQuantification object
oDynamicDataManager()
oDynamicDataManager constructor. Initialize the member variables to their default values...
oImageDimensionsAndQuantification * mp_ID
int SetDynamicSpecificQuantificationFactors(FLTNB **a2p_quantificationFactors)
Compute gate-specific quantificative factors using the number of events within each gate...
int64_t ** m2p_indexLastEventCardGate
int GetSensNbCardGates()
return the number of cardiac images to be used in the ImageSpace matrices for the list-mode sensitivi...
int InitDynamicDataPatientMotion(const string &a_pathToFile)
Initialisation of involuntary patient motion correction information, if any.
Declaration of class sOutputManager.
int64_t ** m2p_indexLastEventRespGate
int GetCurrentPMotionIndex(int a_th)
return the number of the current involuntary patient motion image to be used in the ImageSpace matric...
This class is designed to manage all dimensions and quantification related stuff. ...
This file is used for all kind of different functions designed for options parsing and ASCII file rea...
int InitDynamicData(int a_nbRespGates, int a_nbCardGates, const string &a_pathTo4DDataSplittingFile, int a_rmMCorrFlag, int a_cMmCorrFlag, int a_dmCorrFlag, int a_pMotionCorrFlag)
Main function for instanciation and initialization of the member variables and arrays. Call the specific initialization function depending of the type of dataset.
void SetPMotionFlagOn()
set the involuntary patient motion flag to 'true'