148 Cerr(
"***** oProjectorManager::CheckParameters() -> No scanner provided !" << endl);
154 Cerr(
"***** oProjectorManager::CheckParameters() -> No image dimensions provided !" << endl);
160 Cerr(
"***** oProjectorManager::CheckParameters() -> No data file provided !" << endl);
168 Cerr(
"***** oProjectorManager::CheckParameters() -> Unknown computation strategy provided !" << endl);
174 Cerr(
"***** oProjectorManager::CheckParameters() -> No forward projector options provided !" << endl);
180 Cerr(
"***** oProjectorManager::CheckParameters() -> No backward projector options provided !" << endl);
186 Cerr(
"***** oProjectorManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
209 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The image-computation strategy of the oProjectionLine is not compatible with SPECT attenuation correction !");
215 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The forward projector is not compatible with SPECT attenuation correction !" << endl);
221 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The backward projector is not compatible with SPECT attenuation correction !" << endl);
239 Cerr(
"***** oProjectorManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
244 if (
m_verbose>=1)
Cout(
"oProjectorManager::Initialize() -> Initialize projectors and projection lines" << endl);
250 FLTNB tof_resolution = -1.;
251 FLTNB tof_bin_size = -1.;
319 Cerr(
"***** oProjectorManager::Initialize() -> POI information has no sense with histogram data !" << endl);
341 Cerr(
"***** oProjectorManager::Initialize() -> A problem occured while parsing projector options and initializing it !" << endl);
353 if ( (dynamic_cast<iDataFilePET*>(
mp_DataFile))->GetMaxNumberOfLinesPerEvent() > 1 )
358 Cerr(
"***** oProjectorManager::Initialize() -> Cannot use a loaded forward system matrix with compression in the datafile !" << endl);
364 Cerr(
"***** oProjectorManager::Initialize() -> Selected forward projector '" <<
m_forwardProjectorName <<
"' is not compatible with compression in the datafile !" << endl);
370 Cerr(
"***** oProjectorManager::Initialize() -> Cannot use a loaded backward system matrix with compression in the datafile !" << endl);
376 Cerr(
"***** oProjectorManager::Initialize() -> Selected backward projector '" <<
m_backwardProjectorName <<
"' is not compatible with compression in the datafile !" << endl);
415 Cerr(
"***** oProjectorManager::Initialize() -> An error occured while checking parameters of an oProjectionLine !" << endl);
420 Cerr(
"***** oProjectorManager::Initialize() -> An error occured while initializing an oProjectionLine !" << endl);
437 string list_options =
"";
438 string file_options =
"";
455 if (colon!=string::npos)
465 else if (comma!=string::npos)
496 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
514 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << m_forwardProjectorName <<
"' does not exist !" << endl);
521 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while setting the image dimensions of the forward projector !" << endl);
530 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading forward projector's common options !" << endl);
536 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading forward projector's configuration file !" << endl);
542 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading forward projector's options !" << endl);
548 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while checking forward projector parameters !" << endl);
554 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while initializing the forward projector !" << endl);
583 if (colon!=string::npos)
593 else if (comma!=string::npos)
624 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
642 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << m_backwardProjectorName <<
"' does not exist !" << endl);
649 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while setting the image dimensions of the backward projector !" << endl);
658 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading backward projector's common options !" << endl);
664 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading backward projector's configuration file !" << endl);
670 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading backward projector's options !" << endl);
676 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while checking backward projector parameters !" << endl);
682 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while initializing backward projector !" << endl);
756 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> Called while not initialized !" << endl);
805 int return_value = 0;
812 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> A problem occured while forward projecting an event !" << endl);
826 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> A problem occured while backward projecting an event !" << endl);
845 Cerr(
"***** oProjectorManager::ProcessAndSetMask() -> Mask already initialized !" << endl);
852 mp_mask[v] = (ap_maskImage[v]>0.);
oProjectionLine ** m2p_ProjectionLines
int m_computationStrategy
#define VERBOSE_DEBUG_EVENT
#define IMAGE_COMPUTATION_STRATEGY
void SetMask(bool *ap_mask)
Set a mask for voxels.
void SetThreadNumber(int a_threadNumber)
This function is used to set the thread number of this particular line.
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
This function is used to set the pointer to the oImageDimensionsAndQuantification in use...
void SetScanner(vScanner *ap_Scanner)
Set the pointer to the scanner in use.
void SetMatchedProjectors(bool a_UseMatchedProjectors)
This function is used to set the boolean that says if we use matched projectors.
int Initialize()
A function used to initialize the manager and the projectors or system matrices it manages...
FLTNB GetBedPosition(int a_bedIndex)
Get the bed position associated to a bed index.
string m_forwardProjectorName
This class is designed to generically described any on-the-fly projector.
bool GetCompatibilityWithSPECTAttenuationCorrection()
int Initialize()
A public function used to initialize the projector.
int Project(int a_direction, oProjectionLine *ap_ProjectionLine, uint32_t *ap_index1, uint32_t *ap_index2, int a_nbIndices)
A function use to computed the projection elements with respect to the provided parameters.
bool m_useSystemMatrixBackward
oProjectorManager()
The constructor of oProjectorManager.
void SetSensitivityModeOff()
Say that the projector will no longer be used to compute the global sensitivity.
#define ADAPTATIVE_LIST_COMPUTATION_STRATEGY
bool m_useSystemMatrixForward
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
Declaration of class iDataFilePET.
bool GetCompatibilityWithSPECTAttenuationCorrection()
void SetApplyTOF(int a_applyTOF)
Set the TOF mode.
static sAddonManager * GetInstance()
int ReadCommonOptionsList(const string &a_optionsList)
This function is used to read options common to all projectors given as a string. ...
oSystemMatrix * mp_SystemMatrixBackward
void SetVerbose(int a_verbose)
Set the verbose level.
#define FIXED_LIST_COMPUTATION_STRATEGY
~oProjectorManager()
The destructor of oProjectorManager.
void SetComputationStrategy(int a_computationStrategy)
This function is used to set the computation strategy in use.
int ParseOptionsAndInitializeProjectors()
Parse forward and backward projection options contained in the previously provided strings...
const string & GetPathToConfigDir()
Return the path to the CASTOR config directory.
void SetSensitivityMode(bool a_sensitivityMode)
Set the sensitivity mode on or off.
int GetNbBeds()
Get the number of bed positions.
int CheckParameters()
A public function used to check the parameters settings.
oSystemMatrix * mp_SystemMatrixForward
virtual int ReadOptionsList(const string &a_optionsList)=0
A function used to read options from a list of options.
void SetNbTOFBins(int a_nbTOFBins)
This function is used to set the number of TOF bins in use.
virtual int ReadConfigurationFile(const string &a_configurationFile)=0
A function used to read options from a configuration file.
bool m_useProjectorForward
void SetPOI2(FLTNB *ap_POI2)
This function is used to set the POI of point 2.
oProjectionLine * ComputeProjectionLine(vEvent *ap_Event, int a_th)
This function is used to compute system matrix elements from the associated projector or pre-computed...
FLTNB * GetPOIResolution()
void Reset()
Reset length and all the voxel indices and weights tabs.
int CheckParameters()
A function used to check the parameters settings.
void SetTOFBinSize(FLTNB a_TOFBinSize)
This function is used to set the size of a TOF bin in ps.
void ApplyBedOffset(int a_bed)
Compute the bed offset from the provided bed index and apply it to all projection lines...
void SetSensitivityModeOn()
Say that the projector will be used to compute the global sensitivity.
void SetVerbose(int a_verbose)
This function is used to set the verbose level.
std::map< string, maker_projector > mp_listOfProjectors
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
bool GetCompatibilityWithCompression()
void SetBackwardProjector(vProjector *ap_Projector)
This function is used to set the pointer to the backward projector.
bool m_useMatchedProjectors
#define SYSTEM_MATRIX_KEYWORD
int ProcessAndSetMask(FLTNB *ap_maskImage)
Process and set the provided mask image for projector masking.
bool m_useProjectorBackward
bool IsBackwardOperatorCompatibleWithSPECTAttenuationCorrection()
void SetPOI1(FLTNB *ap_POI1)
This function is used to set the POI of point 1.
string m_backwardProjectorName
This class is designed to manage and store system matrix elements associated to a vEvent...
vProjector * mp_ProjectorBackward
vProjector * mp_ProjectorForward
void SetPOIResolution(FLTNB *ap_POIResolution)
This function is used to set the POI resolution along the 3 axes.
void SetForwardProjector(vProjector *ap_Projector)
This function is used to set the pointer to the forward projector.
Declaration of class sOutputManager.
Mother class for the Event objects.
INTNB GetNbVoxXYZ()
Get the total number of voxels.
void SetTOFResolution(FLTNB a_TOFResolution)
This function is used to set the TOF resolution in use.
int GetNbThreadsForProjection()
Get the number of threads used for projections.
void SetTOFMeasurement(FLTNB a_TOFMeasurement)
This function is used to set the TOF measurement associated to the line.
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
int Project(int a_direction, oProjectionLine *ap_ProjectionLine, uint32_t *ap_index1, uint32_t *ap_index2, int a_nbIndices)
void SetApplyPOI(bool a_applyPOI)
Set the POI mode.
int CheckSPECTAttenuationCompatibility(const string &a_pathToAttenuationImage)
A function used to check specific compatibility with SPECT and attenuation correction.
Declaration of class oProjectorManager.
int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use and copy locally some often use variables.
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data)...
Declaration of class sAddonManager.
bool IsForwardOperatorCompatibleWithSPECTAttenuationCorrection()