CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
code/include/datafile/oDynamicDataManager.hh
Go to the documentation of this file.
1 
8 #ifndef ODYNAMICDATAMANAGER_HH
9 #define ODYNAMICDATAMANAGER_HH 1
10 
11 #define DYNAMIC_SWITCH_NOTHING 0
12 #define DYNAMIC_SWITCH_CONTINUE 1
13 #define DYNAMIC_SWITCH_DEFORMATION 2
14 #define DYNAMIC_SWITCH_END_LOOP 3
15 
16 #include "gVariables.hh"
17 #include "gOptions.hh"
18 #include "sOutputManager.hh"
19 
21 class vDataFile;
22 
31 {
32  // -------------------------------------------------------------------
33  // Constructor & Destructor
34  public:
44 
45  // -------------------------------------------------------------------
46  // Public member functions
47  public:
61  int InitDynamicData( int a_nbRespGates, int a_nbCardGates, const string& a_pathTo4DDataSplittingFile,
62  int a_rmMCorrFlag, int a_cMmCorrFlag, int a_pMotionCorrFlag );
70  int SetDynamicSpecificQuantificationFactors(FLTNB** a2p_quantificationFactors);
77  int CheckParameters(int64_t a_nbEvents);
96  int DynamicSwitch(int64_t a_index, uint32_t a_time, int a_bed, int a_th);
97 
98  // -------------------------------------------------------------------
99  // Public Get & Set functions
100  public:
106  inline void SetVerbose(int a_verboseLevel)
107  {m_verbose = a_verboseLevel;};
113  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
114  {mp_ID = ap_ImageDimensionsAndQuantification;};
119  inline void SetRespMotionFlagOn()
120  {m_rMotionCorrFlag = true;}
125  inline void SetCardMotionFlagOn()
126  {m_cMotionCorrFlag = true;}
131  inline void SetPMotionFlagOn()
132  {m_pMotionCorrFlag = true;}
137  inline bool IsRespMotionEnabled()
138  {return m_rMotionCorrFlag;}
143  inline bool IsCardMotionEnabled()
144  {return m_cMotionCorrFlag;}
149  inline bool IsPMotionEnabled()
150  {return m_pMotionCorrFlag;}
157  inline int GetCurrentPMotionIndex(int a_th)
158  {return mp_currentPMotionIndex[a_th] ;}
165  inline int GetCurrentTimeFrame(int a_th)
166  {return mp_currentFrameIndex[a_th];}
173  inline int GetCurrentRespGate(int a_th)
174  {return mp_currentRespGateIndex[a_th];}
182  inline int GetCurrentRespImage(int a_th)
183  {return m_rMotionCorrFlag ? 0 : mp_currentRespGateIndex[a_th];}
190  inline int GetCurrentCardGate(int a_th)
191  {return mp_currentCardGateIndex[a_th];}
199  inline int GetCurrentCardImage(int a_th)
200  {return m_cMotionCorrFlag ? 0 : mp_currentCardGateIndex[a_th];}
207  {return m_nbCardGates;}
216  inline int GetPMotionFirstIndexForFrame(int a_fr)
217  {return m_pMotionCorrFlag ? mp_framePMotionFirstIndex[a_fr] : 0 ;}
218 
226  inline int GetPMotionLastIndexForFrame(int a_fr)
227  {return m_pMotionCorrFlag ? mp_framePMotionLastIndex[a_fr] : 0 ;}
228 
235  inline int GetNb1stMotImgsForLMS(int a_fr)
237 
238 
245  inline int GetNbPMotionTriggers(int a_fr)
246  {return mp_frameNbPMotionIndexes[a_fr];}
247 
255  inline FLTNB GetListPMotionWeightInFrameForLMS(int a_fr, int a_pmsset)
256  {return m2p_listPMotionWeightInFrame[a_fr][a_pmsset] ;}
264  inline HPFLTNB GetDurationPerGate(int a_fr, int a_respGate)
265  {return m2p_durationPerGate[a_fr][a_respGate] ;}
266 
273  {return m_nbPMotionTriggers+1;}
274 
279  inline bool GateDurationProvided()
281  // -------------------------------------------------------------------
282  // Private member functions
283  private:
291  int InitDynamicDataGating(const string& a_pathToGateFile);
299  int InitDynamicDataPatientMotion(const string& a_pathToFile);
300 
301  // -------------------------------------------------------------------
302  // Data members
303  private:
305  int m_verbose;
307  // Framing
311  // Respiratory gating
319  // Cardiac gating
327  // Common gating
331  // Involuntary motion
341 };
342 #endif
int InitDynamicDataGating(const string &a_pathToGateFile)
int GetCurrentRespGate(int a_th)
Return the index indicating the current respiratory gate for this thread.
This class is designed to be a mother virtual class for DataFile.
FLTNB GetListPMotionWeightInFrameForLMS(int a_fr, int a_pmsset)
void SetRespMotionFlagOn()
set the respiratory motion flag to 'true'
void SetCardMotionFlagOn()
set the cardiac motion flag to 'true'
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 GetNbIPatMotionSubsets()
return the number of involuntary patient motion transformations
oImageDimensionsAndQuantification * mp_ID
int InitDynamicData(int a_nbRespGates, int a_nbCardGates, const string &a_pathTo4DDataSplittingFile, int a_rmMCorrFlag, int a_cMmCorrFlag, int a_pMotionCorrFlag)
int DynamicSwitch(int64_t a_index, uint32_t a_time, int a_bed, int a_th)
int GetNb2ndMotImgsForLMS()
return the number of secundary motion (typically cardiac) images to be used in the ImageSpace matrice...
~oDynamicDataManager()
oDynamicDataManager destructor.
int GetCurrentTimeFrame(int a_th)
Return the index indicating the current time frame for this thread.
oDynamicDataManager()
oDynamicDataManager constructor. Initialize the member variables to their default values...
int SetDynamicSpecificQuantificationFactors(FLTNB **a2p_quantificationFactors)
int InitDynamicDataPatientMotion(const string &a_pathToFile)
This class is designed to manage all dimensions and quantification related stuff. ...
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
HPFLTNB GetDurationPerGate(int a_fr, int a_respGate)
void SetPMotionFlagOn()
set the involuntary patient motion flag to 'true'