8 #include "oProjectorManager.hh" 9 #include "sOutputManager.hh" 10 #include "sAddonManager.hh" 11 #include "iDataFilePET.hh" 135 Cerr(
"***** oProjectorManager::CheckParameters() -> No scanner provided !" << endl);
141 Cerr(
"***** oProjectorManager::CheckParameters() -> No image dimensions provided !" << endl);
147 Cerr(
"***** oProjectorManager::CheckParameters() -> No data file provided !" << endl);
155 Cerr(
"***** oProjectorManager::CheckParameters() -> Unknown computation strategy provided !" << endl);
161 Cerr(
"***** oProjectorManager::CheckParameters() -> No forward projector options provided !" << endl);
167 Cerr(
"***** oProjectorManager::CheckParameters() -> No backward projector options provided !" << endl);
173 Cerr(
"***** oProjectorManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
196 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The image-computation strategy of the oProjectionLine is not compatible with SPECT attenuation correction !");
202 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The forward projector is not compatible with SPECT attenuation correction !" << endl);
208 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The backward projector is not compatible with SPECT attenuation correction !" << endl);
226 Cerr(
"***** oProjectorManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
231 if (
m_verbose>=1)
Cout(
"oProjectorManager::Initialize() -> Initialize projectors and projection lines" << endl);
320 Cerr(
"***** oProjectorManager::Initialize() -> POI information has no sense with histogram data !" << endl);
342 Cerr(
"***** oProjectorManager::Initialize() -> A problem occurred while parsing projector options and initializing it !" << endl);
354 if ( (dynamic_cast<iDataFilePET*>(
mp_DataFile))->GetMaxNumberOfLinesPerEvent() > 1 )
359 Cerr(
"***** oProjectorManager::Initialize() -> Cannot use a loaded forward system matrix with compression in the datafile !" << endl);
365 Cerr(
"***** oProjectorManager::Initialize() -> Selected forward projector '" <<
m_forwardProjectorName <<
"' is not compatible with compression in the datafile !" << endl);
371 Cerr(
"***** oProjectorManager::Initialize() -> Cannot use a loaded backward system matrix with compression in the datafile !" << endl);
377 Cerr(
"***** oProjectorManager::Initialize() -> Selected backward projector '" <<
m_backwardProjectorName <<
"' is not compatible with compression in the datafile !" << endl);
414 Cerr(
"***** oProjectorManager::Initialize() -> An error occurred while checking parameters of an oProjectionLine !" << endl);
419 Cerr(
"***** oProjectorManager::Initialize() -> An error occurred while initializing an oProjectionLine !" << endl);
436 string list_options =
"";
437 string file_options =
"";
454 if (colon!=string::npos)
464 else if (comma!=string::npos)
495 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
513 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << m_forwardProjectorName <<
"' does not exist !" << endl);
520 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while setting the image dimensions of the forward projector !" << endl);
527 nb_tof_res = (dynamic_cast<iDataFilePET*>(
mp_DataFile))->GetNbTOFResolutions();
541 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading forward projector's common options !" << endl);
547 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading forward projector's configuration file !" << endl);
553 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading forward projector's options !" << endl);
559 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while checking forward projector parameters !" << endl);
565 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while initializing the forward projector !" << endl);
594 if (colon!=string::npos)
604 else if (comma!=string::npos)
635 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
653 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << m_backwardProjectorName <<
"' does not exist !" << endl);
660 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while setting the image dimensions of the backward projector !" << endl);
666 nb_tof_res = (dynamic_cast<iDataFilePET*>(
mp_DataFile))->GetNbTOFResolutions();
679 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading backward projector's common options !" << endl);
685 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading backward projector's configuration file !" << endl);
691 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading backward projector's options !" << endl);
697 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while checking backward projector parameters !" << endl);
703 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while initializing backward projector !" << endl);
777 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> Called while not initialized !" << endl);
837 int return_value = 0;
844 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> A problem occurred while forward projecting an event !" << endl);
858 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> A problem occurred while backward projecting an event !" << endl);
876 Cerr(
"***** oProjectorManager::ProcessAndSetMask() -> Mask already initialized !" << endl);
int m_computationStrategy
FLTNB GetTOFMeasurementRangeInPs()
#define IMAGE_COMPUTATION_STRATEGY
FLTNB * mp_TOFResolutionInMm
FLTNB GetBedPosition(int a_bedIndex)
virtual int ReadOptionsList(const string &a_optionsList)=0
int Initialize()
A function used to initialize the manager and the projectors or system matrices it manages...
string m_forwardProjectorName
This class is designed to generically described any on-the-fly projector.
virtual int ReadConfigurationFile(const string &a_configurationFile)=0
#define SPEED_OF_LIGHT_IN_MM_PER_PS
bool m_TOFEventResolutionFlag
void SetMask(bool *ap_mask)
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)
void SetVerbose(int a_verbose)
bool m_useSystemMatrixBackward
oProjectorManager()
The constructor of oProjectorManager.
int GetNbTOFResolutions()
void SetSensitivityModeOff()
Say that the projector will no longer be used to compute the global sensitivity.
#define ADAPTATIVE_LIST_COMPUTATION_STRATEGY
void SetScanner(vScanner *ap_Scanner)
FLTNB GetTOFProbabilities(int a_reso)
bool m_useSystemMatrixForward
vProjector * mp_ProjectorBackward
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
void SetMatchedProjectors(bool a_UseMatchedProjectors)
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
void SetTOFResolutionInMm(FLTNB *ap_TOFResolutionInMm)
bool GetCompatibilityWithSPECTAttenuationCorrection()
static sAddonManager * GetInstance()
int ReadCommonOptionsList(const string &a_optionsList)
#define FIXED_LIST_COMPUTATION_STRATEGY
void SetApplyTOF(int a_applyTOF)
Inherit from iEventPET. Class for PET list-mode events.
~oProjectorManager()
The destructor of oProjectorManager.
void SetPOIResolution(FLTNB *ap_POIResolution)
void SetNbTOFResolutions(int a_nbTOFResolutions)
FLTNB GetTOFOffsetPs(int a_reso)
int ParseOptionsAndInitializeProjectors()
Parse forward and backward projection options contained in the previously provided strings...
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
const string & GetPathToConfigDir()
Return the path to the CASTOR config directory.
void SetTOFOffsetInMm(FLTNB *ap_TOFOffsetsInMm)
This function is used to set the TOF Offset in use.
void SetTOFBinSizeInMm(FLTNB a_TOFBinSizeInMm)
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
int GetNbBeds()
Get the number of bed positions.
int CheckParameters()
A public function used to check the parameters settings.
FLTNB GetTOFQuantizationBinSizeInPs()
void SetTOFEventResolutionFlag(FLTNB a_TOFEventResolutionFlag)
This function sets the per-event TOF resolution flag.
bool m_useProjectorForward
oProjectionLine * ComputeProjectionLine(vEvent *ap_Event, int a_th)
void SetTOFMeasurementRangeInMm(FLTNB a_TOFMeasurementRangeInMm)
FLTNB * GetPOIResolution()
void Reset()
Reset length and all the voxel indices and weights tabs.
void SetThreadNumber(int a_threadNumber)
void SetTOFMeasurementInPs(FLTNB a_TOFMeasurementInPs)
std::map< string, maker_projector > mp_listOfProjectors
int CheckParameters()
A function used to check the parameters settings.
void ApplyBedOffset(int a_bed)
void SetSensitivityModeOn()
Say that the projector will be used to compute the global sensitivity.
oSystemMatrix * mp_SystemMatrixForward
bool GetCompatibilityWithCompression()
bool m_useMatchedProjectors
#define SYSTEM_MATRIX_KEYWORD
int ProcessAndSetMask(FLTNB *ap_maskImage)
bool m_useProjectorBackward
oSystemMatrix * mp_SystemMatrixBackward
bool IsBackwardOperatorCompatibleWithSPECTAttenuationCorrection()
FLTNB GetTOFBinSizeInPs()
vProjector * mp_ProjectorForward
string m_backwardProjectorName
This class is designed to manage and store system matrix elements associated to a vEvent...
void SetVerbose(int a_verbose)
bool GetTOFEventResolutionFlag()
Mother class for the Event objects.
void SetForwardProjector(vProjector *ap_Projector)
FLTNB GetTOFResolutionInPs(int a_reso)
INTNB GetNbVoxXYZ()
Get the total number of voxels.
void SetApplyPOI(bool a_applyPOI)
void SetBackwardProjector(vProjector *ap_Projector)
int GetNbThreadsForProjection()
Get the number of threads used for projections.
void SetTOFProbabilities(FLTNB *ap_TOFProbabilities)
This function is used to set the TOF probabilities in use.
oProjectionLine ** m2p_ProjectionLines
int Project(int a_direction, oProjectionLine *ap_ProjectionLine, uint32_t *ap_index1, uint32_t *ap_index2, int a_nbIndices)
void SetPOI1(FLTNB *ap_POI1)
FLTNB * mp_TOFProbabilities
int CheckSPECTAttenuationCompatibility(const string &a_pathToAttenuationImage)
void SetComputationStrategy(int a_computationStrategy)
void SetNbTOFBins(int a_nbTOFBins)
void SetPOI2(FLTNB *ap_POI2)
int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data)...
void SetSensitivityMode(bool a_sensitivityMode)
FLTNB m_TOFMeasurementRangeInMm
bool IsForwardOperatorCompatibleWithSPECTAttenuationCorrection()
#define VERBOSE_DEBUG_EVENT