CASToR  2.0
Tomographic Reconstruction (PET/SPECT/CT)
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iScannerPET.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 ISCANNERPET_HH
32 #define ISCANNERPET_HH 1
33 
34 #include "gVariables.hh"
35 #include "vScanner.hh"
36 #include "sAddonManager.hh"
37 
43 class iScannerPET : public vScanner
44 {
45  // Constructor & Destructor
46  public:
51  iScannerPET();
52 
56  ~iScannerPET();
57 
58 
59  // -------------------------------------------------------------------
60  // Public member functions
61  public:
62  // Function for automatic insertion (put the class name as the parameters and do not add semi-colon at the end of the line)
68  void DescribeSpecific();
77  int Instantiate(bool a_scannerFileIsLUT);
83  int CheckParameters();
89  int Initialize();
98  int BuildLUT(bool a_scannerFileIsLUT);
116  int GetPositionsAndOrientations( int a_index1, int a_index2,
117  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
118  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3],
119  FLTNB* ap_POI1 = NULL, FLTNB* ap_POI2 = NULL );
138  int GetRdmPositionsAndOrientations( int a_index1, int a_index2,
139  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
140  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3] );
151  int GetPositionWithRandomDepth( int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3] );
164  int GetTwoCorners( int a_index1, int a_index2,
165  FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3],
166  FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3] );
184  int GetEdgesCenterPositions( int a_index1, int a_index2,
185  FLTNB ap_pos_line_point1[3], FLTNB ap_pos_line_point2[3],
186  FLTNB ap_pos_point1_x[4], FLTNB ap_pos_point1_y[4], FLTNB ap_pos_point1_z[4],
187  FLTNB ap_pos_point2_x[4], FLTNB ap_pos_point2_y[4], FLTNB ap_pos_point2_z[4] );
192  inline int GetSystemNbElts()
193  {return m_nbCrystals;};
194 
209  int IsAvailableLOR(int a_elt1, int a_elt2);
216  int GetGeometricInfoFromDataFile(string a_pathToDataFilename);
222  inline int SetPETMaxAxialDiffmm(FLTNB a_maxAxialDiffmm)
223  {m_maxAxialDiffmm = a_maxAxialDiffmm; return 0;}
229  void ShowHelp();
236  {return mp_sizeCrystalTrans[0];}
243  {return mp_sizeCrystalAxial[0];}
244 
245  // -------------------------------------------------------------------
246  // Functions dedicated to Analytic Projection
254  int PROJ_GetPETSpecificParameters(FLTNB* ap_maxAxialDiffmm);
255 
256 
257  // -------------------------------------------------------------------
258  // Private member functions
259  private:
267  int LoadLUT();
277  int ComputeLUT();
284  int GetLayer(int a_idx);
285 
286 
287  // -------------------------------------------------------------------
288  // Data members
289  private:
310 };
311 
312 
313 // Class for automatic insertion (set here the visible scanner type name, put the class name as the parameters and do not add semi-colon at the end of the line)
315 
316 #endif
int GetPositionWithRandomDepth(int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3])
Get the positions and orientations of scanner elements from their indices, with a random depth...
This header file is mainly used to declare some macro definitions and all includes needed from the st...
int CheckParameters()
Check if all parameters have been correctly initialized.
Definition: iScannerPET.cc:307
FLTNB * mp_sizeCrystalAxial
Definition: iScannerPET.hh:303
int Instantiate(bool a_scannerFileIsLUT)
Get mandatory informations from the scanner file and allocate memory for the member variables...
Definition: iScannerPET.cc:145
int IsAvailableLOR(int a_elt1, int a_elt2)
Check if the LOR formed by the crystalf whose indices are passed in parameters is available according...
Definition: iScannerPET.hh:193
#define FLTNB
Definition: gVariables.hh:81
FLTNB * mp_crystalOrientationX
Definition: iScannerPET.hh:298
int Initialize()
Check general initialization and set several parameters to their default value.
Definition: iScannerPET.cc:386
int GetTwoCorners(int a_index1, int a_index2, FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3], FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3])
Get the cartesian coordinaters of the two opposite corners of a scanner element.
int SetPETMaxAxialDiffmm(FLTNB a_maxAxialDiffmm)
Set the maximal axial difference in mm between 2 crystals forming a lor.
Definition: iScannerPET.hh:222
FLTNB m_minAngleDifference
Definition: iScannerPET.hh:307
FLTNB * mp_crystalOrientationY
Definition: iScannerPET.hh:299
int GetSystemNbElts()
Definition: iScannerPET.hh:192
#define CLASS_SCANNER(NAME, CLASS)
Definition: vScanner.hh:458
FLTNB GetDetectionElementSizeAxial()
Definition: iScannerPET.hh:242
FLTNB * mp_meanDepthOfInteraction
Definition: iScannerPET.hh:305
int GetRdmPositionsAndOrientations(int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3], FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3])
Get random positions of the scanner elements and their orientations from their indices.
FLTNB * mp_crystalOrientationZ
Definition: iScannerPET.hh:300
int GetEdgesCenterPositions(int a_index1, int a_index2, FLTNB ap_pos_line_point1[3], FLTNB ap_pos_line_point2[3], FLTNB ap_pos_point1_x[4], FLTNB ap_pos_point1_y[4], FLTNB ap_pos_point1_z[4], FLTNB ap_pos_point2_x[4], FLTNB ap_pos_point2_y[4], FLTNB ap_pos_point2_z[4])
Implementation of the pure virtual function from vScanner. Get the cartesian coordinaters of the ce...
FLTNB * mp_crystalCentralPositionZ
Definition: iScannerPET.hh:296
int GetGeometricInfoFromDataFile(string a_pathToDataFilename)
Retrieve PET geometric informations from the datafile.
Declaration of class vScanner.
int GetLayer(int a_idx)
Get the layer from which the 'a_index' crystal belongs to.
int GetPositionsAndOrientations(int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3], FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3], FLTNB *ap_POI1=NULL, FLTNB *ap_POI2=NULL)
Get the central positions and orientations of the scanner elements from their indices.
FLTNB * mp_sizeCrystalDepth
Definition: iScannerPET.hh:304
int PROJ_GetPETSpecificParameters(FLTNB *ap_maxAxialDiffmm)
Set pointers passed in argument with the related PET specific variables This function is used to reco...
This class is used to represent any cylindrical PET scanner.
Definition: iScannerPET.hh:43
FLTNB * mp_crystalCentralPositionY
Definition: iScannerPET.hh:295
#define FUNCTION_SCANNER(CLASS)
Definition: vScanner.hh:454
int LoadLUT()
Load a precomputed scanner LUT.
Definition: iScannerPET.cc:421
iScannerPET()
iScannerPET constructor. Initialize the member variables to their default values. ...
Definition: iScannerPET.cc:40
void ShowHelp()
Display help.
FLTNB * mp_crystalCentralPositionX
Definition: iScannerPET.hh:294
FLTNB * mp_sizeCrystalTrans
Definition: iScannerPET.hh:302
~iScannerPET()
iScannerPET destructor.
Definition: iScannerPET.cc:71
int BuildLUT(bool a_scannerFileIsLUT)
Call the functions to generate the LUT or read the user-made LUT depending on the user choice...
Definition: iScannerPET.cc:269
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the scanner...
Definition: iScannerPET.cc:100
FLTNB m_maxAxialDiffmm
Definition: iScannerPET.hh:309
Declaration of class sAddonManager.
Generic class for scanner objects.
Definition: vScanner.hh:62
int * mp_nbCrystalsInLayer
Definition: iScannerPET.hh:292
FLTNB GetDetectionElementSizeTrans()
Definition: iScannerPET.hh:235
int ComputeLUT()
Compute the LUT of the scanner from a generic (.geom) file.
Definition: iScannerPET.cc:501