![]() |
CASToR
1.0
Tomographic Reconstruction (PET/SPECT)
|
Generic class for scanner objects. More...
#include <vScanner.hh>
Public Member Functions | |
vScanner () | |
vScanner constructor. Initialize the member variables to their default values. | |
virtual | ~vScanner () |
vScanner destructor. | |
virtual int | Instantiate (bool a_scannerFileIsLUT)=0 |
This function is implemented in child classes. Read the mandatory fields from the scanner file and allocate memory for the member variables. | |
virtual int | BuildLUT (bool a_scannerFileIsLUT)=0 |
This function is implemented in child classes. Instantiate the scanner look-up-table (LUT) | |
virtual int | CheckParameters ()=0 |
This function is implemented in child classes. Check that all parameters have been correctly initialized. | |
virtual int | Initialize ()=0 |
This function is implemented in child classes. Check initialization and set several parameters to their default value. | |
virtual 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)=0 |
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. | |
virtual int | GetRdmPositionsAndOrientations (int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3], FLTNB ap_Orientation1[3], FLTNB ap_Orientation2[3])=0 |
This is a pure virtual method that must be implemented by children. Get random positions of the scanner elements and their orientations from their indices. | |
virtual int | GetPositionWithRandomDepth (int a_index1, int a_index2, FLTNB ap_Position1[3], FLTNB ap_Position2[3])=0 |
This is a pure virtual method that must be implemented by children. Get the positions of scanner elements from their indices, with a random depth. | |
virtual int | GetTwoCorners (int a_index1, int a_index2, FLTNB ap_CornerInf1[3], FLTNB ap_CornerSup1[3], FLTNB ap_CornerInf2[3], FLTNB ap_CornerSup2[3])=0 |
This is a pure virtual method that must be implemented by children. Get the cartesian coordinaters of the two opposite corners of a scanner element. | |
virtual int | ComputeLUT () |
Virtual function which should be implemented by the child classes. It computes the LUT of the scanner from a generic (.geom) file. The vScanner implementation throws error by default as it should be implemented by the child class. | |
virtual int | LoadLUT () |
Virtual function which should be implemented by the child classes. Load a precomputed scanner LUT. The vScanner implementation throws error by default as it should be implemented by the child class. | |
virtual int | GetSystemNbElts ()=0 |
This is a pure virtual method that must be implemented by children. | |
virtual int | IsAvailableLOR (int a_elt1, int a_elt2) |
This function is implemented in child classes. Check if the LOR is available according to the scanner restrictions. | |
virtual void | ShowHelp ()=0 |
This function is implemented in child classes Display help specific to the scanner class. | |
virtual int | GetGeometricInfoFromDatafile (string a_path)=0 |
This function is implemented in child classes Recover geometric informations specific to the scanner class from the datafile header. | |
int | GetScannerType () |
void | SetVerbose (int a_verboseLevel) |
Set verbosity. | |
virtual int | SetPETMaxRingDiff (int a_maxRingDiff) |
Set the maximal ring difference. | |
virtual int | GetScannerLayerNbRings (int a_layer) |
Return an error by default. | |
virtual int | PROJ_GetPETSpecificParameters (int *ap_maxRingDiff) |
Get geometric PET specific parameters to initialize the datafile. | |
virtual int | GetSPECTSpecificParameters (uint16_t *ap_nbOfProjections, uint16_t *ap_nbHeads, uint16_t *ap_nbOfBins, FLTNB *ap_pixSizeXY, FLTNB *&ap_angles, FLTNB *&ap_CORtoDetectorDistance, int *ap_headRotDirection) |
Recover geometric SPECT specific parameters from the scanner to initialize the datafile. | |
virtual int | PROJ_SetSPECTNbBins (uint16_t *ap_nbOfBins) |
Set SPECT number of Bins. | |
virtual int | PROJ_SetSPECTNbProjections (uint32_t a_nbOfProjections) |
Set SPECT number of views. | |
virtual int | PROJ_SetSPECTAngles (FLTNB *ap_projectionAngles) |
Set SPECT projection angles. | |
virtual int | PROJ_SetSPECTCORtoDetectorDistance (FLTNB a_CORtoDetectorDistance) |
Set distance between center of rotation and SPECT detectors. | |
virtual int | PROJ_SetSPECTRotDirection (string a_rotDirection) |
Set head rotation direction. | |
virtual uint16_t | PROJ_GetSPECTNbProjections () |
return the total number of projections for a SPECT acquisition | |
virtual uint16_t | PROJ_GetSPECTNbPixels () |
return the total number of pixels for a SPECT reconstruction | |
Protected Attributes | |
int | m_scannerType |
int | m_verbose |
bool | m_allParametersChecked |
oMatrix * | mp_rotationMatrix |
oMatrix * | mp_positionMatrix_ref |
oMatrix * | mp_positionMatrix_out |
Generic class for scanner objects.
This class is designed to be a mother virtual class that should not be used on its own; only its children are used.
It has a pure virtual function that is used to get the cartesian coordinates of any line described by two indices.
Although new scanner classes are not supposed to be added, it uses the same auto-declaration class system than other reconstruction classes for the initialization of its children.
Definition at line 46 of file vScanner.hh.
vScanner constructor. Initialize the member variables to their default values.
Definition at line 30 of file vScanner.cc.
vScanner::~vScanner | ( | ) | [virtual] |
vScanner destructor.
Definition at line 50 of file vScanner.cc.
int vScanner::BuildLUT | ( | bool | a_scannerFileIsLUT | ) | [pure virtual] |
This function is implemented in child classes.
Instantiate the scanner look-up-table (LUT)
a_scannerFileIsLUT | : boolean indicating if the file describing the system is a generic file (0) or custom Look-up-table (1) |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::CheckParameters | ( | ) | [pure virtual] |
This function is implemented in child classes.
Check that all parameters have been correctly initialized.
Implemented in iScannerSPECTConv, and iScannerPET.
int vScanner::ComputeLUT | ( | ) | [virtual] |
Virtual function which should be implemented by the child classes.
It computes the LUT of the scanner from a generic (.geom) file.
The vScanner implementation throws error by default as it should be implemented by the child class.
Reimplemented in iScannerSPECTConv, and iScannerPET.
Definition at line 74 of file vScanner.cc.
int vScanner::GetGeometricInfoFromDatafile | ( | string | a_path | ) | [pure virtual] |
This function is implemented in child classes
Recover geometric informations specific to the scanner class from the datafile header.
a_path | : string containing the path to datafile header |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::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 |
||
) | [pure 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) |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::GetPositionWithRandomDepth | ( | int | a_index1, |
int | a_index2, | ||
FLTNB | ap_Position1[3], | ||
FLTNB | ap_Position2[3] | ||
) | [pure virtual] |
This is a pure virtual method that must be implemented by children.
Get the positions of scanner elements from their indices, with a random depth.
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 event (see child function for more details) |
ap_Position2[3] | : x,y,z cartesian position of the point related to the 2st event (see child function for more details) |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::GetRdmPositionsAndOrientations | ( | int | a_index1, |
int | a_index2, | ||
FLTNB | ap_Position1[3], | ||
FLTNB | ap_Position2[3], | ||
FLTNB | ap_Orientation1[3], | ||
FLTNB | ap_Orientation2[3] | ||
) | [pure virtual] |
This is a pure virtual method that must be implemented by children.
Get random positions of the scanner elements and their orientations 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) |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::GetScannerLayerNbRings | ( | int | a_layer | ) | [virtual] |
Return an error by default.
a_layer |
This function is surcharged by the PET scanner daughter class
Reimplemented in iScannerPET.
Definition at line 159 of file vScanner.cc.
int vScanner::GetScannerType | ( | ) | [inline] |
Definition at line 216 of file vScanner.hh.
int vScanner::GetSPECTSpecificParameters | ( | uint16_t * | ap_nbOfProjections, |
uint16_t * | ap_nbHeads, | ||
uint16_t * | ap_nbOfBins, | ||
FLTNB * | ap_pixSizeXY, | ||
FLTNB *& | ap_angles, | ||
FLTNB *& | ap_CORtoDetectorDistance, | ||
int * | ap_headRotDirection | ||
) | [virtual] |
Recover geometric SPECT specific parameters from the scanner to initialize the datafile.
ap_nbOfProjections | |
ap_nbHeads | |
ap_nbOfBins | |
ap_pixSizeXY | |
ap_angles | |
ap_CORtoDetectorDistance | |
ap_headRotDirection |
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 208 of file vScanner.cc.
int vScanner::GetSystemNbElts | ( | ) | [pure virtual] |
This is a pure virtual method that must be implemented by children.
Implemented in iScannerSPECTConv, and iScannerPET.
int vScanner::GetTwoCorners | ( | int | a_index1, |
int | a_index2, | ||
FLTNB | ap_CornerInf1[3], | ||
FLTNB | ap_CornerSup1[3], | ||
FLTNB | ap_CornerInf2[3], | ||
FLTNB | ap_CornerSup2[3] | ||
) | [pure virtual] |
This is a pure virtual method that must be implemented by children.
Get the cartesian coordinaters of the two opposite corners of a scanner element.
a_index1 | : 1st index of the event |
a_index2 | : 2nd index of the event |
ap_CornerInf1[3] | |
ap_CornerSup1[3] | |
ap_CornerInf2[3] | |
ap_CornerSup2[3] |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::Initialize | ( | ) | [pure virtual] |
This function is implemented in child classes.
Check initialization and set several parameters to their default value.
Implemented in iScannerSPECTConv, and iScannerPET.
int vScanner::Instantiate | ( | bool | a_scannerFileIsLUT | ) | [pure virtual] |
This function is implemented in child classes. Read the mandatory fields 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) |
Implemented in iScannerPET, and iScannerSPECTConv.
int vScanner::IsAvailableLOR | ( | int | a_elt1, |
int | a_elt2 | ||
) | [virtual] |
This function is implemented in child classes.
Check if the LOR is available according to the scanner restrictions.
a_elt1 | : index of the 1st scanner element |
a_elt2 | : index of the 2nd scanner element |
This function is related to analytic projection and list-mode sensitivity image generation
Reimplemented in iScannerSPECTConv, and iScannerPET.
Definition at line 119 of file vScanner.cc.
int vScanner::LoadLUT | ( | ) | [virtual] |
Virtual function which should be implemented by the child classes.
Load a precomputed scanner LUT.
The vScanner implementation throws error by default as it should be implemented by the child class.
Reimplemented in iScannerSPECTConv, and iScannerPET.
Definition at line 97 of file vScanner.cc.
int vScanner::PROJ_GetPETSpecificParameters | ( | int * | ap_maxRingDiff | ) | [virtual] |
Get geometric PET specific parameters to initialize the datafile.
ap_maxRingDiff |
This function is surcharged by the PET scanner daughter classes
Returns an error by default.
Reimplemented in iScannerPET.
Definition at line 180 of file vScanner.cc.
uint16_t vScanner::PROJ_GetSPECTNbPixels | ( | ) | [virtual] |
return the total number of pixels for a SPECT reconstruction
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 361 of file vScanner.cc.
uint16_t vScanner::PROJ_GetSPECTNbProjections | ( | ) | [virtual] |
return the total number of projections for a SPECT acquisition
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 341 of file vScanner.cc.
int vScanner::PROJ_SetSPECTAngles | ( | FLTNB * | ap_projectionAngles | ) | [virtual] |
Set SPECT projection angles.
ap_projectionAngles |
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 300 of file vScanner.cc.
int vScanner::PROJ_SetSPECTCORtoDetectorDistance | ( | FLTNB | a_CORtoDetectorDistance | ) | [virtual] |
Set distance between center of rotation and SPECT detectors.
a_CORtoDetectorDistance |
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 321 of file vScanner.cc.
int vScanner::PROJ_SetSPECTNbBins | ( | uint16_t * | ap_nbOfBins | ) | [virtual] |
Set SPECT number of Bins.
ap_nbOfBins |
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 235 of file vScanner.cc.
int vScanner::PROJ_SetSPECTNbProjections | ( | uint32_t | a_nbOfProjections | ) | [virtual] |
Set SPECT number of views.
a_nbOfProjections |
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 256 of file vScanner.cc.
int vScanner::PROJ_SetSPECTRotDirection | ( | string | a_rotDirection | ) | [virtual] |
Set head rotation direction.
a_rotDirection |
This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.
Reimplemented in iScannerSPECTConv.
Definition at line 278 of file vScanner.cc.
int vScanner::SetPETMaxRingDiff | ( | int | a_maxRingDiff | ) | [virtual] |
Set the maximal ring difference.
a_maxRingDiff |
This function is surcharged by the PET scanner daughter class
Returns an error by default.
Reimplemented in iScannerPET.
Definition at line 224 of file vScanner.hh.
void vScanner::SetVerbose | ( | int | a_verboseLevel | ) | [inline] |
Set verbosity.
a_verboseLevel |
Definition at line 223 of file vScanner.hh.
void vScanner::ShowHelp | ( | ) | [pure virtual] |
This function is implemented in child classes
Display help specific to the scanner class.
Implemented in iScannerPET, and iScannerSPECTConv.
bool vScanner::m_allParametersChecked [protected] |
Boolean indicating if all variables of the class have been checked. Default =false
Definition at line 355 of file vScanner.hh.
int vScanner::m_scannerType [protected] |
System type. Default =-1 (unknown)
Definition at line 353 of file vScanner.hh.
int vScanner::m_verbose [protected] |
Verbosity. Default =-1
Definition at line 354 of file vScanner.hh.
oMatrix* vScanner::mp_positionMatrix_out [protected] |
Matrix strucure for rotation computations
Definition at line 358 of file vScanner.hh.
oMatrix* vScanner::mp_positionMatrix_ref [protected] |
Matrix strucure for rotation computations
Definition at line 357 of file vScanner.hh.
oMatrix* vScanner::mp_rotationMatrix [protected] |
Matrix strucure for rotation computations
Definition at line 356 of file vScanner.hh.