CASToR  3.0
Tomographic Reconstruction (PET/SPECT/CT)
vProjector.cc
Go to the documentation of this file.
1 /*
2 This file is part of CASToR.
3 
4  CASToR is free software: you can redistribute it and/or modify it under the
5  terms of the GNU General Public License as published by the Free Software
6  Foundation, either version 3 of the License, or (at your option) any later
7  version.
8 
9  CASToR is distributed in the hope that it will be useful, but WITHOUT ANY
10  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  details.
13 
14  You should have received a copy of the GNU General Public License along with
15  CASToR (in file GNU_GPL.TXT). If not, see <http://www.gnu.org/licenses/>.
16 
17 Copyright 2017-2019 all CASToR contributors listed below:
18 
19  --> Didier BENOIT, Claude COMTAT, Marina FILIPOVIC, Thibaut MERLIN, Mael MILLARDET, Simon STUTE, Valentin VIELZEUF
20 
21 This is CASToR version 3.0.
22 */
23 
30 #include "vProjector.hh"
31 #include "vScanner.hh"
32 #include "vDataFile.hh"
33 
34 // =====================================================================
35 // ---------------------------------------------------------------------
36 // ---------------------------------------------------------------------
37 // =====================================================================
38 
40 {
41  // Affect default values
42  mp_Scanner = NULL;
44  mp_sizeVox[0] = -1.;
45  mp_sizeVox[1] = -1.;
46  mp_sizeVox[2] = -1.;
47  mp_nbVox[0] = -1;
48  mp_nbVox[1] = -1;
49  mp_nbVox[2] = -1;
50  m_nbVoxXY = -1;
51  mp_halfFOV[0] = -1.;
52  mp_halfFOV[1] = -1.;
53  mp_halfFOV[2] = -1.;
54  m_sensitivityMode = false;
55  m_TOFMethod = -1;
56  m_TOFNbSigmas = -1.;
58  m_applyPOI = false;
61  m_verbose = 0;
62  m_checked = false;
63  m_initialized = false;
64  mp_mask = NULL;
65  m_hasMask = false;
66  mp_TOFWeightingFcn = NULL;
69  m_TOFResolutionInMm = -1.;
70  m_TOFBinSizeInMm = -1.;
73 }
74 
75 // =====================================================================
76 // ---------------------------------------------------------------------
77 // ---------------------------------------------------------------------
78 // =====================================================================
79 
81 {
82 }
83 
84 // =====================================================================
85 // ---------------------------------------------------------------------
86 // ---------------------------------------------------------------------
87 // =====================================================================
88 
90 {
91  // Check that the parameter is not NULL
92  if (ap_ImageDimensionsAndQuantification==NULL)
93  {
94  Cerr("***** vProjector::SetImageDimensionsAndQuantification() -> Input image dimensions object is null !" << endl);
95  return 1;
96  }
97  // Affect image dimensions
98  mp_sizeVox[0] = ap_ImageDimensionsAndQuantification->GetVoxSizeX();
99  mp_sizeVox[1] = ap_ImageDimensionsAndQuantification->GetVoxSizeY();
100  mp_sizeVox[2] = ap_ImageDimensionsAndQuantification->GetVoxSizeZ();
101  mp_nbVox[0] = ap_ImageDimensionsAndQuantification->GetNbVoxX();
102  mp_nbVox[1] = ap_ImageDimensionsAndQuantification->GetNbVoxY();
103  mp_nbVox[2] = ap_ImageDimensionsAndQuantification->GetNbVoxZ();
104  m_nbVoxXY = mp_nbVox[0] * mp_nbVox[1];
105  mp_halfFOV[0] = mp_sizeVox[0] * ((FLTNB)mp_nbVox[0]) / 2.;
106  mp_halfFOV[1] = mp_sizeVox[1] * ((FLTNB)mp_nbVox[1]) / 2.;
107  mp_halfFOV[2] = mp_sizeVox[2] * ((FLTNB)mp_nbVox[2]) / 2.;
108  mp_ImageDimensionsAndQuantification = ap_ImageDimensionsAndQuantification;
109  // Normal end
110  return 0;
111 }
112 
113 // =====================================================================
114 // ---------------------------------------------------------------------
115 // ---------------------------------------------------------------------
116 // =====================================================================
117 
119 {
120  // Return when using MPI and mpi_rank is not 0
121  #ifdef CASTOR_MPI
122  int mpi_rank = 0;
123  MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
124  if (mpi_rank!=0) return;
125  #endif
126  // Show help
127  cout << "------------------------------------------------------------------" << endl;
128  cout << "----- Common options for all projectors" << endl;
129  cout << "------------------------------------------------------------------" << endl;
130  cout << "Only options related to TOF implementation are available." << endl;
131  cout << "If used, values for all of the following options must be provided as a list of numbers separated by commas." << endl;
132  cout << "" << endl;
133  cout << " the number of standard deviations for truncating the nominal TOF Gaussian distribution (-1 for no truncation)." << endl;
134  cout << " whether the TOF weighting function is precomputed (1 for yes, 0 for no)" << endl;
135  cout << " whether the TOF weighting function takes properly into account the TOF bin using convolution or integration (1 for yes, 0 for no)." << endl;
136  cout << "" << endl;
137  cout << "The default values are -1,1,1" << endl;
138 
139 }
140 
141 // =====================================================================
142 // ---------------------------------------------------------------------
143 // ---------------------------------------------------------------------
144 // =====================================================================
145 
147 {
148  // Call the specific help function from the children
150  // Then, say if the child projector in use is compatible with SPECT attenuation correction or not
151  if (m_compatibleWithSPECTAttenuationCorrection) cout << "This projector is compatible with SPECT attenuation correction." << endl;
152  else cout << "This projector is NOT compatible with SPECT attenuation correction." << endl;
153 }
154 
155 // =====================================================================
156 // ---------------------------------------------------------------------
157 // ---------------------------------------------------------------------
158 // =====================================================================
159 
160 int vProjector::ReadCommonOptionsList(const string& a_optionsList)
161 {
162  // TODO : make this more explicit, here it is assumed that 3 specific TOF options are provided
163  if (a_optionsList!="")
164  {
165  FLTNB option[3];
166  // Read the options
167  if (ReadStringOption(a_optionsList, option, 3, ",", "Common options"))
168  {
169  Cerr("***** vProjector::ReadCommonOptionsList() -> Failed to correctly read the list of options !" << endl);
170  return 1;
171  }
172  m_TOFNbSigmas = option[0];
173  m_TOFWeightingFcnPrecomputedFlag = option[1]>0.;
174  m_TOFBinProperProcessingFlag = option[2]>0.;
175  }
176  return 0;
177 }
178 
179 // =====================================================================
180 // ---------------------------------------------------------------------
181 // ---------------------------------------------------------------------
182 // =====================================================================
183 
185 {
186  // Check scanner
187  if (mp_Scanner==NULL)
188  {
189  Cerr("***** vProjector::CheckParameters() -> Please provide a valid scanner object !" << endl);
190  return 1;
191  }
192  // Check image dimensions
194  {
195  Cerr("***** vProjector::CheckParameters() -> Please provide a valid image dimensions and quantification object !" << endl);
196  return 1;
197  }
198  if (mp_sizeVox[0]<=0. || mp_sizeVox[1]<=0. || mp_sizeVox[2]<=0.)
199  {
200  Cerr("***** vProjector::CheckParameters() -> One or more voxel sizes is negative or null !" << endl);
201  return 1;
202  }
203  if (mp_nbVox[0]<=0 || mp_nbVox[1]<=0 || mp_nbVox[2]<=0)
204  {
205  Cerr("***** vProjector::CheckParameters() -> One or more number of voxels is negative or null !" << endl);
206  return 1;
207  }
208  // Check TOF
210  {
211  Cerr("***** vProjector::CheckParameters() -> TOF flag is incorrect or not set !" << endl);
212  return 1;
213  }
214  // Check TOF parameters
215  if (m_TOFMethod!=USE_NOTOF)
216  {
218  {
219  Cerr("***** vProjector::CheckParameters() -> Inconsistent TOF related parameters !" << endl);
220  return 1;
221  }
223  {
224  Cout("***** vProjector::CheckParameters() -> Warning: quantization TOF bin size wrong or not provided, so switching to TOF list-mode reconstruction which neglects the quantization TOF bin size!" << endl);
226  }
227  }
228  // Check verbose level
229  if (m_verbose<0)
230  {
231  Cerr("***** vProjector::CheckParameters() -> Verbose level is negative !" << endl);
232  return 1;
233  }
234  // Check parameters of the child class
236  {
237  Cerr("***** vProjector::CheckParameters() -> An error occurred while checking parameters of the child projector class !" << endl);
238  return 1;
239  }
240 
241  // Normal end
242  m_checked = true;
243  return 0;
244 }
245 
246 // =====================================================================
247 // ---------------------------------------------------------------------
248 // ---------------------------------------------------------------------
249 // =====================================================================
250 
252 {
253  // First check that the parameters have been checked !
254  if (!m_checked)
255  {
256  Cerr("***** vProjector::Initialize() -> Must call the CheckParameters() function before initialization !" << endl);
257  return 1;
258  }
259 
260  // TOF parameters
261  if (m_TOFMethod!=USE_NOTOF)
262  {
263  // Gaussian standard deviation
264  HPFLTNB tof_resolution_sigma = m_TOFResolutionInMm / TWO_SQRT_TWO_LN_2;
265 
266  // If the provided number of sigmas is negative, set it to a value large enough
267  // to approximate no truncation of the Gaussian distribution
268  // (the TOF weighting function is in any case limited by the available TOF measurement range)
269  if (m_TOFNbSigmas<0.) m_TOFNbSigmas = m_TOFMeasurementRangeInMm / tof_resolution_sigma;
270 
271  // Ideal Gaussian normalization coefficient (integral=1)
272  m_TOFGaussianNormCoef = INV_SQRT_2_PI / tof_resolution_sigma;
273 
274  // Precompute the TOF weighting function if required
276  {
277  // Initialize some variables to default values, TODO make this an optional parameter
278  // Sample the TOF weighting function at 1/m_TOFPrecomputedSamplingFactor of the spatial unit (mm)
280 
281  HPFLTNB tof_half_span = tof_resolution_sigma * m_TOFNbSigmas;
282 
283  // number of samples for the Gaussian function truncated at m_TOFNbSigmas standard deviations
284  INTNB nb_samples_tof_gauss = (INTNB)ceil(tof_half_span*2.*m_TOFPrecomputedSamplingFactor);
285  // make the number of samples odd
286  if (nb_samples_tof_gauss % 2 == 0) nb_samples_tof_gauss += 1;
287 
288  // normalized Gaussian function for list-mode data (assumption of continuous TOF measurements)
289  // normalized Gaussian function for TOF histogram data multiplied by the size of the TOF bin (assumption of constant Gaussian function over a TOF bin)
291  {
292  mp_TOFWeightingFcn = new HPFLTNB[nb_samples_tof_gauss];
293  // Gaussian mean at the center
294  INTNB mu = nb_samples_tof_gauss/2;
295  for (INTNB g=0;g<nb_samples_tof_gauss;g++)
296  {
297  HPFLTNB temp = ((HPFLTNB)(g-mu))/(tof_resolution_sigma*m_TOFPrecomputedSamplingFactor);
298  mp_TOFWeightingFcn[g] = m_TOFGaussianNormCoef * exp(-0.5*(temp*temp));
300  }
301  m_TOFWeightingFcnNbSamples = nb_samples_tof_gauss;
302  }
303  // convolution of the normalized Gaussian with the TOF bin (cumulative or quantization bin)
304  else
305  {
306  // number of samples for the TOF bin door function
307  INTNB nb_samples_tof_bin = (INTNB)round(m_TOFBinSizeInMm*m_TOFPrecomputedSamplingFactor);
308  // make the number of samples odd
309  if (nb_samples_tof_bin % 2 == 0) nb_samples_tof_bin += 1;
310 
311  // number of samples for the convolution
312  INTNB nb_samples_conv = nb_samples_tof_gauss+nb_samples_tof_bin-1;
313 
314  // normalized Gaussian function truncated at m_TOFNbSigmas standard deviations
315  // padded with zeros to the size of the convolved function
316  HPFLTNB* tof_gauss = new HPFLTNB[nb_samples_conv];
317  INTNB mu = nb_samples_conv/2;
318  for (INTNB sgauss=0;sgauss<nb_samples_conv;sgauss++)
319  {
320  if (sgauss<mu-nb_samples_tof_gauss/2 || sgauss>mu+nb_samples_tof_gauss/2) tof_gauss[sgauss]=0.;
321  else
322  {
323  HPFLTNB temp = (HPFLTNB)((sgauss-mu))/(tof_resolution_sigma*m_TOFPrecomputedSamplingFactor);
324  tof_gauss[sgauss] = m_TOFGaussianNormCoef * exp(-0.5*(temp*temp));
325  }
326  }
327 
328  // TOF bin door function (quantization bin for list-mode, cumulative bin for histogram data)
329  HPFLTNB* tof_bin = new HPFLTNB[nb_samples_tof_bin];
330  // intensity = 1 for the cumulative bin, 1/binSize for the quantization bin
331  HPFLTNB tof_bin_value = (m_TOFMethod==USE_TOFLIST)?(1./(m_TOFBinSizeInMm*m_TOFPrecomputedSamplingFactor)):(1./m_TOFPrecomputedSamplingFactor);
332  for (INTNB sbin=0;sbin<nb_samples_tof_bin;sbin++) tof_bin[sbin] = tof_bin_value;
333 
334  // the final TOF weighting function
335  mp_TOFWeightingFcn = new HPFLTNB[nb_samples_conv];
336  for (INTNB s=0;s<nb_samples_conv;s++) mp_TOFWeightingFcn[s] = 0.;
337 
338  // convolve the TOF bin with the Gaussian function
339  for (INTNB c=0;c<nb_samples_conv;c++)
340  {
341  for (INTNB ib=0;ib<nb_samples_tof_bin;ib++)
342  {
343  INTNB temp = c-nb_samples_tof_bin/2+ib;
344  if (temp>=0 && temp<nb_samples_conv) mp_TOFWeightingFcn[c] += tof_gauss[temp]*tof_bin[ib];
345  }
346  }
347 
348  m_TOFWeightingFcnNbSamples = nb_samples_conv;
349 
350  // clean
351  delete []tof_bin;
352  delete []tof_gauss;
353  tof_bin = NULL;
354  tof_gauss = NULL;
355  }
356  }
357 
358  // Verbose
360  {
361  Cout(" --> TOF weighting function implementation: " << endl);
362  Cout(" --> Gaussian truncation (number of standard deviations) " << m_TOFNbSigmas << endl);
364  {
365  Cout(" --> Precomputed " << endl);
367  {
368  Cout(" --> Convolved with the "<<((m_TOFMethod==USE_TOFHISTO)?"cumulative":"quantization")<<" TOF bin (size " <<m_TOFBinSizeInMm<<"mm)" <<endl);
369  }
370  else
371  {
372  if (m_TOFMethod==USE_TOFHISTO) Cout(" --> Simple multiplication with the cumulative TOF bin (size " <<m_TOFBinSizeInMm<<"mm)" <<endl);
373  else if (m_TOFMethod==USE_TOFLIST) Cout(" --> Simple normalized Gaussian"<<endl);
374  }
375  }
376  else
377  {
378  Cout(" --> Computation on the fly " << endl);
380  {
381  Cout(" --> Integration of the Gaussian over the "<<((m_TOFMethod==USE_TOFHISTO)?"cumulative":"quantization")<<" TOF bin (size " <<m_TOFBinSizeInMm<<"mm)" <<endl);
382  }
383  else
384  {
385  if (m_TOFMethod==USE_TOFHISTO) Cout(" --> Simple multiplication with the cumulative TOF bin (size " <<m_TOFBinSizeInMm<<"mm)" <<endl);
386  else if (m_TOFMethod==USE_TOFLIST) Cout(" --> Simple normalized Gaussian"<<endl);
387  }
388  }
389  }
390  }
391 
392  // Call the intialize function specific to the children
393  if (InitializeSpecific())
394  {
395  Cerr("***** vProjector::Initialize() -> A problem occurred while calling the specific initialization of the child projector !" << endl);
396  return 1;
397  }
398 
399  if (m_verbose>=3)
400  {
401  Cout("vProjector::Initialize() -> Exit function" << endl);
402  }
403 
404  // Normal end
405  m_initialized = true;
406  return 0;
407 }
408 
409 // =====================================================================
410 // ---------------------------------------------------------------------
411 // ---------------------------------------------------------------------
412 // =====================================================================
413 
415 {
417 }
418 
419 // =====================================================================
420 // ---------------------------------------------------------------------
421 // ---------------------------------------------------------------------
422 // =====================================================================
423 
424 int vProjector::Project(int a_direction, oProjectionLine* ap_ProjectionLine, uint32_t* ap_index1, uint32_t* ap_index2, int a_nbIndices)
425 {
426  #ifdef CASTOR_DEBUG
427  if (!m_initialized)
428  {
429  Cerr("***** vProjector::Project() -> Called while not initialized !" << endl);
430  Exit(EXIT_DEBUG);
431  }
432  #endif
433 
435 
436  // ---------------------------------------------------------------------------------------
437  // First: Get cartesian coordinates from the scanner and average positions if compression.
438  // Here, we differentiate the case with no compression (i.e. a_nbIndices==1) from the
439  // compression case, because it will avoid to perform useless computation without
440  // compression. However, it produces some duplication of code parts as a compromise.
441  // ---------------------------------------------------------------------------------------
442 
443  // ______________________________________________________________________________________
444  // Case1: no compression (i.e. a_nbIndices==1)
445  if (a_nbIndices==1)
446  {
447  // Set indices of the line
448  ap_ProjectionLine->SetIndex1(((int)(ap_index1[0])));
449  ap_ProjectionLine->SetIndex2(((int)(ap_index2[0])));
450  // Get positions and orientations from the scanner (mean depth of interaction intrinsicaly taken into account), taking POI into account if any
451  if (mp_Scanner->GetPositionsAndOrientations( ((int)(ap_index1[0])), ((int)(ap_index2[0])),
452  ap_ProjectionLine->GetPosition1(), ap_ProjectionLine->GetPosition2(),
453  ap_ProjectionLine->GetOrientation1(), ap_ProjectionLine->GetOrientation2(),
454  ap_ProjectionLine->GetPOI1(), ap_ProjectionLine->GetPOI2() ))
455  {
456  Cerr("***** vProjector::Project() -> A problem occurred while getting positions and orientations from scanner !" << endl);
457  return 1;
458  }
459  }
460  // ______________________________________________________________________________________
461  // Case2: compression (i.e. a_nbIndices>1)
462  else
463  {
464  // Set default indices of the line to -1 when compression
465  ap_ProjectionLine->SetIndex1(-1);
466  ap_ProjectionLine->SetIndex2(-1);
467  // Buffer pointers for positions and orientations handled by the projection line
468  FLTNB* position1 = ap_ProjectionLine->GetPosition1();
469  FLTNB* position2 = ap_ProjectionLine->GetPosition2();
470  FLTNB* orientation1 = ap_ProjectionLine->GetOrientation1();
471  FLTNB* orientation2 = ap_ProjectionLine->GetOrientation2();
472  FLTNB* buffer_position1 = ap_ProjectionLine->GetBufferPosition1();
473  FLTNB* buffer_position2 = ap_ProjectionLine->GetBufferPosition2();
474  FLTNB* buffer_orientation1 = ap_ProjectionLine->GetBufferOrientation1();
475  FLTNB* buffer_orientation2 = ap_ProjectionLine->GetBufferOrientation2();
476  // Zero the position and orientation
477  for (int i=0; i<3; i++)
478  {
479  position1[i] = 0.;
480  position2[i] = 0.;
481  orientation1[i] = 0.;
482  orientation2[i] = 0.;
483  }
484  // Loop on provided indices
485  for (int l=0; l<a_nbIndices; l++)
486  {
487  // Get positions and orientations from scanner (mean depth of interaction intrinsicaly taken into account), taking POI into account if any
488  if (mp_Scanner->GetPositionsAndOrientations( ((int)(ap_index1[l])), ((int)(ap_index2[l])),
489  buffer_position1, buffer_position2,
490  buffer_orientation1, buffer_orientation2,
491  ap_ProjectionLine->GetPOI1(), ap_ProjectionLine->GetPOI2() ))
492  {
493  Cerr("***** vProjector::Project() -> A problem occurred while getting positions and orientations from scanner !" << endl);
494  return 1;
495  }
496  // Add those contributions to the mean position and orientation
497  for (int i=0; i<3; i++)
498  {
499  position1[i] += buffer_position1[i];
500  position2[i] += buffer_position2[i];
501  orientation1[i] += buffer_orientation1[i];
502  orientation2[i] += buffer_orientation2[i];
503  }
504  }
505  // Average positions and orientations
506  for (int i=0; i<3; i++)
507  {
508  position1[i] /= ((FLTNB)a_nbIndices);
509  position2[i] /= ((FLTNB)a_nbIndices);
510  orientation1[i] /= ((FLTNB)a_nbIndices);
511  orientation2[i] /= ((FLTNB)a_nbIndices);
512  }
513  }
514 
515  // --------------------------------------------------------------
516  // Second: Modify the end points coordinates from common options,
517  // random, offset, and LOR displacements.
518  // -----------------------------------------------------------
519 
520  // Apply common options TODO
521 
522  // Apply LORs displacement TODO
523 
524  // Apply global image offset
525  ap_ProjectionLine->ApplyOffset();
526 
527  // Apply bed position offset
528  ap_ProjectionLine->ApplyBedOffset();
529 
530  // -----------------------------------------------------------
531  // Third: project the line
532  // -----------------------------------------------------------
533 
534  // Compute LOR length
535  ap_ProjectionLine->ComputeLineLength();
536 
537  // Switch on different TOF options
538  switch (m_TOFMethod)
539  {
540  case USE_NOTOF:
541  if (ProjectWithoutTOF( a_direction, ap_ProjectionLine ))
542  {
543  Cerr("***** vProjector::Project() -> A problem occurred while projecting a line without time-of-flight !" << endl);
544  return 1;
545  }
546  break;
547  case USE_TOFLIST:
548  if (ProjectTOFListmode( a_direction, ap_ProjectionLine ))
549  {
550  Cerr("***** vProjector::Project() -> A problem occurred while projecting a line with time-of-flight position !" << endl);
551  return 1;
552  }
553  break;
554  case USE_TOFHISTO:
555  if (ProjectTOFHistogram( a_direction, ap_ProjectionLine ))
556  {
557  Cerr("***** vProjector::Project() -> A problem occurred while projecting a line with binned time-of-flight !" << endl);
558  return 1;
559  }
560  break;
561  // No default
562  }
563 
564  #ifdef CASTOR_VERBOSE
565  if (m_verbose>=10)
566  {
567  Cout("vProjector::Project() -> Exit function" << endl);
568  }
569  #endif
570 
571  // End
572  return 0;
573 }
574 
575 // =====================================================================
576 // ---------------------------------------------------------------------
577 // ---------------------------------------------------------------------
578 // =====================================================================
bool m_applyPOI
Definition: vProjector.hh:403
bool m_checked
Definition: vProjector.hh:414
bool m_compatibleWithSPECTAttenuationCorrection
Definition: vProjector.hh:407
FLTNB * GetOrientation1()
This function is used to get the pointer to the mp_orientation1 (3-values tab).
#define VERBOSE_DEBUG_EVENT
FLTNB mp_sizeVox[3]
Definition: vProjector.hh:378
FLTNB * GetPOI1()
This function is used to get the pointer to POI of point 1 (3-values tab).
FLTNB m_TOFNbSigmas
Definition: vProjector.hh:389
static void ShowCommonHelp()
This function is used to print out some help about the use of options common to all projectors...
Definition: vProjector.cc:118
INTNB m_nbVoxXY
Definition: vProjector.hh:380
INTNB mp_nbVox[3]
Definition: vProjector.hh:379
#define FLTNB
Definition: gVariables.hh:81
FLTNB GetVoxSizeX()
Get the voxel&#39;s size along the X axis, in mm.
FLTNB m_TOFGaussianNormCoef
Definition: vProjector.hh:397
#define TWO_SQRT_TWO_LN_2
Definition: gVariables.hh:100
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
Definition: vProjector.hh:384
#define HPFLTNB
Definition: gVariables.hh:83
FLTNB GetVoxSizeZ()
Get the voxel&#39;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).
#define USE_TOFHISTO
Definition: vProjector.hh:47
vProjector()
The constructor of vProjector.
Definition: vProjector.cc:39
int m_TOFMethod
Definition: vProjector.hh:388
int Initialize()
A public function used to initialize the projector.
Definition: vProjector.cc:251
bool m_TOFWeightingFcnPrecomputedFlag
Definition: vProjector.hh:391
bool m_TOFBinProperProcessingFlag
Definition: vProjector.hh:392
HPFLTNB * mp_TOFWeightingFcn
Definition: vProjector.hh:393
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.
Definition: vProjector.cc:424
FLTNB * GetBufferPosition1()
This function is used to get the pointer to the mp_bufferPosition1 (3-values tab).
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.
void Exit(int code)
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.
#define USE_TOFLIST
Definition: vProjector.hh:49
int ReadCommonOptionsList(const string &a_optionsList)
This function is used to read options common to all projectors given as a string. ...
Definition: vProjector.cc:160
FLTNB GetVoxSizeY()
Get the voxel&#39;s size along the Y axis, in mm.
#define Cerr(MESSAGE)
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.
bool m_initialized
Definition: vProjector.hh:416
bool m_sensitivityMode
Definition: vProjector.hh:405
Declaration of class vProjector.
bool * mp_mask
Definition: vProjector.hh:400
FLTNB * GetBufferOrientation1()
This function is used to get the pointer to the mp_bufferOrientation1 (3-values tab).
virtual ~vProjector()
The destructor of vProjector.
Definition: vProjector.cc:80
Declaration of class vScanner.
virtual int ProjectTOFHistogram(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project with TOF binned information.
Declaration of class vDataFile.
int CheckParameters()
A public function used to check the parameters settings.
Definition: vProjector.cc:184
FLTNB m_TOFResolutionInMm
Definition: vProjector.hh:396
virtual int ProjectTOFListmode(int a_direction, oProjectionLine *ap_ProjectionLine)=0
A function to project with TOF continuous information.
#define VERBOSE_NORMAL
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.
bool m_hasMask
Definition: vProjector.hh:401
#define INTNB
Definition: gVariables.hh:92
This class is designed to manage and store system matrix elements associated to a vEvent...
FLTNB m_TOFPrecomputedSamplingFactor
Definition: vProjector.hh:398
virtual int InitializeSpecific()=0
A private function used to initialize everything specific to the child projector. ...
FLTNB m_TOFBinSizeInMm
Definition: vProjector.hh:394
INTNB GetNbVoxXYZ()
Get the total number of voxels.
FLTNB m_TOFMeasurementRangeInMm
Definition: vProjector.hh:395
FLTNB mp_halfFOV[3]
Definition: vProjector.hh:381
#define EXIT_DEBUG
Definition: gVariables.hh:97
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 INV_SQRT_2_PI
Definition: gVariables.hh:103
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
INTNB GetNbVoxZ()
Get the number of voxels along the Z axis.
#define USE_NOTOF
Definition: vProjector.hh:51
#define Cout(MESSAGE)
virtual INTNB EstimateMaxNumberOfVoxelsPerLine()
This function is used to compute and provide an estimate of the maximum number of voxels that could c...
Definition: vProjector.cc:414
bool m_compatibleWithCompression
Definition: vProjector.hh:410
void ShowHelp()
A function used to show help about the projector.
Definition: vProjector.cc:146
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.
Definition: vProjector.cc:89
int ReadStringOption(const string &a_input, T *ap_return, int a_nbElts, const string &sep, const string &a_option)
Parse the &#39;a_input&#39; string corresponding to the &#39;a_option&#39; into &#39;a_nbElts&#39; elements, using the &#39;sep&#39; separator. The results are returned in the templated &#39;ap_return&#39; dynamic templated array. Call "ConvertFromString()" to perform the correct conversion depending on the type of the data to convert.
Definition: gOptions.cc:50
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.
vScanner * mp_Scanner
Definition: vProjector.hh:386
INTNB GetNbVoxY()
Get the number of voxels along the Y axis.
INTNB m_TOFWeightingFcnNbSamples
Definition: vProjector.hh:390