CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
sScannerManager Class Reference

Singleton class that Instantiate and initialize the scanner object. More...

#include <sScannerManager.hh>

Collaboration diagram for sScannerManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int CheckParameters ()
 Check if all parameters have been correctly initialized, and call the CheckParameters function of the scanner object.
int Initialize ()
 Initialization :
.
int ShowScannersDescription ()
 Get the description associated to the different scanners and print all on screen.
Walk through the scanner repository and look for the keyword "description" in .geom file and .hscan file.
int FindScannerSystem (string a_scannerName)
 Look for a file matching with the scanner name in parameter inside the scanner repository.
int BuildScannerObject ()
 Instantiate the specific scanner object related to the modality, and set verbosity of scanner object.
int GetGeometricInfoFromDatafile (string a_pathToDataFilename)
 Call the specialized function of the scanner object in order to get geometric informations from the datafile header.
int InstantiateScanner ()
 Instantiate scanner using the related function in the scanner classes.
int BuildLUT ()
 Call the eponym function of the scanner class.
int GetScannerLayerNbRings (int a_layer)
 Ask the number of rings to the scanner object for a specific layer.
Returns an error if this information is not available for the scanner type of the object (eg : SPECT systems)
bool HasUserScannerFile ()
string GetPathToScannerFile ()
string GetScannerName ()
int GetScannerType ()
vScannerGetScannerObject ()
int GetSystemNbElts ()
void SetVerbose (int a_verboseLevel)
 set verbosity
void SetSaveLUTFlag (bool a_flag)
 Set to on the flag indicating a LUT generated by a geom file should be written on disk or not.
bool SaveLUTFlag ()
 Get flag indicating a LUT generated by a geom file should be written on disk or not.
int64_t PROJ_GetModalityStopValueMainLoop ()
 Get the stop value for the main loop of analytic projection depending on the modality.
int64_t PROJ_GetModalityStartValueInnerLoop (int64_t a_elt1)
 Get the start value for the inner loop of analytic projection depending on the modality.
int64_t PROJ_GetCurrentProgression (int64_t a_elt1, int64_t a_elt2, int64_t *ap_nbEltsArray, int a_nbRGates, int a_nbCGates, int a_fr, int a_rg, int a_cg)
 Get numerator value according to the modality to compute percent progression during the analytical projection process.
int64_t PROJ_GetProgressionFinalValue ()
 Get numerator value according to the modality to compute percent progression during the projection process.
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)
 Transfer geometric information recovered from the datafile to the scanner object.
int PROJ_GetPETSpecificParameters (int *a_maxRingDiff)
 Transfer addresses to each geometric parameter of the PET scanner objets to the corresponding pointer of the datafile passed as argument.
int PROJ_SetPETSpecificParameters (int a_maxRingDiff)
 Deliver to the PET scanner object all informations provided from the datafile header.
int PROJ_SetSPECTSpecificParameters (uint16_t *ap_nbOfBins, uint32_t a_nbOfProjections, FLTNB a_firstAngle, FLTNB a_stepAngle, FLTNB *ap_projectionAngles, FLTNB a_CORtoDetectorDistance, string a_rotDirection)
 Deliver to the SPECT scanner object all informations provided from the acquisition parameters.

Static Public Member Functions

static sScannerManagerGetInstance ()
 Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.

Private Member Functions

 sScannerManager ()
 sScannerManager constructor.
 ~sScannerManager ()
 sScannerManager destructor.
 sScannerManager (sScannerManager const &)
void operator= (sScannerManager const &)
int GetAvailableScanners (vector< string > *ap_scannerNames)
 Gather all the names of the header files (.geom & .hscan) in the repository folder in the vector<string> passed in parameter.

Private Attributes

vScannermp_Scanner
int m_verbose
string m_pathToScannerFile
string m_scannerName
bool m_hasUserScannerFile
bool m_hasGenericScannerFile
bool m_allParametersChecked
bool m_saveLUTFlag

Static Private Attributes

static sScannerManagermp_Instance = NULL

Detailed Description

Singleton class that Instantiate and initialize the scanner object.

This class Instantiate and initialize the scanner object depending on its initilization file (generic .geom file or user LUT).
It holds several informations on the system and can be accessed from every class.

Definition at line 49 of file sScannerManager.hh.


Constructor & Destructor Documentation

sScannerManager constructor.

It is private at this class is singleton.
It should be instanciated using the GetInstance() function
Initialize the member variables to their default values.

Definition at line 34 of file sScannerManager.cc.

Here is the caller graph for this function:

sScannerManager destructor.

Definition at line 55 of file sScannerManager.cc.

sScannerManager::sScannerManager ( sScannerManager const &  ) [inline, private]

Definition at line 324 of file sScannerManager.hh.


Member Function Documentation

Call the eponym function of the scanner class.

Returns:
0 if success. Positive value otherwise

Definition at line 420 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Instantiate the specific scanner object related to the modality, and set verbosity of scanner object.

Returns:
0 if success. Positive value otherwise

Definition at line 313 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Check if all parameters have been correctly initialized, and call the CheckParameters function of the scanner object.

Returns:
0 if success. Positive value otherwise

Definition at line 71 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int sScannerManager::FindScannerSystem ( string  a_scannerName)

Look for a file matching with the scanner name in parameter inside the scanner repository.

Parameters:
a_scannerName: string containing name of the required scanner
Returns:
0 if success (scanner found). Positive value otherwise

Definition at line 215 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int sScannerManager::GetAvailableScanners ( vector< string > *  ap_scannerNames) [private]

Gather all the names of the header files (.geom & .hscan) in the repository folder in the vector<string> passed in parameter.

Parameters:
ap_scannerNames: vector list of string to recover the available scanner names
Returns:
0 if sucess, positive value otherwise

Definition at line 325 of file sScannerManager.hh.

Here is the caller graph for this function:

int sScannerManager::GetGeometricInfoFromDatafile ( string  a_pathToDataFilename)

Call the specialized function of the scanner object in order to get geometric informations from the datafile header.

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

Definition at line 363 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

static sScannerManager * sScannerManager::GetInstance ( ) [inline, static]

Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.

Returns:
instance of the sScannerManager singleton

Definition at line 60 of file sScannerManager.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
the path to the scanner file

Definition at line 150 of file sScannerManager.hh.

Here is the caller graph for this function:

Ask the number of rings to the scanner object for a specific layer.
Returns an error if this information is not available for the scanner type of the object (eg : SPECT systems)

Parameters:
a_layer,:layer index
Returns:
The number of rings in the system if success. NEGATIVE value otherwise

Definition at line 496 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

string sScannerManager::GetScannerName ( ) [inline]
Returns:
the scanner name

Definition at line 156 of file sScannerManager.hh.

Here is the caller graph for this function:

Returns:
the vScanner object

Definition at line 169 of file sScannerManager.hh.

Here is the caller graph for this function:

Returns:
the scanner type as returned by the scanner object, or SCANNER_UNKNOWN if the scanner object has not been initialized

Definition at line 163 of file sScannerManager.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

int sScannerManager::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 
)

Transfer geometric information recovered from the datafile to the scanner object.

Parameters:
ap_nbOfProjections: number of views/projections
ap_nbHeads: number of heads in the SPECT system
ap_nbOfBins: 2 elements array containing transaxial number of bins
ap_pixSizeXY: 2 elements array containing transaxial/axial pixel sizes
ap_angles: an array containing angles for each view
ap_CORtoDetectorDistance: a distance between the center of rotation and the detector
ap_headRotDirection: head rotation direction
Returns:
0 if success, positive value otherwise

Definition at line 911 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
the number of elements in the system

Definition at line 175 of file sScannerManager.hh.

Here is the call graph for this function:

Returns:
true if the scanner file is an user LUT, false otherwise (generic file is used)

Definition at line 144 of file sScannerManager.hh.

Initialization :
.

  • check if all parameters of the manager have been checked
  • call the initialization function of the scanner object
    Returns:
    0 if success. Positive value otherwise

Definition at line 130 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Instantiate scanner using the related function in the scanner classes.

Returns:
0 if success. Positive value otherwise

Definition at line 388 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void sScannerManager::operator= ( sScannerManager const &  ) [inline, private]

Definition at line 325 of file sScannerManager.hh.

int64_t sScannerManager::PROJ_GetCurrentProgression ( int64_t  a_elt1,
int64_t  a_elt2,
int64_t *  ap_nbEltsArray,
int  a_nbRGates,
int  a_nbCGates,
int  a_fr,
int  a_rg,
int  a_cg 
)

Get numerator value according to the modality to compute percent progression during the analytical projection process.

Parameters:
a_elt1: Current nb of processed #1 crystals (PET), projections (SPECT)
a_elt2: Current nb of processed #2 crystals (PET), crystals (SPECT)
ap_nbEltsArray: Total number of elements processed for each #1 crystals (PET/CT systems)
a_nbRGates
a_nbCGates
a_fr
a_rg
a_cg
Returns:
the required progression value if success, negative value otherwise

Definition at line 639 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Get the start value for the inner loop of analytic projection depending on the modality.

Parameters:
a_elt1: Current nb of processed crystals (PET), projections (SPECT)
Returns:
the required stop value if success, NEGATIVE value otherwise

Definition at line 580 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Get the stop value for the main loop of analytic projection depending on the modality.

Returns:
the required stop value if success, NEGATIVE value otherwise

Definition at line 532 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int sScannerManager::PROJ_GetPETSpecificParameters ( int *  a_maxRingDiff)

Transfer addresses to each geometric parameter of the PET scanner objets to the corresponding pointer of the datafile passed as argument.

Parameters:
ap_maxRingDiff: max number of axial ring difference
Returns:
0 if success, positive value otherwise

Definition at line 771 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Get numerator value according to the modality to compute percent progression during the projection process.

Returns:
the required progression value if success, negative value otherwise

Definition at line 694 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

Deliver to the PET scanner object all informations provided from the datafile header.

Parameters:
a_maxRingDiff: max number of axial ring difference
Returns:
0 if success, positive value otherwise

Definition at line 741 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int sScannerManager::PROJ_SetSPECTSpecificParameters ( uint16_t *  ap_nbOfBins,
uint32_t  a_nbOfProjections,
FLTNB  a_firstAngle,
FLTNB  a_stepAngle,
FLTNB ap_projectionAngles,
FLTNB  a_CORtoDetectorDistance,
string  a_rotDirection 
)

Deliver to the SPECT scanner object all informations provided from the acquisition parameters.

Parameters:
ap_nbOfBins: 2 elements array containing transaxial number of bins
a_nbOfProjections: number of views/projections
a_firstAngle: angle of the first view
a_lastAngle: angle of the last view
ap_projectionAngles: an array containing angles for each view
a_CORtoDetectorDistance: a distance between the center of rotation and the detector
a_RotDirection: Rotation direction of the head (clockwise/counter-clockwise)

For analytical projection, this data is provided from the command-line options

Returns:
0 if success, positive value otherwise

Definition at line 820 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool sScannerManager::SaveLUTFlag ( ) [inline]

Get flag indicating a LUT generated by a geom file should be written on disk or not.

Returns:
true if scanner LUT has to be saved, false otherwise

Definition at line 198 of file sScannerManager.hh.

Here is the caller graph for this function:

void sScannerManager::SetSaveLUTFlag ( bool  a_flag) [inline]

Set to on the flag indicating a LUT generated by a geom file should be written on disk or not.

Parameters:
a_flag

Definition at line 190 of file sScannerManager.hh.

Here is the caller graph for this function:

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

set verbosity

Parameters:
a_verboseLevel

Definition at line 182 of file sScannerManager.hh.

Here is the caller graph for this function:

Get the description associated to the different scanners and print all on screen.
Walk through the scanner repository and look for the keyword "description" in .geom file and .hscan file.

Returns:
0 if success, positive value otherwise

Definition at line 163 of file sScannerManager.cc.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Boolean indicating if all variables of the class have been checked

Definition at line 346 of file sScannerManager.hh.

Boolean indicating if the scanner geometry if defined by a generic file

Definition at line 345 of file sScannerManager.hh.

Boolean indicating if the scanner geometry if defined by a user LUT

Definition at line 344 of file sScannerManager.hh.

String containing the path to the scanner file

Definition at line 342 of file sScannerManager.hh.

Flag indicating a LUT generated by a geom file should be written on disk or not.

Definition at line 347 of file sScannerManager.hh.

String containing the scanner name

Definition at line 343 of file sScannerManager.hh.

Verbosity

Definition at line 341 of file sScannerManager.hh.

sScannerManager * sScannerManager::mp_Instance = NULL [static, private]

Pointer to the instance of this class

Definition at line 339 of file sScannerManager.hh.

Pointer to the Scanner object

Definition at line 340 of file sScannerManager.hh.


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