141 Cerr(
"***** oProjectionLine::CheckParameters() -> Forbidden number of TOF bins (" <<
m_nbTOFBins <<
") !" << endl);
146 Cerr(
"***** oProjectionLine::CheckParameters() -> Computation strategy incorrectly set !" << endl);
151 Cerr(
"***** oProjectionLine::CheckParameters() -> POI resolution not set !" << endl);
156 Cerr(
"***** oProjectionLine::CheckParameters() -> oImageDimensionsAndQuantification not set !" << endl);
161 Cerr(
"***** oProjectionLine::CheckParameters() -> The thread number associated to this line is not set !" << endl);
179 Cerr(
"***** oProjectionLine::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
226 Cerr(
"***** oProjectionLine::Initialize() -> Image computation strategy is not compatible with the use of system matrix projectors !" << endl);
230 if (
m_verbose>=5)
Cout(
" --> Choose the image computation strategy" << endl);
261 if (
m_verbose>=5)
Cout(
" --> Choose the fixed list computation strategy" << endl);
269 if (
m_verbose>=5)
Cout(
" --> System matrix for forward projection" << endl);
302 if (
m_verbose>=5)
Cout(
" --> System matrix for backward projection" << endl);
338 Cerr(
"***** oProjectionLine::Initialize() -> Adaptative list computation strategy is not compatible with the use of system matrix projectors !" << endl);
344 if (
m_verbose>=5)
Cout(
" --> Choose the adaptative list computation strategy, starting with " << nb_voxels <<
" allocated voxels" << endl);
394 Cerr(
"***** oProjectionLine::ComputeLineLength() -> Called while not initialized !" << endl);
399 #ifdef CASTOR_VERBOSE 400 if (
m_verbose>=10)
Cout(
"oProjectionLine::ComputeLineLength() -> Compute length of the line" << endl);
418 Cerr(
"***** oProjectionLine::NotEmptyLine() -> Called while not initialized !" << endl);
423 #ifdef CASTOR_VERBOSE 424 if (
m_verbose>=10)
Cout(
"oProjectionLine::NotEmptyLine() -> Look if line is empty" << endl);
442 Cerr(
"***** oProjectionLine::Reset() -> Called while not initialized !" << endl);
447 #ifdef CASTOR_VERBOSE 448 if (
m_verbose>=10)
Cout(
"oProjectionLine::Reset() -> Reset buffers of the line" << endl);
490 Cerr(
"***** oProjectionLine::ApplyOffset() -> Called while not initialized !" << endl);
495 #ifdef CASTOR_VERBOSE 496 if (
m_verbose>=10)
Cout(
"oProjectionLine::ApplyOffset() -> Apply the global offset to the line end points" << endl);
519 Cerr(
"***** oProjectionLine::ApplyBedOffset() -> Called while not initialized !" << endl);
524 #ifdef CASTOR_VERBOSE 525 if (
m_verbose>=10)
Cout(
"oProjectionLine::ApplyBedOffset() -> Apply the bed position offset to the line end points" << endl);
544 Cerr(
"***** oProjectionLine::GetVoxelIndex() -> Called while not initialized !" << endl);
549 #ifdef CASTOR_VERBOSE 552 string direction =
"";
553 if (a_direction==
FORWARD) direction =
"forward";
554 else direction =
"backward";
555 Cout(
"oProjectionLine::GetVoxelIndex() -> Get voxel index of voxel number " << a_voxelInLine <<
" in TOF bin " << a_TOFBin <<
" of " << direction <<
" projector" << endl);
561 return a_voxelInLine;
577 Cerr(
"***** oProjectionLine::AddVoxelInTOFBin() -> Called while not initialized !" << endl);
582 #ifdef CASTOR_VERBOSE 585 string direction =
"";
586 if (a_direction==
FORWARD) direction =
"forward";
587 else direction =
"backward";
588 Cout(
"oProjectionLine::AddVoxelInTOFBin() -> Add voxel index " << a_voxelIndex <<
" of weight " << a_voxelWeight <<
589 " into TOF bin " << a_TOFBin <<
" of " << direction <<
" projector" << endl);
597 m3p_voxelWeights[a_direction][a_TOFBin][m2p_currentNbVoxels[a_direction][a_TOFBin]] = a_voxelWeight;
598 m2p_currentNbVoxels[a_direction][a_TOFBin]++;
612 m3p_voxelWeights[a_direction][a_TOFBin][m2p_currentNbVoxels[a_direction][a_TOFBin]] = a_voxelWeight;
613 m2p_currentNbVoxels[a_direction][a_TOFBin]++;
633 Cerr(
"***** oProjectionLine::AddVoxelAllTOFBins() -> Called while not initialized !" << endl);
638 #ifdef CASTOR_VERBOSE 641 string direction =
"";
642 if (a_direction==
FORWARD) direction =
"forward";
643 else direction =
"backward";
644 Cout(
"oProjectionLine::AddVoxelAllTOFBin() -> Add voxel index " << a_voxelIndex <<
" and weights for all TOF bins of " 645 << direction <<
" projector" << endl);
651 for (
INTNB t=a_tofBinFirst; t<=a_tofBinLast; t++)
655 m3p_voxelWeights[a_direction][t][m2p_currentNbVoxels[a_direction][t]] = a_voxelWeight * (
FLTNB)(a_tofWeights[t]);
656 m2p_currentNbVoxels[a_direction][t]++;
661 for (
INTNB t=a_tofBinFirst; t<=a_tofBinLast; t++)
673 m3p_voxelWeights[a_direction][t][m2p_currentNbVoxels[a_direction][t]] = a_voxelWeight * (
FLTNB)(a_tofWeights[t]);
674 m2p_currentNbVoxels[a_direction][t]++;
681 for (
INTNB t=a_tofBinFirst; t<=a_tofBinLast; t++)
698 Cerr(
"***** oProjectionLine::AddVoxel() -> Called while not initialized !" << endl);
703 #ifdef CASTOR_VERBOSE 706 string direction =
"";
707 if (a_direction==
FORWARD) direction =
"forward";
708 else direction =
"backward";
709 Cout(
"oProjectionLine::AddVoxel() -> Add voxel index " << a_voxelIndex <<
" of weight " << a_voxelWeight <<
710 " in " << direction <<
" projector" << endl);
721 m3p_voxelWeights[a_direction][no_tof_bin][m2p_currentNbVoxels[a_direction][no_tof_bin]] = a_voxelWeight;
722 m2p_currentNbVoxels[a_direction][no_tof_bin]++;
736 m3p_voxelWeights[a_direction][no_tof_bin][m2p_currentNbVoxels[a_direction][no_tof_bin]] = a_voxelWeight;
737 m2p_currentNbVoxels[a_direction][no_tof_bin]++;
797 Cerr(
"***** oProjectionLine::ForwardProjectWithSPECTAttenuation() -> Cannot be used with an image computation strategy over the projection line !" << endl);
803 Cerr(
"***** oProjectionLine::ForwardProjectWithSPECTAttenuation() -> Cannot be used with an incompatible projector !" << endl);
816 if (ap_attenuation == NULL)
836 atn_sum = std::exp( -atn_sum *0.1 );
846 if (ap_attenuation == NULL)
866 atn_sum = exp( atn_sum * ((
FLTNB)(-0.1)) );
914 Cerr(
"***** oProjectionLine::BackwardProjectWithSPECTAttenuation() -> Cannot be used with an image computation strategy over the projection line !" << endl);
920 Cerr(
"***** oProjectionLine::BackwardProjectWithSPECTAttenuation() -> Cannot be used with an incompatible projector !" << endl);
930 if (ap_attenuation == NULL)
950 atn_sum = exp( atn_sum * ((
FLTNB)(-0.1)) );
~oProjectionLine()
The destructor of oProjectionLine.
#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...
void AddVoxelAllTOFBins(int a_direction, INTNB a_voxelIndex, FLTNB a_voxelWeight, HPFLTNB *a_tofWeights, INTNB a_tofBinFirst, INTNB a_tofBinLast)
Add a voxel contribution to the line for all relevant TOF bins.
FLTNB * mp_bufferOrientation1
FLTNB m_TOFMeasurementInPs
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.
bool m_useMatchedProjectors
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.