CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
iScannerSPECTConv.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 ISCANNERSPECTConv_HH
31 #define ISCANNERSPECTConv_HH 1
32 
33 #include "gVariables.hh"
34 #include "vScanner.hh"
35 #include "sAddonManager.hh"
36 
44 {
45  // -------------------------------------------------------------------
46  // Constructor & Destructor
47  public:
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);
84  int CheckParameters();
90  int Initialize();
98  int BuildLUT( bool a_scannerFileIsLUT );
114  int GetPositionsAndOrientations( int a_index1, int a_index2,
115  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
116  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3],
117  FLTNB* ap_POI1 = NULL, FLTNB* ap_POI2 = NULL );
134  int GetRdmPositionsAndOrientations( int a_index1, int a_index2,
135  FLTNB ap_Position1[3], FLTNB ap_Position2[3],
136  FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3] );
147  int GetPositionWithRandomDepth( int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3] );
160  int GetTwoCorners( int a_index1, int a_index2,
161  FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3],
162  FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3] );
180  int GetEdgesCenterPositions( int a_index1, int a_index2,
181  FLTNB ap_pos_line_point1[3], FLTNB ap_pos_line_point2[3],
182  FLTNB ap_pos_point1_x[4], FLTNB ap_pos_point1_y[4], FLTNB ap_pos_point1_z[4],
183  FLTNB ap_pos_point2_x[4], FLTNB ap_pos_point2_y[4], FLTNB ap_pos_point2_z[4] );
195  int GetGeometricInfoFromDataFile( string a_pathToDF );
202  inline int GetSystemNbElts()
203  {return m_nbCrystals;}
209  void ShowHelp();
216  {return m_vPixelsSizeTrans;}
223  {return m_vPixelsSizeTrans;}
224 
225  // -------------------------------------------------------------------
226  // Functions dedicated to Analytic Projection
227  public:
237  inline int IsAvailableLOR(int a_elt1, int a_elt2)
238  {return 1;};
253  int GetSPECTSpecificParameters( uint16_t* ap_nbOfProjections,
254  uint16_t* ap_nbHeads,
255  FLTNB* ap_acquisitionZoom,
256  uint16_t* ap_nbOfBins,
257  FLTNB* ap_pixSizeXY,
258  FLTNB*& ap_angles,
259  FLTNB*& ap_CORtoDetectorDistance,
260  int* ap_headRotDirection);
267  int PROJ_SetSPECTAngles(FLTNB* ap_projectionAngles);
280  inline uint16_t PROJ_GetSPECTNbProjections()
281  {return m_nbOfProjections;}
286  inline uint16_t PROJ_GetSPECTNbPixels()
293  int PROJ_GetSPECTNbBins(uint16_t* ap_nbOfBins);
300  int PROJ_SetSPECTNbBins(uint16_t* ap_nbOfBins);
307  int PROJ_SetSPECTNbProjections(uint32_t a_nbOfProjections);
308 
309  // -------------------------------------------------------------------
310  // Private member functions
311  private:
319  int LoadLUT();
328  int ComputeLUT();
345  int ComputeFocalPositions( FLTNB a_posX, FLTNB a_posY, FLTNB a_posZ, int a_headID, int a_cryID );
346 
347 
348  // -------------------------------------------------------------------
349  // Data members
350  private:
352  int m_nbHeads;
354  uint16_t mp_nbOfBins[2];
355  uint16_t m_nbOfProjections;
361  uint32_t m_nbPixelsTrans;
365  uint32_t m_nbPixelsAxial;
371  uint32_t m_vNbPixelsTrans;
372  uint32_t m_vNbPixelsAxial;
398 };
399 
400 
401 // 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)
402 CLASS_SCANNER(SPECT_CONVERGENT,iScannerSPECTConv)
403 
404 #endif
This class is used to represent any SPECT camera with parallel/convergent collimator.
This header file is mainly used to declare some macro definitions and all includes needed from the st...
uint16_t PROJ_GetSPECTNbPixels()
#define FLTNB
Definition: gVariables.hh:81
FLTNB * mp_crystalCentralPositionX
int GetSPECTSpecificParameters(uint16_t *ap_nbOfProjections, uint16_t *ap_nbHeads, FLTNB *ap_acquisitionZoom, uint16_t *ap_nbOfBins, FLTNB *ap_pixSizeXY, FLTNB *&ap_angles, FLTNB *&ap_CORtoDetectorDistance, int *ap_headRotDirection)
Set pointers passed in argument with the related SPECT specific variables This function is used to ...
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...
#define CLASS_SCANNER(NAME, CLASS)
Definition: vScanner.hh:457
FLTNB ** m2p_axialFocalParameters
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...
void DescribeSpecific()
Implementation of the pure virtual eponym function that simply prints info about the scanner...
FLTNB ** m2p_transFocalParameters
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)
This is a pure virtual method that must be implemented by children. Get the central positions and o...
FLTNB GetDetectionElementSizeTrans()
void ShowHelp()
Display help.
int GetGeometricInfoFromDataFile(string a_pathToDF)
Recover geometric informations specific to the scanner class from the datafile header.
int PROJ_SetSPECTCORtoDetectorDistance(FLTNB a_distance)
Set distance between the center of rotation and SPECT detectors if arg value>0, Set with the geomet...
FLTNB * mp_crystalCentralPositionY
iScannerSPECTConv()
iScannerSPECTConv constructor. Initialize the member variables to their default values.
int PROJ_SetSPECTAngles(FLTNB *ap_projectionAngles)
Set the projection angles with the array provided in parameter.
int ComputeLUT()
Computes the LUT of the scanner from a generic (.geom) file.
Declaration of class vScanner.
int BuildLUT(bool a_scannerFileIsLUT)
Call the functions to generate the LUT or read the user-made LUT depending on the user choice...
int ComputeFocalPositions(FLTNB a_posX, FLTNB a_posY, FLTNB a_posZ, int a_headID, int a_cryID)
Compute focal positions for a specific crystal ID.
#define FUNCTION_SCANNER(CLASS)
Definition: vScanner.hh:453
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. Not yet implemented for the SPECT conver...
uint16_t PROJ_GetSPECTNbProjections()
FLTNB GetDetectionElementSizeAxial()
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 the focal point and random positions on the crystal surface and its orientations from the event i...
int GetSystemNbElts()
Get the number of elements in the system. For a SPECT system, returns the number of crystal in one ga...
int Initialize()
Check general initialization and set several parameters to their default value.
int PROJ_SetSPECTNbBins(uint16_t *ap_nbOfBins)
Set number of bins.
int CheckParameters()
Check that all parameters have been correctly initialized.
int PROJ_SetSPECTNbProjections(uint32_t a_nbOfProjections)
Set number of projections.
FLTNB * mp_crystalCentralPositionZ
int PROJ_GetSPECTNbBins(uint16_t *ap_nbOfBins)
Get the number of SPECT heads in the pointer provided in parameter.
int Instantiate(bool a_scannerFileIsLUT)
Get mandatory informations from the scanner file and allocate memory for the member variables...
~iScannerSPECTConv()
iScannerSPECTConv destructor.
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.
Declaration of class sAddonManager.
Generic class for scanner objects.
Definition: vScanner.hh:61
int LoadLUT()
Load a precomputed scanner LUT.