CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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-2018 all CASToR contributors listed below:
18 
19  --> current contributors: Thibaut MERLIN, Simon STUTE, Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Mael MILLARDET
20  --> past contributors: Valentin VIELZEUF
21 
22 This is CASToR version 2.0.
23 */
24 
31 #ifndef OSENSITIVITYGENERATOR_HH
32 #define OSENSITIVITYGENERATOR_HH 1
33 
34 #include "gVariables.hh"
36 #include "oProjectorManager.hh"
38 #include "oDeformationManager.hh"
39 #include "oDynamicModelManager.hh"
40 #include "oImageSpace.hh"
41 #include "vDataFile.hh"
42 #include "vDeformation.hh"
43 #include "sOutputManager.hh"
44 #include "vScanner.hh"
45 
46 
47 
57 {
58  // -------------------------------------------------------------------
59  // Constructor & Destructor
60  public:
75 
76 
77  // -------------------------------------------------------------------
78  // Public member functions
79  public:
87  int CheckParameters();
95  int Initialize();
104  int Launch();
105 
106 
107  // -------------------------------------------------------------------
108  // Private member functions
109  private:
134  int LaunchCPU();
135  #ifdef CASTOR_GPU
136 
142  int LaunchGPU();
143  #endif
144 
169  int ComputeSensitivityFromScanner(int a_bed);
185  int ProcessThisLine(oProjectionLine* ap_Line, vEvent* ap_Event, int a_bed, int a_frame, int a_respGate, int a_cardGate, int a_thread);
186 
187 
188  // -------------------------------------------------------------------
189  // Public Get & Set functions
190  public:
196  string GetPathToSensitivityImage();
202  inline void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification* ap_ImageDimensionsAndQuantification)
203  {mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;};
209  inline void SetImageSpace(oImageSpace* ap_ImageSpace)
210  {mp_ImageSpace = ap_ImageSpace;};
216  inline void SetScanner(vScanner* ap_Scanner)
217  {mp_Scanner = ap_Scanner;}
223  inline void SetProjectorManager(oProjectorManager* ap_ProjectorManager)
224  {mp_ProjectorManager = ap_ProjectorManager;};
230  inline void SetImageConvolverManager(oImageConvolverManager* ap_ImageConvolverManager)
231  {mp_ImageConvolverManager = ap_ImageConvolverManager;}
237  inline void SetDeformationManager(oDeformationManager* ap_DeformationManager)
238  {mp_DeformationManager = ap_DeformationManager;};
244  inline void SetDataFile(vDataFile** a2p_DataFile)
245  {m2p_DataFile = a2p_DataFile;};
251  inline void SetComputeFromHistogramFlag(bool a_computeFromHistogramFlag)
252  {m_computeFromHistogramFlag = a_computeFromHistogramFlag;}
259  inline void SetPathToNormalizationFileName(vector<string> ap_pathToNormalizationFileName, bool a_inverseDataFileOrderFlag)
260  { mp_pathToNormalizationFileName = ap_pathToNormalizationFileName;
261  m_inverseDataFileOrderFlag = a_inverseDataFileOrderFlag; }
267  inline void SetPathToAttenuationImage(string a_pathToAttenuationImage)
268  {m_pathToAttenuationImage = a_pathToAttenuationImage;};
274  inline void SetPathToMaskImage(string a_pathToMaskImage) {m_pathToMaskImg = a_pathToMaskImage;};
281  inline void SetNumberOfAtnGateImages(int a_nbAtnRespGateImages, int a_nbAtnCardGateImages)
282  {m_nbAtnRespGateImages = a_nbAtnRespGateImages; m_nbAtnCardGateImages = a_nbAtnCardGateImages;};
288  inline void SetGPUflag(bool a_flagGPU)
289  {m_flagGPU = a_flagGPU;};
295  inline void SetVerbose(int a_verboseLevel)
296  {m_verbose = a_verboseLevel;};
297 
298 
299  // -------------------------------------------------------------------
300  // Data members
301  private:
302  string m_pathToSensitivityImage;
323  uint64_t* mp_lineCounter;
324  bool m_flagGPU;
325  int m_verbose;
326  bool m_checked;
328 };
329 
330 #endif
331 
332 
333 
334 
335 
336 
337 
338 
339 
340 
341 
342 
343 
oImageConvolverManager * mp_ImageConvolverManager
This class is designed to be a mother virtual class for DataFile.
Definition: vDataFile.hh:103
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:61
Mother class for the Event objects.
Definition: vEvent.hh:43
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:62