STIR  6.3.0
BinNormalisationFromGEHDF5.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000-2007, Hammersmith Imanet Ltd
3  Copyright (C) 2013-2014, 2020 University College London
4  Copyright (C) 2017-2019 University of Leeds
5 
6  Largely a copy of the ECAT7 version.
7 
8  SPDX-License-Identifier: Apache-2.0
9 
10  See STIR/LICENSE.txt for details
11 */
22 #ifndef __stir_recon_buildblock_BinNormalisationFromGEHDF5_H__
23 #define __stir_recon_buildblock_BinNormalisationFromGEHDF5_H__
24 
28 #include "stir/ProjData.h"
29 #include "stir/shared_ptr.h"
31 #include "stir/data/SinglesRates.h"
32 #include "stir/Scanner.h"
33 #include "stir/Array.h"
34 #include <string>
35 
36 using std::string;
37 
38 START_NAMESPACE_STIR
39 
40 class ProjDataInMemory;
41 
42 namespace GE
43 {
44 namespace RDF_HDF5
45 {
46 
47 class GEHDF5Wrapper;
48 
75  : public RegisteredParsingObject<BinNormalisationFromGEHDF5, BinNormalisation, BinNormalisationWithCalibration>
76 {
77 private:
79 
80 public:
82  static const char* const registered_name;
83 
85 
91 
93  BinNormalisationFromGEHDF5(const string& filename);
94 
95  Succeeded set_up(const shared_ptr<const ExamInfo>& exam_info_sptr, const shared_ptr<const ProjDataInfo>&) override;
96  float get_uncalibrated_bin_efficiency(const Bin& bin) const override;
97 
98  bool use_detector_efficiencies() const;
99  bool use_dead_time() const;
100  bool use_geometric_factors() const;
101  bool use_crystal_interference_factors() const;
102 
103 private:
104  Array<1, float> axial_t1_array;
105  Array<1, float> axial_t2_array;
106  Array<1, float> trans_t1_array;
107  shared_ptr<SinglesRates> singles_rates_ptr;
108  Array<2, float> efficiency_factors;
109  shared_ptr<ProjDataInMemory> geo_eff_factors_sptr;
110  shared_ptr<Scanner> scanner_ptr;
111  int num_transaxial_crystals_per_block;
112  // TODO move to Scanner
113  int num_axial_blocks_per_singles_unit;
114  shared_ptr<const ProjDataInfo> proj_data_info_ptr;
115  ProjDataInfoCylindricalNoArcCorr const* proj_data_info_cyl_ptr;
116  shared_ptr<const ProjDataInfoCylindricalNoArcCorr> proj_data_info_cyl_uncompressed_ptr;
117  int span;
118  int mash;
119  int num_blocks_per_singles_unit;
120 
121  bool _use_detector_efficiencies;
122  bool _use_dead_time;
123  bool _use_geometric_factors;
124 
125  void read_norm_data(const string& filename);
126  float get_dead_time_efficiency(const DetectionPositionPair<>& detection_position_pair,
127  const double start_time,
128  const double end_time) const;
129 
130  float get_geometric_efficiency_factors(const DetectionPositionPair<>& detection_position_pair) const;
131  float get_efficiency_factors(const DetectionPositionPair<>& detection_position_pair) const;
132  // parsing stuff
133  void set_defaults() override;
134  void initialise_keymap() override;
135  bool post_processing() override;
136 
137  string normalisation_GEHDF5_filename;
138  shared_ptr<GEHDF5Wrapper> m_input_hdf5_sptr;
139 };
140 
141 } // namespace RDF_HDF5
142 } // namespace GE
143 END_NAMESPACE_STIR
144 
145 #endif
Declaration of class stir::SinglesRates.
static const char *const registered_name
Name which will be used when parsing a BinNormalisation object.
Definition: BinNormalisationFromGEHDF5.h:82
Declaration of class stir::ProjDataInfoCylindricalNoArcCorr.
Definition: BinNormalisationWithCalibration.h:42
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...
Declaration of class stir::ProjData.
defines the stir::Array class for multi-dimensional (numeric) arrays
Declaration of class stir::BinNormalisation.
Declaration of class stir::Scanner.
A BinNormalisation class that gets the normalisation factors from an GEHDF5 3D normalisation file...
Definition: BinNormalisationFromGEHDF5.h:74
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Projection data info for data which are not arc-corrected.
Definition: ProjDataInfoCylindricalNoArcCorr.h:82
Declaration of class stir::RegisteredParsingObject.
A class for storing 2 coordinates-sets of a detection, together with a timing-position index (for TOF...
Definition: DetectionPositionPair.h:40
Declaration of class stir::BinNormalisationWithCalibration.