86 if (ap_ImageDimensionsAndQuantification==NULL)
88 Cerr(
"***** vProjector::SetImageDimensionsAndQuantification() -> Input image dimensions object is null !" << endl);
117 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
118 if (mpi_rank!=0)
return;
121 cout <<
"------------------------------------------------------------------" << endl;
122 cout <<
"----- Common options for all projectors" << endl;
123 cout <<
"------------------------------------------------------------------" << endl;
124 cout <<
"Currently a single common option is implemented, relevant only for TOF recon: " << endl;
125 cout <<
" the number of standard deviations for truncating the TOF distribution." << endl;
139 else cout <<
"This projector is NOT compatible with SPECT attenuation correction." << endl;
151 if (a_optionsList!=
"")
157 Cerr(
"***** vProjector::ReadCommonOptionsList() -> Failed to correctly read the list of options !" << endl);
175 Cerr(
"***** vProjector::CheckParameters() -> Please provide a valid scanner object !" << endl);
181 Cerr(
"***** vProjector::CheckParameters() -> Please provide a valid image dimensions and quantification object !" << endl);
186 Cerr(
"***** vProjector::CheckParameters() -> One or more voxel sizes is negative or null !" << endl);
191 Cerr(
"***** vProjector::CheckParameters() -> One or more number of voxels is negative or null !" << endl);
197 Cerr(
"***** vProjector::CheckParameters() -> TOF flag is incorrect or not set !" << endl);
203 Cerr(
"***** vProjector::CheckParameters() -> Verbose level is negative !" << endl);
209 Cerr(
"***** vProjector::CheckParameters() -> An error occurred while checking parameters of the child projector class !" << endl);
215 Cerr(
"***** vProjector::CheckParameters() -> TOF number of standard deviations is not > 0 !" << endl);
233 Cerr(
"***** vProjector::Initialize() -> Must call the CheckParameters() function before initialization !" << endl);
239 Cerr(
"***** vProjector::Initialize() -> A problem occured while calling the specific initialization of the child projector !" << endl);
268 Cerr(
"***** vProjector::Project() -> Called while not initialized !" << endl);
287 ap_ProjectionLine->
SetIndex1(((
int)(ap_index1[0])));
288 ap_ProjectionLine->
SetIndex2(((
int)(ap_index2[0])));
295 Cerr(
"***** vProjector::Project() -> A problem occured while getting positions and orientations from scanner !" << endl);
316 for (
int i=0; i<3; i++)
320 orientation1[i] = 0.;
321 orientation2[i] = 0.;
324 for (
int l=0; l<a_nbIndices; l++)
328 buffer_position1, buffer_position2,
329 buffer_orientation1, buffer_orientation2,
332 Cerr(
"***** vProjector::Project() -> A problem occured while getting positions and orientations from scanner !" << endl);
336 for (
int i=0; i<3; i++)
338 position1[i] += buffer_position1[i];
339 position2[i] += buffer_position2[i];
340 orientation1[i] += buffer_orientation1[i];
341 orientation2[i] += buffer_orientation2[i];
345 for (
int i=0; i<3; i++)
347 position1[i] /= ((
FLTNB)a_nbIndices);
348 position2[i] /= ((
FLTNB)a_nbIndices);
349 orientation1[i] /= ((
FLTNB)a_nbIndices);
350 orientation2[i] /= ((
FLTNB)a_nbIndices);
382 Cerr(
"***** vProjector::Project() -> A problem occured while projecting a line without time-of-flight !" << endl);
389 Cerr(
"***** vProjector::Project() -> A problem occured while projecting a line with time-of-flight position !" << endl);
396 Cerr(
"***** vProjector::Project() -> A problem occured while projecting a line with binned time-of-flight !" << endl);
403 #ifdef CASTOR_VERBOSE
406 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.
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...
bool m_compatibleWithCompression
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.