68 if (ap_ImageDimensionsAndQuantification==NULL)
70 Cerr(
"***** vProjector::SetImageDimensionsAndQuantification() -> Input image dimensions object is null !" << endl);
111 Cerr(
"***** vProjector::SetTOFAndPOIOptions() -> POI (position of interaction) has no sense with histogram mode !" << endl);
132 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
133 if (mpi_rank!=0)
return;
136 cout <<
"------------------------------------------------------------------" << endl;
137 cout <<
"----- Common options for all projectors" << endl;
138 cout <<
"------------------------------------------------------------------" << endl;
139 cout <<
"Currently a single common option is implemented, relevant only for TOF recon: " << endl;
140 cout <<
" the number of standard deviations for truncating the TOF distribution." << endl;
154 else cout <<
"This projector is NOT compatible with SPECT attenuation correction." << endl;
166 if (a_optionsList!=
"")
172 Cerr(
"***** vProjector::ReadCommonOptionsList() -> Failed to correctly read the list of options !" << endl);
190 Cerr(
"***** vProjector::CheckParameters() -> vScanner is null !" << endl);
196 Cerr(
"***** vProjector::CheckParameters() -> oImageDimensionsAndQuantification is null !" << endl);
201 Cerr(
"***** vProjector::CheckParameters() -> One or more voxel sizes is negative or null !" << endl);
206 Cerr(
"***** vProjector::CheckParameters() -> One or more number of voxels is negative or null !" << endl);
212 Cerr(
"***** vProjector::CheckParameters() -> TOF flag is incorrect or not set !" << endl);
218 Cerr(
"***** vProjector::CheckParameters() -> Verbose level is negative !" << endl);
224 Cerr(
"***** vProjector::CheckParameters() -> An error occurred while checking parameters of the child projector class !" << endl);
229 Cerr(
"***** vProjector::CheckParameters() -> TOF number of standard deviations is not > 0 !" << endl);
247 Cerr(
"***** vProjector::Initialize() -> Must call the CheckParameters() function before initialization !" << endl);
253 Cerr(
"***** vProjector::Initialize() -> A problem occured while calling the specific initialization of the child projector !" << endl);
281 Cerr(
"***** vProjector::Project() -> Called while not initialized !" << endl);
300 ap_ProjectionLine->
SetIndex1(((
int)(ap_index1[0])));
301 ap_ProjectionLine->
SetIndex2(((
int)(ap_index2[0])));
308 Cerr(
"***** vProjector::Project() -> A problem occured while getting positions and orientations from scanner !" << endl);
329 for (
int i=0; i<3; i++)
333 orientation1[i] = 0.;
334 orientation2[i] = 0.;
337 for (
int l=0; l<a_nbIndices; l++)
341 buffer_position1, buffer_position2,
342 buffer_orientation1, buffer_orientation2,
345 Cerr(
"***** vProjector::Project() -> A problem occured while getting positions and orientations from scanner !" << endl);
349 for (
int i=0; i<3; i++)
351 position1[i] += buffer_position1[i];
352 position2[i] += buffer_position2[i];
353 orientation1[i] += buffer_orientation1[i];
354 orientation2[i] += buffer_orientation2[i];
358 for (
int i=0; i<3; i++)
360 position1[i] /= ((
FLTNB)a_nbIndices);
361 position2[i] /= ((
FLTNB)a_nbIndices);
362 orientation1[i] /= ((
FLTNB)a_nbIndices);
363 orientation2[i] /= ((
FLTNB)a_nbIndices);
395 Cerr(
"***** vProjector::Project() -> A problem occured while projecting a line without time-of-flight !" << endl);
402 Cerr(
"***** vProjector::Project() -> A problem occured while projecting a line with time-of-flight position !" << endl);
409 Cerr(
"***** vProjector::Project() -> A problem occured while projecting a line with binned time-of-flight !" << endl);
416 #ifdef CASTOR_VERBOSE
419 Cout(
"vProjector::Project() -> Exit function" << endl);
bool m_compatibleWithSPECTAttenuationCorrection
FLTNB * GetOrientation1()
This function is used to get the pointer to the mp_orientation1 (3-values tab).
#define VERBOSE_DEBUG_EVENT
FLTNB * GetPOI1()
This function is used to get the pointer to POI of point 1 (3-values tab).
static void ShowCommonHelp()
This function is used to print out some help about the use of options common to all projectors...
FLTNB GetVoxSizeX()
Get the voxel's size along the X axis, in mm.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
FLTNB GetVoxSizeZ()
Get the voxel's size along the Z axis, in mm.
FLTNB * GetBufferPosition2()
This function is used to get the pointer to the mp_bufferPosition2 (3-values tab).
vProjector()
The constructor of vProjector.
int Initialize()
A public function used to initialize the projector.
virtual int ProjectWithoutTOF(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project without TOF.
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.
int SetTOFAndPOIOptions(int a_dataType, bool a_ignoreTOF, bool a_ignorePOI)
Set the TOF use as well as POI and checks compatibility with current data type.
FLTNB * GetBufferPosition1()
This function is used to get the pointer to the mp_bufferPosition1 (3-values tab).
virtual int ProjectWithTOFBin(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project with TOF binned information.
FLTNB * GetOrientation2()
This function is used to get the pointer to the mp_orientation2 (3-values tab).
void SetIndex2(int a_index2)
This function is used to set the index m_index1 of point 2.
virtual int CheckSpecificParameters()=0
A private function used to check the parameters settings specific to the child projector.
void ComputeLineLength()
Simply compute and update the m_length using the associated mp_position1 and mp_position2.
int ReadCommonOptionsList(const string &a_optionsList)
This function is used to read options common to all projectors given as a string. ...
FLTNB GetVoxSizeY()
Get the voxel's size along the Y axis, in mm.
void ApplyOffset()
Apply the offset of oImageDimensionsAndQuantification to the mp_position1 and mp_position2.
FLTNB * GetPosition1()
This function is used to get the pointer to the mp_position1 (3-values tab).
virtual void ShowHelpSpecific()=0
A function used to show help about the child module.
Declaration of class vProjector.
FLTNB * GetBufferOrientation1()
This function is used to get the pointer to the mp_bufferOrientation1 (3-values tab).
virtual ~vProjector()
The destructor of vProjector.
Declaration of class vScanner.
Declaration of class vDataFile.
int CheckParameters()
A public function used to check the parameters settings.
FLTNB * GetBufferOrientation2()
This function is used to get the pointer to the mp_bufferOrientation2 (3-values tab).
void SetIndex1(int a_index1)
This function is used to set the index m_index1 of point 1.
This class is designed to manage and store system matrix elements associated to a vEvent...
virtual int ProjectWithTOFPos(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project with TOF continuous information.
virtual int InitializeSpecific()=0
A private function used to initialize everything specific to the child projector. ...
INTNB GetNbVoxXYZ()
Get the total number of voxels.
This class is designed to manage all dimensions and quantification related stuff. ...
FLTNB * GetPosition2()
This function is used to get the pointer to the mp_position2 (3-values tab).
INTNB GetNbVoxX()
Get the number of voxels along the X axis.
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
virtual INTNB EstimateMaxNumberOfVoxelsPerLine()
This function is used to compute and provide an estimate of the maximum number of voxels that could c...
void ShowHelp()
A function used to show help about the projector.
FLTNB * GetPOI2()
This function is used to get the pointer to POI of point 2 (3-values tab).
int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use and copy locally some often use variables.
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &sep, const string &a_option)
Parse the 'a_input' string corresponding to the 'a_option' into 'a_nbElts' elements, using the 'sep' separator. The results are returned in the templated 'ap_return' dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.
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 o...
void ApplyBedOffset()
Apply the bed offset of m_bedOffset to the mp_position1 and mp_position2.
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.