CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
oProjectorManager.cc
Go to the documentation of this file.
1 
2 /*
3  Implementation of class oProjectorManager
4 
5  - separators: done
6  - doxygen: done
7  - default initialization: done
8  - CASTOR_DEBUG:
9  - CASTOR_VERBOSE:
10 */
11 
18 #include "oProjectorManager.hh"
19 #include "sOutputManager.hh"
20 #include "sAddonManager.hh"
21 #include "iDataFilePET.hh"
22 
23 // =====================================================================
24 // ---------------------------------------------------------------------
25 // ---------------------------------------------------------------------
26 // =====================================================================
27 
29 {
30  // Scanner and image dimensions
31  mp_Scanner = NULL;
33  // Data file (used to get some info about TOF bins and POI)
34  mp_DataFile = NULL;
35  // TOF and POI options
36  m_applyTOF = false;
37  m_applyPOI = false;
38  m_nbTOFBins = -1;
39  // Computation strategy for projection lines
41  // Forward and backward options for projectors
42  m_optionsForward = "";
43  m_optionsBackward = "";
44  // Common options
45  m_optionsCommon = "";
46  // Forward and backward projectors
49  mp_ProjectorForward = NULL;
50  mp_ProjectorBackward = NULL;
53  m_UseProjectorForward = false;
54  m_UseProjectorBackward = false;
55  m_UseMatchedProjectors = false;
56  // Forward and backward projection lines (as many as threads)
57  m2p_ProjectionLines = NULL;
58  // Verbosity
59  m_verbose = 0;
60  // Not checked yet
61  m_checked = false;
62  // Not initialized yet
63  m_initialized = false;
64 }
65 
66 // =====================================================================
67 // ---------------------------------------------------------------------
68 // ---------------------------------------------------------------------
69 // =====================================================================
70 
71 
73 {
74  // Go through the destructor only if the object was initialized
75  if (m_initialized)
76  {
77  // Delete projection lines
79  if (m2p_ProjectionLines[th]) delete m2p_ProjectionLines[th];
81  // Delete projectors
85  {
88  }
89  }
90 }
91 
92 // =====================================================================
93 // ---------------------------------------------------------------------
94 // ---------------------------------------------------------------------
95 // =====================================================================
96 
98 {
99  // Case for a vProjector
101  // Case for a system matrix
103 }
104 
105 // =====================================================================
106 // ---------------------------------------------------------------------
107 // ---------------------------------------------------------------------
108 // =====================================================================
109 
111 {
112  // Case for a vProjector
114  // Case for a system matrix
116 }
117 
118 // =====================================================================
119 // ---------------------------------------------------------------------
120 // ---------------------------------------------------------------------
121 // =====================================================================
122 
124 {
125  // Check scanner
126  if (mp_Scanner==NULL)
127  {
128  Cerr("***** oProjectorManager::CheckParameters() -> No scanner provided !" << endl);
129  return 1;
130  }
131  // Check image dimensions
133  {
134  Cerr("***** oProjectorManager::CheckParameters() -> No image dimensions provided !" << endl);
135  return 1;
136  }
137  // Check data file
138  if (mp_DataFile==NULL)
139  {
140  Cerr("***** oProjectorManager::CheckParameters() -> No data file provided !" << endl);
141  return 1;
142  }
143  // Check computation strategy
147  {
148  Cerr("***** oProjectorManager::CheckParameters() -> Unknown computation strategy provided !" << endl);
149  return 1;
150  }
151  // Check forward projector options
152  if (m_optionsForward=="")
153  {
154  Cerr("***** oProjectorManager::CheckParameters() -> No forward projector options provided !" << endl);
155  return 1;
156  }
157  // Check backward projector options
158  if (m_optionsBackward=="")
159  {
160  Cerr("***** oProjectorManager::CheckParameters() -> No backward projector options provided !" << endl);
161  return 1;
162  }
163  // Check verbosity
164  if (m_verbose<0)
165  {
166  Cerr("***** oProjectorManager::CheckParameters() -> Wrong verbosity level provided !" << endl);
167  return 1;
168  }
169  // Normal end
170  m_checked = true;
171  return 0;
172 }
173 
174 // =====================================================================
175 // ---------------------------------------------------------------------
176 // ---------------------------------------------------------------------
177 // =====================================================================
178 
179 int oProjectorManager::CheckSPECTAttenuationCompatibility(const string& a_pathToAttenuationImage)
180 {
181  // In SPECT with attenuation correction, there are some requirements with the projection method
182  if (a_pathToAttenuationImage!="" && mp_DataFile->GetDataType()==TYPE_SPECT)
183  {
184  // Check that the projection line strategy is not IMAGE_COMPUTATION_STRATEGY (this is not compatible)
185  // Note that we cannot do this check in the oProjectionLine directly, because we cannot now in advance
186  // that the projection method including attenuation will be used...
188  {
189  Cerr("***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The image-computation strategy of the oProjectionLine is not compatible with SPECT attenuation correction !");
190  return 1;
191  }
192  // Check that the forward projector is compatible with SPECT with attenuation correction
194  {
195  Cerr("***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The forward projector is not compatible with SPECT attenuation correction !" << endl);
196  return 1;
197  }
198  // Check that the backward projector is compatible with SPECT with attenuation correction
200  {
201  Cerr("***** oProjectorManager::CheckSPECTAttenuationCompatibility() -> The backward projector is not compatible with SPECT attenuation correction !" << endl);
202  return 1;
203  }
204  }
205  // End
206  return 0;
207 }
208 
209 // =====================================================================
210 // ---------------------------------------------------------------------
211 // ---------------------------------------------------------------------
212 // =====================================================================
213 
215 {
216  // Forbid initialization without check
217  if (!m_checked)
218  {
219  Cerr("***** oProjectorManager::Initialize() -> Must call CheckParameters() before Initialize() !" << endl);
220  return 1;
221  }
222 
223  // Verbose
224  if (m_verbose>=1) Cout("oProjectorManager::Initialize() -> Initialize projectors and projection lines" << endl);
225 
226  // TOF-PET specific stuff
227  FLTNB tof_resolution = -1.;
228  FLTNB tof_bin_size = -1.;
230  {
231  // Cast the datafile pointer
232  iDataFilePET* p_pet_datafile = (dynamic_cast<iDataFilePET*>(mp_DataFile));
233  // Case of TOF information in the datafile
234  if (p_pet_datafile->GetTOFInfoFlag())
235  {
236  // Case where it is asked to ignore TOF info
237  if (p_pet_datafile->GetIgnoreTOFFlag())
238  {
239  m_applyTOF = false;
240  m_nbTOFBins = 1;
241  }
242  // Otherwise, we use TOF
243  else
244  {
245  m_applyTOF = true;
246  // Get the number of TOF bins from the data file
247  m_nbTOFBins = p_pet_datafile->GetNbTOFBins();
248  // Get the TOF resolution from the data file, if we apply TOF
249  tof_resolution = p_pet_datafile->GetTOFResolution();
250  // Get the TOF bin size in ps, if we apply TOF
251  tof_bin_size = p_pet_datafile->GetTOFBinSize();
252  }
253  }
254  // Case no TOF
255  else
256  {
257  m_applyTOF = false;
258  m_nbTOFBins = 1;
259  }
260  }
261  else m_nbTOFBins = 1;
262 
263  // Look if we must apply POI or not
265  else m_applyPOI = false;
266  // Get POI resolution from the data file
267  FLTNB* poi_resolution = mp_DataFile->GetPOIResolution();
268 
269  // Compare projector options to know if we use matched ones for forward and backward operations
271  else m_UseMatchedProjectors = false;
272 
273  // Parse projector options and initialize them
275  {
276  Cerr("***** oProjectorManager::Initialize() -> A problem occured while parsing projector options and initializing it !" << endl);
277  return 1;
278  }
279 
280  // Initialize as many projection lines as threads
283  {
288  m2p_ProjectionLines[th]->SetTOFBinSize(tof_bin_size);
289  m2p_ProjectionLines[th]->SetTOFResolution(tof_resolution);
290  m2p_ProjectionLines[th]->SetPOIResolution(poi_resolution);
297  {
298  Cerr("***** oProjectorManager::Initialize() -> An error occured while checking parameters of an oProjectionLine !" << endl);
299  return 1;
300  }
301  if (m2p_ProjectionLines[th]->Initialize())
302  {
303  Cerr("***** oProjectorManager::Initialize() -> An error occured while initializing an oProjectionLine !" << endl);
304  return 1;
305  }
306  }
307 
308  // Normal end
309  m_initialized = true;
310  return 0;
311 }
312 
313 // =====================================================================
314 // ---------------------------------------------------------------------
315 // ---------------------------------------------------------------------
316 // =====================================================================
317 
319 {
320  string projector = "";
321  string list_options = "";
322  string file_options = "";
323 
324  // This is for the automatic initialization of the projectors
325  typedef vProjector *(*maker_projector) ();
326 
327  // ---------------------------------------------------------------------------------------------------
328  // Manage forward projector
329  // ---------------------------------------------------------------------------------------------------
330 
331  // ______________________________________________________________________________
332  // Get the projector name in the options and isolate the real projector's options
333 
334  // Search for a colon ":", this indicates that a configuration file is provided after the projector name
335  size_t colon = m_optionsForward.find_first_of(":");
336  size_t comma = m_optionsForward.find_first_of(",");
337 
338  // Case 1: we have a colon
339  if (colon!=string::npos)
340  {
341  // Get the projector name before the colon
342  projector = m_optionsForward.substr(0,colon);
343  // Get the configuration file after the colon
344  file_options = m_optionsForward.substr(colon+1);
345  // List of options is empty
346  list_options = "";
347  }
348  // Case 2: we have a comma
349  else if (comma!=string::npos)
350  {
351  // Get the projector name before the first comma
352  projector = m_optionsForward.substr(0,comma);
353  // Get the list of options after the first comma
354  list_options = m_optionsForward.substr(comma+1);
355  // Configuration file is empty
356  file_options = "";
357  }
358  // Case 3: no colon and no comma (a single projector name)
359  else
360  {
361  // Get the projector name
362  projector = m_optionsForward;
363  // List of options is empty
364  list_options = "";
365  // Build the default configuration file
366  file_options = sOutputManager::GetInstance()->GetPathToConfigDir() + "/projector/" + projector + ".conf";
367  }
368 
369  // ______________________________________________________________________________
370  // Case 1: projector is equal to keyword 'matrix', then use a system matrix
371  if (projector==SYSTEM_MATRIX_KEYWORD)
372  {
373  mp_ProjectorForward = NULL;
374  m_UseProjectorForward = false;
376  // TODO: put all these limitations into a dedicated function from oSystemMatrix
377  // TODO: forbid TOF in PET with system matrix
378  // TODO: forbid simultaneous bed reconstruction with system matrix
379  // TODO: forbid image offset with system matrix
380  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
381  return 1;
382  }
383  // ______________________________________________________________________________
384  // Case 2: on-the-fly projector
385  else
386  {
387  // Unset system matrix
388  mp_SystemMatrixForward = NULL;
389  m_UseSystemMatrixForward = false;
390  // Set projector on
391  m_UseProjectorForward = true;
392  // Get projector's listfrom addon manager
393  std::map <string,maker_projector> list = sAddonManager::GetInstance()->mp_listOfProjectors;
394  // Create the projector
395  if (list[projector]) mp_ProjectorForward = list[projector]();
396  else
397  {
398  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << projector << "' does not exist !" << endl);
399  return 1;
400  }
401  // Set parameters
404  {
405  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while setting the image dimensions of the forward projector !" << endl);
406  return 1;
407  }
409  {
410  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while setting the TOF and POI options of the forward projector !" << endl);
411  return 1;
412  }
414  // Provide common options list
416  {
417  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading forward projector's common options !" << endl);
418  return 1;
419  }
420  // Provide configuration file if any
421  if (file_options!="" && mp_ProjectorForward->ReadConfigurationFile(file_options))
422  {
423  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading forward projector's configuration file !" << endl);
424  return 1;
425  }
426  // Provide options if any
427  if (list_options!="" && mp_ProjectorForward->ReadOptionsList(list_options))
428  {
429  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading forward projector's options !" << endl);
430  return 1;
431  }
432  // Check parameters
434  {
435  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while checking forward projector parameters !" << endl);
436  return 1;
437  }
438  // Initialize the projector
440  {
441  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while initializing the forward projector !" << endl);
442  return 1;
443  }
444  }
445 
446  // ---------------------------------------------------------------------------------------------------
447  // Manage backward projector
448  // ---------------------------------------------------------------------------------------------------
449 
450  // If options are the same, then forward and backward are the same
452  {
453  // In this case, matched projectors
458  }
459  // Else, unmatched projectors
460  else
461  {
462  // ______________________________________________________________________________
463  // Get the projector name in the options and isolate the real projector's options
464 
465  // Search for a colon ":", this indicates that a configuration file is provided after the projector name
466  colon = m_optionsBackward.find_first_of(":");
467  comma = m_optionsBackward.find_first_of(",");
468 
469  // Case 1: we have a colon
470  if (colon!=string::npos)
471  {
472  // Get the projector name before the colon
473  projector = m_optionsBackward.substr(0,colon);
474  // Get the configuration file after the colon
475  file_options = m_optionsBackward.substr(colon+1);
476  // List of options is empty
477  list_options = "";
478  }
479  // Case 2: we have a comma
480  else if (comma!=string::npos)
481  {
482  // Get the projector name before the first comma
483  projector = m_optionsBackward.substr(0,comma);
484  // Get the list of options after the first comma
485  list_options = m_optionsBackward.substr(comma+1);
486  // Configuration file is empty
487  file_options = "";
488  }
489  // Case 3: no colon and no comma (a single projector name)
490  else
491  {
492  // Get the projector name
493  projector = m_optionsBackward;
494  // List of options is empty
495  list_options = "";
496  // Build the default configuration file
497  file_options = sOutputManager::GetInstance()->GetPathToConfigDir() + "/projector/" + projector + ".conf";
498  }
499 
500  // ______________________________________________________________________________
501  // Case 1: projector is equal to keyword 'matrix', then use a system matrix
502  if (projector==SYSTEM_MATRIX_KEYWORD)
503  {
504  mp_ProjectorBackward = NULL;
505  m_UseProjectorBackward = false;
507  // TODO: put all these limitations into a dedicated function from oSystemMatrix
508  // TODO: forbid TOF in PET with system matrix
509  // TODO: forbid simultaneous bed reconstruction with system matrix
510  // TODO: forbid image offset with system matrix
511  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Loading of custom system matrices is not yet implemented !" << endl);
512  return 1;
513  }
514  // ______________________________________________________________________________
515  // Case 2: on-the-fly projector
516  else
517  {
518  // Unset system matrix
521  // Set projector on
522  m_UseProjectorBackward = true;
523  // Get projector's listfrom addon manager
524  std::map <string,maker_projector> list = sAddonManager::GetInstance()->mp_listOfProjectors;
525  // Create the projector
526  if (list[projector]) mp_ProjectorBackward = list[projector]();
527  else
528  {
529  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> Projector '" << projector << "' does not exist !" << endl);
530  return 1;
531  }
532  // Set parameters
535  {
536  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while setting the image dimensions of the backward projector !" << endl);
537  return 1;
538  }
540  {
541  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while setting the TOF and POI of the backward projector !" << endl);
542  return 1;
543  }
545  // Provide common options list
547  {
548  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading backward projector's common options !" << endl);
549  return 1;
550  }
551  // Provide configuration file if any
552  if (file_options!="" && mp_ProjectorBackward->ReadConfigurationFile(file_options))
553  {
554  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading backward projector's configuration file !" << endl);
555  return 1;
556  }
557  // Provide options if any
558  if (list_options!="" && mp_ProjectorBackward->ReadOptionsList(list_options))
559  {
560  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while parsing and reading backward projector's options !" << endl);
561  return 1;
562  }
563  // Check parameters
565  {
566  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while checking backward projector parameters !" << endl);
567  return 1;
568  }
569  // Initialize the projector
571  {
572  Cerr("***** oProjectorManager::ParseOptionsAndInitializeProjectors() -> A problem occured while initializing backward projector !" << endl);
573  return 1;
574  }
575  }
576  }
577 
578  // Normal end
579  return 0;
580 }
581 
582 // =====================================================================
583 // ---------------------------------------------------------------------
584 // ---------------------------------------------------------------------
585 // =====================================================================
586 
588 {
589  // Get the number of beds locally
591  // Get out if only one bed
592  if (nb_beds==1) return;
593  // Compute bed offset (remember here that the 0. on the Z axis is at the center of the whole image)
594  FLTNB bed_offset = 0.;
595  // For odd numbers of bed positions
596  if (nb_beds%2==1)
597  {
598  bed_offset = ((FLTNB)( a_bed-nb_beds/2 )) * mp_Scanner->GetMultiBedDisplacementInMm();
599  }
600  // For even numbers of bed positions
601  else
602  {
603  bed_offset = (((FLTNB)( a_bed-nb_beds/2 )) + 0.5) * mp_Scanner->GetMultiBedDisplacementInMm();
604  }
605  // Apply it to all projection lines
607  m2p_ProjectionLines[th]->SetBedOffset(bed_offset);
608 }
609 
610 // =====================================================================
611 // ---------------------------------------------------------------------
612 // ---------------------------------------------------------------------
613 // =====================================================================
614 
616 {
617  #ifdef CASTOR_DEBUG
618  if (!m_initialized)
619  {
620  Cerr("***** oProjectorManager::ComputeProjectionLine() -> Called while not initialized !" << endl);
621  return NULL;
622  }
623  #endif
624 
626 
627  // Get the list of indices
628  uint32_t *index1 = ap_Event->GetEventID1();
629  uint32_t *index2 = ap_Event->GetEventID2();
630  int nb_indices = ap_Event->GetNbLines();
631 
632  // Clean the projection line
633  m2p_ProjectionLines[a_th]->Reset();
634 
635  // With list-mode data, we may need POI and/or TOF measurements
636  if (ap_Event->GetDataMode()==MODE_LIST)
637  {
638  // Set POI measurement
639  if (m_applyPOI)
640  {
641  // For PET
642  if (ap_Event->GetDataType()==TYPE_PET)
643  {
644  // Have to dynamic_cast the event into a iEventPETList to access the GetPOI functions
645  m2p_ProjectionLines[a_th]->SetPOI1((dynamic_cast<iEventListPET*>(ap_Event))->GetPOI1());
646  m2p_ProjectionLines[a_th]->SetPOI2((dynamic_cast<iEventListPET*>(ap_Event))->GetPOI2());
647  }
648  // For SPECT
649  if (ap_Event->GetDataType()==TYPE_SPECT)
650  {
651  // By convention in SPECT, the second end point is in the camera (the first one being outside)
652  //m2p_ProjectionLines[a_th]->SetPOI2((dynamic_cast<iEventListModeSPECT*>(ap_Event))->GetPOI());
653  }
654  // For transmission
655  if (ap_Event->GetDataType()==TYPE_TRANSMISSION)
656  {
657  ;
658  }
659  }
660  // Set TOF measurement (only for PET obviously)
661  if (m_applyTOF && ap_Event->GetDataType()==TYPE_PET)
662  {
663  // Have to dynamic_cast the event into a iEventPETList to access the GetTOF function
664  m2p_ProjectionLines[a_th]->SetTOFMeasurement((dynamic_cast<iEventListPET*>(ap_Event))->GetTOFMeasurement());
665  }
666  }
667 
668  // Project forward (and also compute line length)
669  int return_value = 0;
671  return_value = mp_ProjectorForward->Project( FORWARD, m2p_ProjectionLines[a_th], index1, index2, nb_indices );
672  else if (m_UseSystemMatrixForward)
673  return_value = mp_SystemMatrixForward->Project( FORWARD, m2p_ProjectionLines[a_th], index1, index2, nb_indices );
674  if (return_value)
675  {
676  Cerr("***** oProjectorManager::ComputeProjectionLine() -> A problem occured while forward projecting an event !" << endl);
677  return NULL;
678  }
679 
680  // Project backward
682  {
683  // Then project
685  return_value = mp_ProjectorBackward->Project( BACKWARD, m2p_ProjectionLines[a_th], index1, index2, nb_indices );
686  else if (m_UseSystemMatrixBackward)
687  return_value = mp_SystemMatrixBackward->Project( BACKWARD, m2p_ProjectionLines[a_th], index1, index2, nb_indices);
688  if (return_value)
689  {
690  Cerr("***** oProjectorManager::ComputeProjectionLine() -> A problem occured while backward projecting an event !" << endl);
691  return NULL;
692  }
693  }
694 
695  // Return the line
696  return m2p_ProjectionLines[a_th];
697 }
698 
699 // =====================================================================
700 // ---------------------------------------------------------------------
701 // ---------------------------------------------------------------------
702 // =====================================================================
oProjectionLine ** m2p_ProjectionLines
#define VERBOSE_DEBUG_EVENT
bool GetTOFInfoFlag()
Definition: iDataFilePET.hh:84
#define TYPE_PET
Definition: vDataFile.hh:51
#define IMAGE_COMPUTATION_STRATEGY
#define MODE_LIST
Definition: vDataFile.hh:34
void SetThreadNumber(int a_threadNumber)
This function is used to set the thread number of this particular line.
#define FLTNB
Definition: gVariables.hh:55
int GetDataType()
Definition: vEvent.hh:106
void SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
This function is used to set the pointer to the oImageDimensionsAndQuantification in use...
void SetScanner(vScanner *ap_Scanner)
Set the pointer to the scanner in use.
Definition: vProjector.hh:263
void SetMatchedProjectors(bool a_UseMatchedProjectors)
This function is used to set the boolean that says if we use matched projectors.
int Initialize()
A function used to initialize the manager and the projectors or system matrices it manages...
uint32_t * GetEventID2()
Definition: vEvent.hh:100
bool GetPOIInfoFlag()
Definition: vDataFile.hh:339
This class is designed to generically described any on-the-fly projector.
Definition: vProjector.hh:54
bool GetCompatibilityWithSPECTAttenuationCorrection()
int Initialize()
A public function used to initialize the projector.
Definition: vProjector.cc:242
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:276
oProjectorManager()
The constructor of oProjectorManager.
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.
Definition: vProjector.cc:94
#define TYPE_TRANSMISSION
Definition: vDataFile.hh:55
#define ADAPTATIVE_LIST_COMPUTATION_STRATEGY
static sOutputManager * GetInstance()
Instanciate the singleton object and Initialize member variables if not already done, return a pointer to this object otherwise.
#define TYPE_SPECT
Definition: vDataFile.hh:53
Declaration of class iDataFilePET.
bool GetCompatibilityWithSPECTAttenuationCorrection()
Definition: vProjector.hh:293
int GetDataMode()
Definition: vEvent.hh:112
static sAddonManager * GetInstance()
int ReadCommonOptionsList(const string &a_optionsList)
This function is used to read options common to all projectors given as a string. ...
Definition: vProjector.cc:162
oSystemMatrix * mp_SystemMatrixBackward
void SetVerbose(int a_verbose)
Set the verbose level.
Definition: vProjector.hh:256
#define FIXED_LIST_COMPUTATION_STRATEGY
~oProjectorManager()
The destructor of oProjectorManager.
#define Cerr(MESSAGE)
bool GetIgnorePOIFlag()
Definition: vDataFile.hh:345
void SetComputationStrategy(int a_computationStrategy)
This function is used to set the computation strategy in use.
int ParseOptionsAndInitializeProjectors()
Parse forward and backward projection options contained in the previously provided strings...
FLTNB GetTOFResolution()
Definition: iDataFilePET.hh:96
const string & GetPathToConfigDir()
Return the path to the CASTOR config directory.
int GetNbBeds()
Get the number of bed positions.
int CheckParameters()
A public function used to check the parameters settings.
Definition: vProjector.cc:185
oSystemMatrix * mp_SystemMatrixForward
virtual int ReadOptionsList(const string &a_optionsList)=0
A function used to read options from a list of options.
void SetNbTOFBins(int a_nbTOFBins)
This function is used to set the number of TOF bins in use.
virtual int ReadConfigurationFile(const string &a_configurationFile)=0
A function used to read options from a configuration file.
void SetPOI2(FLTNB *ap_POI2)
This function is used to set the POI of point 2.
oProjectionLine * ComputeProjectionLine(vEvent *ap_Event, int a_th)
This function is used to compute system matrix elements from the associated projector or pre-computed...
FLTNB * GetPOIResolution()
Definition: vDataFile.hh:333
void Reset()
Reset length and all the voxel indices and weights tabs.
int GetDataType()
Definition: vDataFile.hh:286
int CheckParameters()
A function used to check the parameters settings.
void SetTOFBinSize(FLTNB a_TOFBinSize)
This function is used to set the size of a TOF bin in ps.
void ApplyBedOffset(int a_bed)
Compute the bed offset from the provided bed index and apply it to all projection lines...
void SetVerbose(int a_verbose)
This function is used to set the verbose level.
std::map< string, maker_projector > mp_listOfProjectors
oImageDimensionsAndQuantification * mp_ImageDimensionsAndQuantification
void SetBackwardProjector(vProjector *ap_Projector)
This function is used to set the pointer to the backward projector.
#define SYSTEM_MATRIX_KEYWORD
bool IsBackwardOperatorCompatibleWithSPECTAttenuationCorrection()
void SetPOI1(FLTNB *ap_POI1)
This function is used to set the POI of point 1.
FLTNB GetMultiBedDisplacementInMm()
Definition: vScanner.hh:231
This class is designed to manage and store system matrix elements associated to a vEvent...
vProjector * mp_ProjectorBackward
vProjector * mp_ProjectorForward
void SetPOIResolution(FLTNB *ap_POIResolution)
This function is used to set the POI resolution along the 3 axes.
uint16_t GetNbLines()
Definition: vEvent.hh:74
void SetForwardProjector(vProjector *ap_Projector)
This function is used to set the pointer to the forward projector.
Declaration of class sOutputManager.
Mother class for the Event objects.
Definition: vEvent.hh:23
bool GetIgnoreTOFFlag()
Definition: iDataFilePET.hh:90
FLTNB GetTOFBinSize()
int GetDataMode()
Definition: vDataFile.hh:280
void SetTOFResolution(FLTNB a_TOFResolution)
This function is used to set the TOF resolution in use.
int GetNbThreadsForProjection()
Get the number of threads used for projections.
int GetNbTOFBins()
void SetTOFMeasurement(FLTNB a_TOFMeasurement)
This function is used to set the TOF measurement associated to the line.
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
uint32_t * GetEventID1()
Definition: vEvent.hh:94
int Project(int a_direction, oProjectionLine *ap_ProjectionLine, uint32_t *ap_index1, uint32_t *ap_index2, int a_nbIndices)
#define FORWARD
#define Cout(MESSAGE)
int CheckSPECTAttenuationCompatibility(const string &a_pathToAttenuationImage)
A function used to check specific compatibility with SPECT and attenuation correction.
Declaration of class oProjectorManager.
int SetImageDimensionsAndQuantification(oImageDimensionsAndQuantification *ap_ImageDimensionsAndQuantification)
Set the pointer to the image dimensions in use and copy locally some often use variables.
Definition: vProjector.cc:65
Inherit from vDataFile. Class that manages the reading of a PET input file (header + data)...
Definition: iDataFilePET.hh:26
Declaration of class sAddonManager.
bool IsForwardOperatorCompatibleWithSPECTAttenuationCorrection()
#define BACKWARD