CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
oSensitivityGenerator.hh
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
30 #ifndef OSENSITIVITYGENERATOR_HH
31 #define OSENSITIVITYGENERATOR_HH 1
32 
33 #include "gVariables.hh"
35 #include "oProjectorManager.hh"
37 #include "oDeformationManager.hh"
38 #include "oDynamicModelManager.hh"
39 #include "oImageSpace.hh"
40 #include "vDataFile.hh"
41 #include "vDeformation.hh"
42 #include "sOutputManager.hh"
43 #include "vScanner.hh"
44 
45 
46 
56 {
57  // -------------------------------------------------------------------
58  // Constructor & Destructor
59  public:
74 
75 
76  // -------------------------------------------------------------------
77  // Public member functions
78  public:
86  int CheckParameters();
94  int Initialize();
103  int Launch();
104 
105 
106  // -------------------------------------------------------------------
107  // Private member functions
108  private:
133  int LaunchCPU();
134  #ifdef CASTOR_GPU
135 
141  int LaunchGPU();
142  #endif
143 
168  int ComputeSensitivityFromScanner(int a_bed);
184  int ProcessThisLine(oProjectionLine* ap_Line, vEvent* ap_Event, int a_bed, int a_frame, int a_respGate, int a_cardGate, int a_thread);
185 
186 
187  // -------------------------------------------------------------------
188  // Public Get & Set functions
189  public:
195  string GetPathToSensitivityImage();
201  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
202  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;};
208  inline void SetImageSpace(oImageSpace* ap_ImageSpace)
209  {mp_ImageSpace = ap_ImageSpace;};
215  inline void SetScanner(vScanner* ap_Scanner)
216  {mp_Scanner = ap_Scanner;}
222  inline void SetProjectorManager(oProjectorManager* ap_ProjectorManager)
223  {mp_ProjectorManager = ap_ProjectorManager;};
229  inline void SetImageConvolverManager(oImageConvolverManager* ap_ImageConvolverManager)
230  {mp_ImageConvolverManager = ap_ImageConvolverManager;}
236  inline void SetDeformationManager(oDeformationManager* ap_DeformationManager)
237  {mp_DeformationManager = ap_DeformationManager;};
243  inline void SetDataFile(vDataFile** a2p_DataFile)
244  {m2p_DataFile = a2p_DataFile;};
250  inline void SetComputeFromHistogramFlag(bool a_computeFromHistogramFlag)
251  {m_computeFromHistogramFlag = a_computeFromHistogramFlag;}
258  inline void SetPathToNormalizationFileName(vector<string> ap_pathToNormalizationFileName, bool a_inverseDataFileOrderFlag)
259  { mp_pathToNormalizationFileName = ap_pathToNormalizationFileName;
260  m_inverseDataFileOrderFlag = a_inverseDataFileOrderFlag; }
266  inline void SetPathToAttenuationImage(string a_pathToAttenuationImage)
267  {m_pathToAttenuationImage = a_pathToAttenuationImage;};
273  inline void SetPathToMaskImage(string a_pathToMaskImage) {m_pathToMaskImg = a_pathToMaskImage;};
280  inline void SetNumberOfAtnGateImages(int a_nbAtnRespGateImages, int a_nbAtnCardGateImages)
281  {m_nbAtnRespGateImages = a_nbAtnRespGateImages; m_nbAtnCardGateImages = a_nbAtnCardGateImages;};
287  inline void SetGPUflag(bool a_flagGPU)
288  {m_flagGPU = a_flagGPU;};
294  inline void SetVerbose(int a_verboseLevel)
295  {m_verbose = a_verboseLevel;};
296 
297  // -------------------------------------------------------------------
298  // Data members
299  private:
300  string m_pathToSensitivityImage;
321  uint64_t* mp_lineCounter;
322  bool m_flagGPU;
323  int m_verbose;
324  bool m_checked;
326 };
327 
328 #endif
329 
330 
331 
332 
333 
334 
335 
336 
337 
338 
339 
340 
341 
oImageConvolverManager * mp_ImageConvolverManager
This class is designed to be a mother virtual class for DataFile.
Definition: vDataFile.hh:102
This header file is mainly used to declare some macro definitions and all includes needed from the st...
Declaration of class oDynamicModelManager.
oProjectorManager * mp_ProjectorManager
Declaration of class oImageDimensionsAndQuantification.
void SetPathToAttenuationImage(string a_pathToAttenuationImage)
This function is used to set the path to the attenuation image.
void SetNumberOfAtnGateImages(int a_nbAtnRespGateImages, int a_nbAtnCardGateImages)
int ProcessThisLine(oProjectionLine *ap_Line, vEvent *ap_Event, int a_bed, int a_frame, int a_respGate, int a_cardGate, int a_thread)
This function manages the computation of the sensitivity contribution of the projection line provided...
oSensitivityGenerator()
The constructor of oSensitivityGenerator.
int Initialize()
A public function used to initialize the sensitivity generator.
vDataFile *** m3p_NormalizationDataFile
oDeformationManager * mp_DeformationManager
Declaration of class oDeformationManager.
string GetPathToSensitivityImage()
This function return the path to the sensitivity image.
void SetDeformationManager(oDeformationManager *ap_DeformationManager)
This function is used to set the pointer to the oDeformationManager in use.
~oSensitivityGenerator()
The destructor of oSensitivityGenerator.
int Launch()
A public function used to launch the sensitivity generator (compute the sensitivity image) ...
void SetVerbose(int a_verboseLevel)
void SetImageConvolverManager(oImageConvolverManager *ap_ImageConvolverManager)
This function is used to set the pointer to the oImageConvolverManager in use.
void SetPathToNormalizationFileName(vector< string > ap_pathToNormalizationFileName, bool a_inverseDataFileOrderFlag)
This function is used to set the path to the normalization file names, and the flag saying if their o...
Declaration of class oImageConvolverManager.
void SetComputeFromHistogramFlag(bool a_computeFromHistogramFlag)
This function is used to set the m_computeFromHistogramFlag.
Declaration of class vScanner.
int ComputeSensitivityFromNormalizationFile(int a_bed)
Launch the computation of the sensitivity image for this bed, based on normalization data files...
Declaration of class vDataFile.
void SetPathToMaskImage(string a_pathToMaskImage)
Set path to a mask image.
This class is designed to manage the different image convolvers and to apply them.
int InitializeAttenuationFiles()
Initialize the attenuation images provided for sensitivity computation.
void SetDataFile(vDataFile **a2p_DataFile)
This function is used to set the pointer to the vDataFile array in use.
int LaunchCPU()
Launch the computation of the sensitivity image (CPU version)
void SetImageSpace(oImageSpace *ap_ImageSpace)
This function is used to set the pointer to the oImageSpace in use.
Declaration of class vDeformation.
void SetScanner(vScanner *ap_Scanner)
This function is used to set the pointer to the vScanner in use.
This class is designed to manage and store system matrix elements associated to a vEvent...
This class is designed to manage the image-based deformation part of the reconstruction.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
Declaration of class oImageSpace.
This class is designed to manage the projection part of the reconstruction.
Declaration of class sOutputManager.
This class holds all the matrices in the image domain that can be used in the algorithm: image...
Definition: oImageSpace.hh:60
Mother class for the Event objects.
Definition: vEvent.hh:42
int InitializeNormalizationFiles()
Initialize the normalization datafiles provided for sensitivity computation.
int CheckParameters()
A public function used to check the parameters settings.
This class is designed to manage all dimensions and quantification related stuff. ...
vector< string > mp_pathToNormalizationFileName
void SetProjectorManager(oProjectorManager *ap_ProjectorManager)
This function is used to set the pointer to the oProjectorManager in use.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
This function is used to set the pointer to the oImageDimensionsAndQuantification in use...
void SetGPUflag(bool a_flagGPU)
This function is used to set the GPU flag; do we use GPU or not.
int ComputeSensitivityFromHistogramDataFile(int a_bed)
Launch the computation of the sensitivity image for this bed, based on the input histogram data files...
Declaration of class oProjectorManager.
int ComputeSensitivityFromScanner(int a_bed)
Launch the computation of the sensitivity image for this bed, based on a loop over all scanner elemen...
This class is designed to manage the computation of the sensitivity image.
Generic class for scanner objects.
Definition: vScanner.hh:61