131 Cerr(
"***** oProjectionLine::CheckParameters() -> Forbidden number of TOF bins (" <<
m_nbTOFBins <<
") !" << endl);
136 Cerr(
"***** oProjectionLine::CheckParameters() -> Computation strategy incorrectly set !" << endl);
141 Cerr(
"***** oProjectionLine::CheckParameters() -> POI resolution not set !" << endl);
146 Cerr(
"***** oProjectionLine::CheckParameters() -> oImageDimensionsAndQuantification not set !" << endl);
151 Cerr(
"***** oProjectionLine::CheckParameters() -> The thread number associated to this line is not set !" << endl);
169 Cerr(
"***** oProjectionLine::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
216 Cerr(
"***** oProjectionLine::Initialize() -> Image computation strategy is not compatible with the use of system matrix projectors !" << endl);
220 if (
m_verbose>=5)
Cout(
" --> Choose the image computation strategy" << endl);
251 if (
m_verbose>=5)
Cout(
" --> Choose the fixed list computation strategy" << endl);
259 if (
m_verbose>=5)
Cout(
" --> System matrix for forward projection" << endl);
288 if (
m_verbose>=5)
Cout(
" --> System matrix for backward projection" << endl);
320 Cerr(
"***** oProjectionLine::Initialize() -> Adaptative list computation strategy is not compatible with the use of system matrix projectors !" << endl);
326 if (
m_verbose>=5)
Cout(
" --> Choose the adaptative list computation strategy, starting with " << nb_voxels <<
" allocated voxels" << endl);
376 Cerr(
"***** oProjectionLine::ComputeLineLength() -> Called while not initialized !" << endl);
381 #ifdef CASTOR_VERBOSE
382 if (
m_verbose>=10)
Cout(
"oProjectionLine::ComputeLineLength() -> Compute length of the line" << endl);
400 Cerr(
"***** oProjectionLine::NotEmptyLine() -> Called while not initialized !" << endl);
405 #ifdef CASTOR_VERBOSE
406 if (
m_verbose>=10)
Cout(
"oProjectionLine::NotEmptyLine() -> Look if line is empty" << endl);
424 Cerr(
"***** oProjectionLine::Reset() -> Called while not initialized !" << endl);
429 #ifdef CASTOR_VERBOSE
430 if (
m_verbose>=10)
Cout(
"oProjectionLine::Reset() -> Reset buffers of the line" << endl);
472 Cerr(
"***** oProjectionLine::ApplyOffset() -> Called while not initialized !" << endl);
477 #ifdef CASTOR_VERBOSE
478 if (
m_verbose>=10)
Cout(
"oProjectionLine::ApplyOffset() -> Apply the global offset to the line end points" << endl);
501 Cerr(
"***** oProjectionLine::ApplyBedOffset() -> Called while not initialized !" << endl);
506 #ifdef CASTOR_VERBOSE
507 if (
m_verbose>=10)
Cout(
"oProjectionLine::ApplyBedOffset() -> Apply the bed position offset to the line end points" << endl);
526 Cerr(
"***** oProjectionLine::GetVoxelIndex() -> Called while not initialized !" << endl);
531 #ifdef CASTOR_VERBOSE
534 string direction =
"";
535 if (a_direction==
FORWARD) direction =
"forward";
536 else direction =
"backward";
537 Cout(
"oProjectionLine::GetVoxelIndex() -> Get voxel index of voxel number " << a_voxelInLine <<
" in TOF bin " << a_TOFBin <<
" of " << direction <<
" projector" << endl);
543 return a_voxelInLine;
559 Cerr(
"***** oProjectionLine::AddVoxelInTOFBin() -> Called while not initialized !" << endl);
564 #ifdef CASTOR_VERBOSE
567 string direction =
"";
568 if (a_direction==
FORWARD) direction =
"forward";
569 else direction =
"backward";
570 Cout(
"oProjectionLine::AddVoxelInTOFBin() -> Add voxel index " << a_voxelIndex <<
" of weight " << a_voxelWeight <<
571 " into TOF bin " << a_TOFBin <<
" of " << direction <<
" projector" << endl);
585 m3p_voxelWeights[a_direction][a_TOFBin][m2p_currentNbVoxels[a_direction][a_TOFBin]] = a_voxelWeight;
586 m2p_currentNbVoxels[a_direction][a_TOFBin]++;
600 m3p_voxelWeights[a_direction][a_TOFBin][m2p_currentNbVoxels[a_direction][a_TOFBin]] = a_voxelWeight;
601 m2p_currentNbVoxels[a_direction][a_TOFBin]++;
615 Cerr(
"***** oProjectionLine::AddVoxel() -> Called while not initialized !" << endl);
620 #ifdef CASTOR_VERBOSE
623 string direction =
"";
624 if (a_direction==
FORWARD) direction =
"forward";
625 else direction =
"backward";
626 Cout(
"oProjectionLine::AddVoxel() -> Add voxel index " << a_voxelIndex <<
" of weight " << a_voxelWeight <<
627 " in " << direction <<
" projector" << endl);
644 m3p_voxelWeights[a_direction][no_tof_bin][m2p_currentNbVoxels[a_direction][no_tof_bin]] = a_voxelWeight;
645 m2p_currentNbVoxels[a_direction][no_tof_bin]++;
659 m3p_voxelWeights[a_direction][no_tof_bin][m2p_currentNbVoxels[a_direction][no_tof_bin]] = a_voxelWeight;
660 m2p_currentNbVoxels[a_direction][no_tof_bin]++;
714 Cerr(
"***** oProjectionLine::ForwardProjectWithSPECTAttenuation() -> Cannot be used with an image computation strategy over the projection line !" << endl);
720 Cerr(
"***** oProjectionLine::ForwardProjectWithSPECTAttenuation() -> Cannot be used with an incompatible projector !" << endl);
740 atn_sum = std::exp( -atn_sum *0.1 );
754 if(ap_attenuation != NULL)
759 atn_sum = std::exp( -atn_sum *0.1 );
807 Cerr(
"***** oProjectionLine::BackwardProjectWithSPECTAttenuation() -> Cannot be used with an image computation strategy over the projection line !" << endl);
813 Cerr(
"***** oProjectionLine::BackwardProjectWithSPECTAttenuation() -> Cannot be used with an incompatible projector !" << endl);
828 if(ap_attenuation != NULL)
832 atn_sum = std::exp( -atn_sum *0.1 );
~oProjectionLine()
The destructor of oProjectionLine.
bool m_UseMatchedProjectors
#define IMAGE_COMPUTATION_STRATEGY
FLTNB ForwardProjectWithSPECTAttenuation(FLTNB *ap_attenuation, FLTNB *ap_image=NULL)
Forward projects the provided image for the current TOF bin with an inner loop on the attenuation (fo...
FLTNB * mp_bufferOrientation1
vProjector * mp_ForwardProjector
#define ADAPTATIVE_LIST_COMPUTATION_STRATEGY
bool GetCompatibilityWithSPECTAttenuationCorrection()
oProjectionLine()
The constructor of oProjectionLine.
void ComputeLineLength()
Simply compute and update the m_length using the associated mp_position1 and mp_position2.
#define FIXED_LIST_COMPUTATION_STRATEGY
INTNB GetVoxelIndex(int a_direction, int a_TOFBin, INTNB a_voxelInLine)
This function is used to get the contributing voxel index of the provided direction, TOF bin and voxel rank.
INTNB *** m3p_voxelIndices
Declaration of class oProjectionLine.
void BackwardProject(FLTNB *ap_image, FLTNB a_value)
Simply backward projects the provided value inside the provided image, for the current TOF bin...
void ApplyOffset()
Apply the offset of oImageDimensionsAndQuantification to the mp_position1 and mp_position2.
FLTNB *** m3p_voxelWeights
Declaration of class vProjector.
void BackwardProjectWithSPECTAttenuation(FLTNB *ap_attenuation, FLTNB *ap_image, FLTNB a_value)
Backward project the provided value inside the provided image with an inner loop on the attenuation (...
void AddVoxel(int a_direction, INTNB a_voxelIndice, FLTNB a_voxelWeight)
This function is used to add a voxel contribution to the line, assuming TOF bin 0 (i...
void Reset()
Reset length and all the voxel indices and weights tabs.
bool NotEmptyLine()
This function is used to know if the line contains any voxel contribution.
FLTNB m_multiplicativeCorrection
FLTNB GetOffsetY()
Get the image offset along the Y axis, in mm.
INTNB GetNbVoxDiagonal()
Get an estimation of the number of voxels along the image diagonal.
FLTNB GetOffsetZ()
Get the image offset along the Z axis, in mm.
Declaration of class sOutputManager.
int m_computationStrategy
FLTNB ForwardProject(FLTNB *ap_image=NULL)
Simply forward projects the provided image if not null, or else 1, for the current TOF bin...
INTNB GetNbVoxXYZ()
Get the total number of voxels.
FLTNB * mp_bufferPosition1
FLTNB * mp_bufferOrientation2
FLTNB GetOffsetX()
Get the image offset along the X axis, in mm.
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
INTNB ** m2p_allocatedNbVoxels
virtual INTNB EstimateMaxNumberOfVoxelsPerLine()
This function is used to compute and provide an estimate of the maximum number of voxels that could c...
void AddVoxelInTOFBin(int a_direction, int a_TOFBin, INTNB a_voxelIndice, FLTNB a_voxelWeight)
This function is used to add a voxel contribution to the line and provided TOF bin.
int CheckParameters()
A function used to check the parameters settings.
int Initialize()
A function used to initialize a bunch of stuff after parameters have been checked.
FLTNB * mp_bufferPosition2
void ApplyBedOffset()
Apply the bed offset of m_bedOffset to the mp_position1 and mp_position2.
INTNB ** m2p_currentNbVoxels
vProjector * mp_BackwardProjector
FLTNB ComputeLineIntegral(int a_direction)
It simply computes the sum of all voxels contributions following the provided direction.