8 #include "oProjectorManager.hh" 9 #include "sOutputManager.hh" 10 #include "sAddonManager.hh" 11 #include "iDataFilePET.hh" 12 #include "iProjectorClassicSiddon.hh" 131 Cerr(
"***** oProjectorManager::CheckParameters() -> No scanner provided !" << endl);
137 Cerr(
"***** oProjectorManager::CheckParameters() -> No image dimensions provided !" << endl);
143 Cerr(
"***** oProjectorManager::CheckParameters() -> No data file provided !" << endl);
151 Cerr(
"***** oProjectorManager::CheckParameters() -> Unknown computation strategy provided !" << endl);
157 Cerr(
"***** oProjectorManager::CheckParameters() -> No forward projector options provided !" << endl);
163 Cerr(
"***** oProjectorManager::CheckParameters() -> No backward projector options provided !" << endl);
169 Cerr(
"***** oProjectorManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
192 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The image-computation strategy of the oProjectionLine is not compatible with SPECT attenuation correction !");
198 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The forward projector is not compatible with SPECT attenuation correction !" << endl);
204 Cerr(
"***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The backward projector is not compatible with SPECT attenuation correction !" << endl);
222 Cerr(
"***** oProjectorManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
227 if (
m_verbose>=1)
Cout(
"oProjectorManager::Initialize() -> Initialize projectors and projection lines" << endl);
307 Cerr(
"***** oProjectorManager::Initialize() -> POI information has no sense with histogram data !" << endl);
329 Cerr(
"***** oProjectorManager::Initialize() -> A problem occurred while parsing projector options and initializing it !" << endl);
341 if ( (dynamic_cast<iDataFilePET*>(
mp_DataFile))->GetMaxNumberOfLinesPerEvent() > 1 )
346 Cerr(
"***** oProjectorManager::Initialize() -> Cannot use a loaded forward system matrix with compression in the datafile !" << endl);
352 Cerr(
"***** oProjectorManager::Initialize() -> Selected forward projector '" <<
m_forwardProjectorName <<
"' is not compatible with compression in the datafile !" << endl);
358 Cerr(
"***** oProjectorManager::Initialize() -> Cannot use a loaded backward system matrix with compression in the datafile !" << endl);
364 Cerr(
"***** oProjectorManager::Initialize() -> Selected backward projector '" <<
m_backwardProjectorName <<
"' is not compatible with compression in the datafile !" << endl);
401 Cerr(
"***** oProjectorManager::Initialize() -> An error occurred while checking parameters of an oProjectionLine !" << endl);
406 Cerr(
"***** oProjectorManager::Initialize() -> An error occurred while initializing an oProjectionLine !" << endl);
423 string list_options =
"";
424 string file_options =
"";
441 if (colon!=string::npos)
451 else if (comma!=string::npos)
482 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
500 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << m_forwardProjectorName <<
"' does not exist !" << endl);
507 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while setting the image dimensions of the forward projector !" << endl);
521 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading forward projector's common options !" << endl);
527 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading forward projector's configuration file !" << endl);
533 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading forward projector's options !" << endl);
539 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while checking forward projector parameters !" << endl);
545 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while initializing the forward projector !" << endl);
574 if (colon!=string::npos)
584 else if (comma!=string::npos)
615 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
633 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << m_backwardProjectorName <<
"' does not exist !" << endl);
640 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while setting the image dimensions of the backward projector !" << endl);
654 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading backward projector's common options !" << endl);
660 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading backward projector's configuration file !" << endl);
666 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while parsing and reading backward projector's options !" << endl);
672 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while checking backward projector parameters !" << endl);
678 Cerr(
"***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occurred while initializing backward projector !" << endl);
752 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> Called while not initialized !" << endl);
814 int return_value = 0;
821 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> A problem occurred while forward projecting an event !" << endl);
835 Cerr(
"***** oProjectorManager::ComputeProjectionLine() -> A problem occurred while backward projecting an event !" << endl);
853 Cerr(
"***** oProjectorManager::ProcessAndSetMask() -> Mask already initialized !" << endl);
virtual EVTFLTDATA * GetCustomFLTData()
int m_computationStrategy
void SetEventIndex(int a_eventIndex)
Set current index associated to the event.
FLTNB GetTOFMeasurementRangeInPs()
#define IMAGE_COMPUTATION_STRATEGY
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
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.
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)
void SetTOFSigmaInPs(FLTNB a_TOFSigmaInPs)
This function is used to set the TOF standard deviation associated with the line. ...
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)
virtual int GetNbCustomFLTData()
bool GetCompatibilityWithSPECTAttenuationCorrection()
static sAddonManager * GetInstance()
int ReadCommonOptionsList(const string &a_optionsList)
#define FIXED_LIST_COMPUTATION_STRATEGY
int64_t GetEventIndex()
Get current index associated to the event.
void SetApplyTOF(int a_applyTOF)
~oProjectorManager()
The destructor of oProjectorManager.
void SetPOIResolution(FLTNB *ap_POIResolution)
bool GetPerEventTOFResolutionFlag() const
Simply return m_perEventTOFResolutionFlag.
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 SetTOFBinSizeInMm(FLTNB a_TOFBinSizeInMm)
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
int GetNbBeds()
Get the number of bed positions.
void SetCustomINTData(EVTINTDATA *ap_pointer)
int CheckParameters()
A public function used to check the parameters settings.
FLTNB GetTOFQuantizationBinSizeInPs()
void SetReadPerEventTOFResolution(bool a_readPerEventTOFResolution)
This function is used to set flag informing that TOF resolution should be read per event from datafil...
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)
bool m_usePerEventTOFResolution
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
FLTNB m_TOFResolutionInMm
int ProcessAndSetMask(FLTNB *ap_maskImage)
bool m_useProjectorBackward
oSystemMatrix * mp_SystemMatrixBackward
bool IsBackwardOperatorCompatibleWithSPECTAttenuationCorrection()
FLTNB GetTOFBinSizeInPs()
vProjector * mp_ProjectorForward
string m_backwardProjectorName
virtual int GetNbCustomINTData()
This class is designed to manage and store system matrix elements associated to a vEvent...
void SetVerbose(int a_verbose)
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)
void SetNbCustomINTData(int a_value)
int GetNbThreadsForProjection()
Get the number of threads used for projections.
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)
int CheckSPECTAttenuationCompatibility(const string &a_pathToAttenuationImage)
void SetComputationStrategy(int a_computationStrategy)
void SetCustomFLTData(EVTFLTDATA *ap_pointer)
virtual EVTINTDATA * GetCustomINTData()
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()
void SetNbCustomFLTData(int a_value)
#define VERBOSE_DEBUG_EVENT