CASToR
2.0
Tomographic Reconstruction (PET/SPECT/CT)
|
This class is used to represent any SPECT camera with parallel/convergent collimator. More...
#include <iScannerSPECTConv.hh>
Public Member Functions | |
iScannerSPECTConv () | |
iScannerSPECTConv constructor. Initialize the member variables to their default values. More... | |
~iScannerSPECTConv () | |
iScannerSPECTConv destructor. More... | |
void | DescribeSpecific () |
Implementation of the pure virtual eponym function that simply prints info about the scanner. More... | |
int | Instantiate (bool a_scannerFileIsLUT) |
Get mandatory informations from the scanner file and allocate memory for the member variables. More... | |
int | CheckParameters () |
Check that all parameters have been correctly initialized. More... | |
int | Initialize () |
Check general initialization and set several parameters to their default value. More... | |
int | BuildLUT (bool a_scannerFileIsLUT) |
Call the functions to generate the LUT or read the user-made LUT depending on the user choice. More... | |
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 orientations of the scanner elements from their indices. More... | |
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 indices. More... | |
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. More... | |
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. More... | |
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 convergent systems. Simply return 1. It is typically used for the Distance Driven projector. More... | |
int | GetGeometricInfoFromDataFile (string a_pathToDF) |
Recover geometric informations specific to the scanner class from the datafile header. More... | |
int | GetSystemNbElts () |
Get the number of elements in the system. For a SPECT system, returns the number of crystal in one gamma camera head. More... | |
void | ShowHelp () |
Display help. More... | |
FLTNB | GetDetectionElementSizeTrans () |
FLTNB | GetDetectionElementSizeAxial () |
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 to the scanner restrictions It is dedicated to PET and return 1 by default for SPECT. More... | |
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 recover these values in the datafile object. More... | |
int | PROJ_SetSPECTAngles (FLTNB *ap_projectionAngles) |
Set the projection angles with the array provided in parameter. More... | |
int | PROJ_SetSPECTCORtoDetectorDistance (FLTNB a_distance) |
Set distance between the center of rotation and SPECT detectors if arg value>0, Set with the geometric information in the scanner configuration file otherwise. More... | |
uint16_t | PROJ_GetSPECTNbProjections () |
uint16_t | PROJ_GetSPECTNbPixels () |
int | PROJ_GetSPECTNbBins (uint16_t *ap_nbOfBins) |
Get the number of SPECT heads in the pointer provided in parameter. More... | |
int | PROJ_SetSPECTNbBins (uint16_t *ap_nbOfBins) |
Set number of bins. More... | |
int | PROJ_SetSPECTNbProjections (uint32_t a_nbOfProjections) |
Set number of projections. More... | |
Public Member Functions inherited from vScanner | |
vScanner () | |
vScanner constructor. Initialize the member variables to their default values. More... | |
virtual | ~vScanner () |
vScanner destructor. More... | |
void | Describe () |
A function used to describe the generic parts of the datafile. More... | |
int | GetScannerType () |
string | GetScannerTypeString () |
void | SetVerbose (int a_verboseLevel) |
Set verbosity. More... | |
void | SetImageDimensionsAndQuantification (oImageDimensionsAndQuantification *ap_ID) |
Set the pointer to the image dimensions and quantification object. More... | |
FLTNB | GetDefaultBedDisplacementInMm () |
virtual int | SetPETMaxAxialDiffmm (FLTNB a_maxAxialDiffmm) |
Set the maximal axial difference in mm between 2 crystals forming a lor. More... | |
virtual int | SetRotDirection (string a_rotDirection) |
Set rotation direction of the system. More... | |
virtual int | PROJ_GetPETSpecificParameters (FLTNB *ap_maxRingDiff) |
Get geometric PET specific parameters to initialize the datafile. More... | |
virtual int | GetCTSpecificParameters (uint16_t *ap_nbOfProjections, FLTNB *&ap_angles, int *ap_detectorRotDirection) |
Recover geometric CT specific parameters from the scanner to initialize the datafile. More... | |
Private Member Functions | |
int | LoadLUT () |
Load a precomputed scanner LUT. More... | |
int | ComputeLUT () |
Computes the LUT of the scanner from a generic (.geom) file. More... | |
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. More... | |
Private Attributes | |
int | m_nbCrystals |
int | m_nbHeads |
uint16_t | mp_nbOfBins [2] |
uint16_t | m_nbOfProjections |
FLTNB * | mp_projectionAngles |
FLTNB * | mp_CORtoDetectorDistance |
FLTNB * | mp_radius |
uint32_t | m_nbPixelsTrans |
FLTNB | m_pixelsSizeTrans |
FLTNB | m_gapSizeTrans |
uint32_t | m_nbPixelsAxial |
FLTNB | m_pixelsSizeAxial |
FLTNB | m_gapSizeAxial |
FLTNB | m_acquisitionZoom |
uint32_t | m_vNbPixelsTrans |
uint32_t | m_vNbPixelsAxial |
FLTNB | m_vPixelsSizeTrans |
FLTNB | m_vPixelsSizeAxial |
FLTNB | m_crystalDepth |
string * | mp_focalModelTrans |
uint8_t * | mp_nbCoefModelTrans |
FLTNB ** | m2p_transFocalParameters |
string * | mp_focalModelAxial |
uint8_t * | mp_nbCoefModelAxial |
FLTNB ** | m2p_axialFocalParameters |
FLTNB * | mp_crystalCentralPositionX |
FLTNB * | mp_crystalCentralPositionY |
FLTNB * | mp_crystalCentralPositionZ |
FLTNB * | mp_crystalOrientationX |
FLTNB * | mp_crystalOrientationY |
FLTNB * | mp_crystalOrientationZ |
FLTNB * | mp_crystalFocalPositionX |
FLTNB * | mp_crystalFocalPositionY |
FLTNB * | mp_crystalFocalPositionZ |
Additional Inherited Members | |
Protected Attributes inherited from vScanner | |
int | m_scannerType |
int | m_verbose |
oImageDimensionsAndQuantification * | mp_ID |
bool | m_allParametersChecked |
oMatrix * | mp_rotationMatrix |
oMatrix * | mp_positionMatrix_ref |
oMatrix * | mp_positionMatrix_out |
int | m_rotDirection |
FLTNB | m_defaultBedDisplacementInMm |
This class is used to represent any SPECT camera with parallel/convergent collimator.
Inherits from vScanner
Definition at line 44 of file iScannerSPECTConv.hh.
iScannerSPECTConv::iScannerSPECTConv | ( | ) |
iScannerSPECTConv constructor. Initialize the member variables to their default values.
Definition at line 40 of file iScannerSPECTConv.cc.
iScannerSPECTConv::~iScannerSPECTConv | ( | ) |
iScannerSPECTConv destructor.
Definition at line 87 of file iScannerSPECTConv.cc.
|
virtual |
Call the functions to generate the LUT or read the user-made LUT depending on the user choice.
a_scannerFileIsLUT | : boolean indicating if the file describing the SPECT camera is a generic file (0) or custom Look-up-table (1) |
Implements vScanner.
Definition at line 420 of file iScannerSPECTConv.cc.
|
virtual |
Check that all parameters have been correctly initialized.
Implements vScanner.
Definition at line 484 of file iScannerSPECTConv.cc.
|
private |
Compute focal positions for a specific crystal ID.
a_posX | : cartesian position of the crystal on the x-axis |
a_posY | : cartesian position of the crystal on the y-axis |
a_posZ | : cartesian position of the crystal on the z-axis |
a_headID | : head index of the crystal (required to select the related focal model parameters and distance to center of rotation) |
a_cryID | : crystal index in the LUT |
Compute the focal positions using the implemented "constant", "polynomial", "slanthole" focal models related to the gamma cameras
The "custom" focal model is dedicated to user-made focal model and should be implemented by the user
Definition at line 900 of file iScannerSPECTConv.cc.
|
privatevirtual |
Computes the LUT of the scanner from a generic (.geom) file.
Read mandatory data from the geom file. Then compute the LUT elements for each crystal from the geometry described in the file
Compute the look-up-tables of the system containing the locations of the scanner elements center in space and their orientations
Reimplemented from vScanner.
Definition at line 652 of file iScannerSPECTConv.cc.
|
virtual |
Implementation of the pure virtual eponym function that simply prints info about the scanner.
Implements vScanner.
Definition at line 137 of file iScannerSPECTConv.cc.
|
inlinevirtual |
Implements vScanner.
Definition at line 223 of file iScannerSPECTConv.hh.
|
inlinevirtual |
Implements vScanner.
Definition at line 216 of file iScannerSPECTConv.hh.
|
virtual |
Implementation of the pure virtual function from vScanner.
Not yet implemented for the SPECT convergent systems. Simply return 1.
It is typically used for the Distance Driven projector.
int | a_index1 : 1st index of the event |
int | a_index2 : 2nd index of the event |
FLTNB | ap_pos_line_point1[3] : current position of point 1 of the ray (supposed to be centered in the section of the detection element and at the desired depth of interaction) |
FLTNB | ap_pos_line_point2[3] : current position of point 1 of the ray (supposed to be centered in the section of the detection element and at the desired depth of interaction) |
FLTNB | ap_pos_point1_x[4] : the resulting X position of the 4 edges of point 1 |
FLTNB | ap_pos_point1_y[4] : the resulting Y position of the 4 edges of point 1 |
FLTNB | ap_pos_point1_z[4] : the resulting Z position of the 4 edges of point 1 |
FLTNB | ap_pos_point2_x[4] : the resulting X position of the 4 edges of point 1 |
FLTNB | ap_pos_point2_y[4] : the resulting Y position of the 4 edges of point 1 |
FLTNB | ap_pos_point2_z[4] : the resulting Z position of the 4 edges of point 1 |
Implements vScanner.
Definition at line 1233 of file iScannerSPECTConv.cc.
|
virtual |
Recover geometric informations specific to the scanner class from the datafile header.
a_pathToDF | : string containing the path to datafile header |
-Recover nb of bins and projections
-Recover the projection angles from the header (directly read from the datafile, or extrapolated from a first and last angle)
-Recover the distance between the gamma camera detector surfaces and the center of rotation
(directly read from the datafile, or extracted from the gamma camera configuratino file)
Implements vScanner.
Definition at line 1259 of file iScannerSPECTConv.cc.
|
virtual |
This is a pure virtual method that must be implemented by children.
Get the central positions and orientations of the scanner elements from their indices.
a_index1 | : 1st index of the event |
a_index2 | : 2nd index of the event |
ap_Position1[3] | : x,y,z cartesian position of the point related to the 1st index (see child function for more details) |
ap_Position2[3] | : x,y,z cartesian position of the point related to the 2st index (see child function for more details) |
ap_Orientation1[3] | : x,y,z components of the orientation vector related to the 1st index (see child function for more details) |
ap_Orientation2[3] | : x,y,z components of the orientation vector related to the 2nd index (see child function for more details) |
ap_POI1 | : x,y,z components of the Point Of Interation related to the 1st index (see child function for more details) |
ap_POI2 | : x,y,z components of the Point Of Interation related to the 2nd index (see child function for more details) |
Implements vScanner.
Definition at line 1066 of file iScannerSPECTConv.cc.
|
virtual |
Get the positions and orientations of scanner elements from their indices, with a random depth.
a_index1 | : |
a_index2 | : index of the crystal |
ap_Position1[3] | : |
ap_Position2[3] | : x,y,z cartesian position of the point related to the crystal |
Implements vScanner.
Definition at line 1206 of file iScannerSPECTConv.cc.
|
virtual |
Get the focal point and random positions on the crystal surface and its orientations from the event indices.
a_index1 | : 1st index of the event (projection angle) |
a_index2 | : 2nd index of the event (crystal index in the gamma camera) |
ap_Position1[3] | : x,y,z cartesian position of the focal point |
ap_Position2[3] | : x,y,z cartesian position of the crystal |
ap_Orientation1[3] | : return -1 by default (no orientation components required for the focal point) |
ap_Orientation2[3] | : x,y,z components of the orientation vector related to the crystal |
Implements vScanner.
Definition at line 1147 of file iScannerSPECTConv.cc.
|
virtual |
Set pointers passed in argument with the related SPECT specific variables
This function is used to recover these values in the datafile object.
ap_nbOfProjections | : total number of views |
ap_nbHeads | : number of heads in the system |
ap_acquisitionZoom | : zoom used during acquisition for monolithic detectors |
ap_nbOfBins | : 2 elements array containing transaxial/axial number of pixels |
ap_pixSizeXY | : 2 elements array containing transaxial/axial pixel sizes |
ap_angles | : Array containing angles of each projection view |
ap_CORtoDetectorDistance | : Radius (distance between FOV center and detector) |
ap_headRotDirection | : head rotation direction |
Reimplemented from vScanner.
Definition at line 239 of file iScannerSPECTConv.hh.
|
inlinevirtual |
Get the number of elements in the system. For a SPECT system, returns the number of crystal in one gamma camera head.
Implements vScanner.
Definition at line 203 of file iScannerSPECTConv.hh.
|
virtual |
Get the cartesian coordinaters of the two opposite corners of a scanner element.
a_index1 | : index of the projection angle |
a_index2 | : index of the crystal |
ap_CornerInf1[3] | |
ap_CornerSup1[3] | |
ap_CornerInf2[3] | |
ap_CornerSup2[3] |
Implements vScanner.
Definition at line 1219 of file iScannerSPECTConv.cc.
|
virtual |
Check general initialization and set several parameters to their default value.
Implements vScanner.
Definition at line 602 of file iScannerSPECTConv.cc.
|
virtual |
Get mandatory informations from the scanner file and allocate memory for the member variables.
a_scannerFileIsLUT | : boolean indicating if the file describing the system is a generic file (0) or custom Look-up-table (1) |
Implements vScanner.
Definition at line 282 of file iScannerSPECTConv.cc.
|
inlinevirtual |
Check if the LOR formed by the crystalf whose indices are passed in parameters is available according to the scanner restrictions
It is dedicated to PET and return 1 by default for SPECT.
a_elt1 | : index of the 1st crystal |
a_elt2 | : index of the 2nd crystal |
Reimplemented from vScanner.
Definition at line 238 of file iScannerSPECTConv.hh.
|
privatevirtual |
Load a precomputed scanner LUT.
Read mandatory data from the header of the LUT. Then load the LUT elements for each crystal
Reimplemented from vScanner.
Definition at line 632 of file iScannerSPECTConv.cc.
int iScannerSPECTConv::PROJ_GetSPECTNbBins | ( | uint16_t * | ap_nbOfBins | ) |
Get the number of SPECT heads in the pointer provided in parameter.
Definition at line 1539 of file iScannerSPECTConv.cc.
|
inlinevirtual |
Reimplemented from vScanner.
Definition at line 287 of file iScannerSPECTConv.hh.
|
inlinevirtual |
Reimplemented from vScanner.
Definition at line 281 of file iScannerSPECTConv.hh.
|
virtual |
Set the projection angles with the array provided in parameter.
ap_projectionAngles | : an array containing the projection angles |
Reimplemented from vScanner.
Definition at line 1463 of file iScannerSPECTConv.cc.
|
virtual |
Set distance between the center of rotation and SPECT detectors if arg value>0,
Set with the geometric information in the scanner configuration file otherwise.
a_distance |
Reimplemented from vScanner.
Definition at line 1497 of file iScannerSPECTConv.cc.
|
virtual |
Set number of bins.
ap_nbOfBins |
Reimplemented from vScanner.
Definition at line 1556 of file iScannerSPECTConv.cc.
|
virtual |
Set number of projections.
a_nbOfProjections |
Reimplemented from vScanner.
Definition at line 1574 of file iScannerSPECTConv.cc.
|
virtual |
|
private |
Parameters of the axial focal model. Specific to each head
Definition at line 386 of file iScannerSPECTConv.hh.
|
private |
Parameters of the transaxial focal model. Specific to each head
Definition at line 382 of file iScannerSPECTConv.hh.
|
private |
The zoom used during the acquisition to limit the area of detection with monolithic crystals
Definition at line 370 of file iScannerSPECTConv.hh.
|
private |
Depth of crystals
Definition at line 378 of file iScannerSPECTConv.hh.
|
private |
Gap size between each axial pixel as defined in the system file
Definition at line 368 of file iScannerSPECTConv.hh.
|
private |
Gap size between each transaxial pixe as defined in the system filel
Definition at line 364 of file iScannerSPECTConv.hh.
|
private |
Total number of crystal in the scanner
Definition at line 352 of file iScannerSPECTConv.hh.
|
private |
Total number of SPECT heads
Definition at line 353 of file iScannerSPECTConv.hh.
|
private |
Total number of projection angles
Definition at line 356 of file iScannerSPECTConv.hh.
|
private |
Total number of axial pixels as defined in the system file
Definition at line 366 of file iScannerSPECTConv.hh.
|
private |
Total number of transaxial pixels as defined in the system file
Definition at line 362 of file iScannerSPECTConv.hh.
|
private |
Size of axial pixels as defined in the system file
Definition at line 367 of file iScannerSPECTConv.hh.
|
private |
Size of transaxial pixels as defined in the system file
Definition at line 363 of file iScannerSPECTConv.hh.
|
private |
Number of axial virtual pixels (pixels actually used in reconstruction)
Definition at line 373 of file iScannerSPECTConv.hh.
|
private |
Number of trans virtual pixels (pixels actually used in reconstruction)
Definition at line 372 of file iScannerSPECTConv.hh.
|
private |
Axial size of virtual pixels (pixels actually used in reconstruction)
Definition at line 376 of file iScannerSPECTConv.hh.
|
private |
Trans size of virtual pixels (pixels actually used in reconstruction)
Definition at line 375 of file iScannerSPECTConv.hh.
|
private |
Distance between the center of rotation and the detector surface of each head. One value for each projection angle.
Definition at line 359 of file iScannerSPECTConv.hh.
|
private |
Cartesian coordinate on X-axis of the center of each crystal, at each projection
Definition at line 388 of file iScannerSPECTConv.hh.
|
private |
Cartesian coordinate on Y-axis of the center of each crystal, at each projection
Definition at line 389 of file iScannerSPECTConv.hh.
|
private |
Cartesian coordinate on Z-axis of the center of each crystal, at each projection
Definition at line 390 of file iScannerSPECTConv.hh.
|
private |
X-axis position of the focal point for each crystal, at each projection
Definition at line 396 of file iScannerSPECTConv.hh.
|
private |
Y-axis position of the focal point for each crystal, at each projection
Definition at line 397 of file iScannerSPECTConv.hh.
|
private |
Z-axis position of the focal point for each crystal, at each projection
Definition at line 398 of file iScannerSPECTConv.hh.
|
private |
X-axis orientation of each crystal, at each projection
Definition at line 392 of file iScannerSPECTConv.hh.
|
private |
Y-axis orientation of each crystal, at each projection
Definition at line 393 of file iScannerSPECTConv.hh.
|
private |
Z-axis orientation of each crystal, at each projection
Definition at line 394 of file iScannerSPECTConv.hh.
|
private |
Axial focal model (should be 'constant', 'polynomial', 'slanthole', or 'custom'). Specific to each head
Definition at line 384 of file iScannerSPECTConv.hh.
|
private |
Transaxial focal model (should be 'constant', 'polynomial', 'slanthole', or 'custom'). Specific to each head
Definition at line 380 of file iScannerSPECTConv.hh.
|
private |
Number of coefficients of the axial focal model. Specific to each head
Definition at line 385 of file iScannerSPECTConv.hh.
|
private |
Number of coefficients of the transaxial focal model. Specific to each head
Definition at line 381 of file iScannerSPECTConv.hh.
|
private |
2 dimensionnal array containing the number of transaxial bins (X,Y). Default values : 2,2
Definition at line 355 of file iScannerSPECTConv.hh.
|
private |
Array containing all the projection angles ('m_nbOfProjections' elements)
Definition at line 358 of file iScannerSPECTConv.hh.
|
private |
Default radius (distance between the center of rotation and detector surface) for each head for the system
Definition at line 360 of file iScannerSPECTConv.hh.