CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
Public Member Functions | Protected Attributes
vScanner Class Reference

Generic class for scanner objects. More...

#include <vScanner.hh>

Inheritance diagram for vScanner:
Inheritance graph
[legend]
Collaboration diagram for vScanner:
Collaboration graph
[legend]

List of all members.

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
oMatrixmp_rotationMatrix
oMatrixmp_positionMatrix_ref
oMatrixmp_positionMatrix_out

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

int vScanner::BuildLUT ( bool  a_scannerFileIsLUT) [pure virtual]

This function is implemented in child classes.
Instantiate the scanner look-up-table (LUT)

Parameters:
a_scannerFileIsLUT: boolean indicating if the file describing the system is a generic file (0) or custom Look-up-table (1)
Returns:
0 if success, positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

int vScanner::CheckParameters ( ) [pure virtual]

This function is implemented in child classes.
Check that all parameters have been correctly initialized.

Returns:
0 if success, positive value otherwise

Implemented in iScannerSPECTConv, and iScannerPET.

Here is the caller graph for this function:

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.

Returns:
1 (error) if not surcharged by a daughter 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.

Parameters:
a_path: string containing the path to datafile header
Returns:
0 if success. Positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

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.

Parameters:
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)
Returns:
0 if success, positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

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.

Parameters:
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)
Returns:
0 if success, positive value otherwise

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.

Parameters:
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)
Returns:
0 if success, positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

int vScanner::GetScannerLayerNbRings ( int  a_layer) [virtual]

Return an error by default.

Parameters:
a_layer

This function is surcharged by the PET scanner daughter class

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerPET.

Definition at line 159 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::GetScannerType ( ) [inline]
Returns:
the type (modality) of the system as defined by macro SCANNER_TYPE in sScannerManager.hh

Definition at line 216 of file vScanner.hh.

Here is the caller graph for this function:

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.

Parameters:
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.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 208 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::GetSystemNbElts ( ) [pure virtual]

This is a pure virtual method that must be implemented by children.

Returns:
the number of elements in the system

Implemented in iScannerSPECTConv, and iScannerPET.

Here is the caller graph for this function:

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.

Parameters:
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]
Returns:
0 if success, positive value otherwise

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.

Returns:
0 if success, positive value otherwise

Implemented in iScannerSPECTConv, and iScannerPET.

Here is the caller graph for this function:

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.

Parameters:
a_scannerFileIsLUT: boolean indicating if the file describing the system is a generic file (0) or custom Look-up-table (1)
Returns:
0 if success, positive value otherwise

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:

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.

Parameters:
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

Returns:
1 if the LOR is available, 0 otherwise

Reimplemented in iScannerSPECTConv, and iScannerPET.

Definition at line 119 of file vScanner.cc.

Here is the caller graph for this function:

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.

Returns:
1 (error) if not surcharged by a daughter 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.

Parameters:
ap_maxRingDiff

This function is surcharged by the PET scanner daughter classes
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerPET.

Definition at line 180 of file vScanner.cc.

Here is the caller graph for this function:

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.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 361 of file vScanner.cc.

Here is the caller graph for this function:

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.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 341 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTAngles ( FLTNB ap_projectionAngles) [virtual]

Set SPECT projection angles.

Parameters:
ap_projectionAngles

This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 300 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTCORtoDetectorDistance ( FLTNB  a_CORtoDetectorDistance) [virtual]

Set distance between center of rotation and SPECT detectors.

Parameters:
a_CORtoDetectorDistance

This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 321 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTNbBins ( uint16_t *  ap_nbOfBins) [virtual]

Set SPECT number of Bins.

Parameters:
ap_nbOfBins

This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 235 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTNbProjections ( uint32_t  a_nbOfProjections) [virtual]

Set SPECT number of views.

Parameters:
a_nbOfProjections

This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 256 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::PROJ_SetSPECTRotDirection ( string  a_rotDirection) [virtual]

Set head rotation direction.

Parameters:
a_rotDirection

This function is surcharged by the SPECT scanner daughter classes
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerSPECTConv.

Definition at line 278 of file vScanner.cc.

Here is the caller graph for this function:

int vScanner::SetPETMaxRingDiff ( int  a_maxRingDiff) [virtual]

Set the maximal ring difference.

Parameters:
a_maxRingDiff

This function is surcharged by the PET scanner daughter class
Returns an error by default.

Returns:
1 (error) if not surcharged by a daughter class

Reimplemented in iScannerPET.

Definition at line 224 of file vScanner.hh.

Here is the caller graph for this function:

void vScanner::SetVerbose ( int  a_verboseLevel) [inline]

Set verbosity.

Parameters:
a_verboseLevel

Definition at line 223 of file vScanner.hh.

Here is the caller graph for this function:

void vScanner::ShowHelp ( ) [pure virtual]

This function is implemented in child classes
Display help specific to the scanner class.

Implemented in iScannerPET, and iScannerSPECTConv.

Here is the caller graph for this function:


Member Data Documentation

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.

Matrix strucure for rotation computations

Definition at line 358 of file vScanner.hh.

Matrix strucure for rotation computations

Definition at line 357 of file vScanner.hh.

Matrix strucure for rotation computations

Definition at line 356 of file vScanner.hh.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines