STIR  6.2.0
BinNormalisationSPECT.h
Go to the documentation of this file.
1 //
2 //
12 /*
13  Copyright (C) 2019-2021, UCL
14  Copyright (C) 2019-2021, NPL
15  See STIR/LICENSE.txt for details
16 */
17 
18 #ifndef __stir_recon_buildblock_BinNormalisationSPECT_H__
19 #define __stir_recon_buildblock_BinNormalisationSPECT_H__
20 
24 #include "stir/RelatedViewgrams.h"
26 #include "stir/Succeeded.h"
27 
28 #include <string>
29 
30 START_NAMESPACE_STIR
31 
32 class BinNormalisationSPECT
33  : public RegisteredParsingObject<BinNormalisationSPECT, BinNormalisation, BinNormalisationWithCalibration>
34 {
35 private:
36  using base_type = BinNormalisationWithCalibration;
37 
38 public:
40  static const char* const registered_name;
41 
42  BinNormalisationSPECT();
43 
44  BinNormalisationSPECT(const std::string& filename);
45 
46  void read_norm_data(const std::string& filename);
47  Succeeded set_up(const shared_ptr<const ExamInfo>& exam_info_sptr, const shared_ptr<const ProjDataInfo>&) override;
48  void set_num_views(int num_views) const { this->num_views = num_views; }
49 
50  void set_uniformity(Array<3, float>& uniformity) { this->down_sampled_uniformity = uniformity; }
51 
52  bool use_dead_time() const;
53  bool use_detector_efficiencies() const;
54  double get_half_life() const;
55  bool use_uniformity_factors() const;
56  bool use_decay_correction_factors() const;
57  bool use_COR_factors() const;
58 
59  float get_dead_time_efficiency(const DetectionPosition<>& det_pos, const double start_time, const double end_time) const;
60 
61  // import all apply/undo methods from base-class (we'll override some below)
62  using base_type::apply;
63  using base_type::undo;
64 
65  void apply(RelatedViewgrams<float>& viewgrams) const override;
66 
67  void undo(RelatedViewgrams<float>& viewgrams) const override;
68 
69  float get_uncalibrated_bin_efficiency(const Bin& bin) const override;
70 
71  void read_linearity_table(Array<3, float>& linearity) const;
72  void read_uniformity_table(Array<3, float>& uniformity) const;
73  void read_cor_table(Array<3, float>& cor) const;
74 
75  void resample_uniformity( // Array<3,float>& down_sampled_uniformity,
76  Array<3, float> uniformity,
77  const int max_ax,
78  int zoom) const;
79 
80 protected:
81  // parsing stuff
82  void set_defaults() override;
83  void initialise_keymap() override;
84  bool post_processing() override;
85 
86  int max_tang;
87  shared_ptr<ProjData> norm_proj_data_info_ptr;
88  mutable Array<1, float> normalisation_spect;
89  Array<3, float> uniformity;
90  Array<3, float> cor;
91  mutable float map[1048576];
92  mutable Array<3, float> down_sampled_uniformity;
93  mutable RelatedViewgrams<float> NCOR_viewgrams;
94  std::string uniformity_filename, folder_prefix, projdata_filename;
95  float bin_efficiency;
96  float measured_calibration_factor;
97 
98  bool _use_detector_efficiencies;
99  bool _use_decay_correction;
100  bool _use_uniformity_factors;
101  bool _use_dead_time;
102  bool _use_cor_factors;
103  double half_life, view_time_interval;
104  int num_detector_heads;
105  mutable int num_views;
106  mutable bool resampled;
107 };
108 
109 END_NAMESPACE_STIR
110 
111 #endif
Declaration of class stir::Succeeded.
Simple functions to compute the decay correction factor.
Declaration of class stir::BinNormalisation.
Declaration of class stir::RelatedViewgrams.
Declaration of class stir::RegisteredParsingObject.
Declaration of class stir::BinNormalisationWithCalibration.