STIR  6.2.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 "stir/IO/GEHDF5Wrapper.h"
35 #include <string>
36 
37 using std::string;
38 
39 START_NAMESPACE_STIR
40 
41 class ProjDataInMemory;
42 
43 namespace GE
44 {
45 namespace RDF_HDF5
46 {
47 
74  : public RegisteredParsingObject<BinNormalisationFromGEHDF5, BinNormalisation, BinNormalisationWithCalibration>
75 {
76 private:
78 
79 public:
81  static const char* const registered_name;
82 
84 
90 
92  BinNormalisationFromGEHDF5(const string& filename);
93 
94  Succeeded set_up(const shared_ptr<const ExamInfo>& exam_info_sptr, const shared_ptr<const ProjDataInfo>&) override;
95  float get_uncalibrated_bin_efficiency(const Bin& bin) const override;
96 
97  bool use_detector_efficiencies() const;
98  bool use_dead_time() const;
99  bool use_geometric_factors() const;
100  bool use_crystal_interference_factors() const;
101 
102 private:
103  Array<1, float> axial_t1_array;
104  Array<1, float> axial_t2_array;
105  Array<1, float> trans_t1_array;
106  shared_ptr<SinglesRates> singles_rates_ptr;
107  Array<2, float> efficiency_factors;
108  shared_ptr<ProjDataInMemory> geo_eff_factors_sptr;
109  shared_ptr<Scanner> scanner_ptr;
110  int num_transaxial_crystals_per_block;
111  // TODO move to Scanner
112  int num_axial_blocks_per_singles_unit;
113  shared_ptr<const ProjDataInfo> proj_data_info_ptr;
114  ProjDataInfoCylindricalNoArcCorr const* proj_data_info_cyl_ptr;
115  shared_ptr<const ProjDataInfoCylindricalNoArcCorr> proj_data_info_cyl_uncompressed_ptr;
116  int span;
117  int mash;
118  int num_blocks_per_singles_unit;
119 
120  bool _use_detector_efficiencies;
121  bool _use_dead_time;
122  bool _use_geometric_factors;
123 
124  void read_norm_data(const string& filename);
125  float get_dead_time_efficiency(const DetectionPositionPair<>& detection_position_pair,
126  const double start_time,
127  const double end_time) const;
128 
129  float get_geometric_efficiency_factors(const DetectionPositionPair<>& detection_position_pair) const;
130  float get_efficiency_factors(const DetectionPositionPair<>& detection_position_pair) const;
131  // parsing stuff
132  void set_defaults() override;
133  void initialise_keymap() override;
134  bool post_processing() override;
135 
136  string normalisation_GEHDF5_filename;
137  shared_ptr<GEHDF5Wrapper> m_input_hdf5_sptr;
138  GEHDF5Wrapper h5data;
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:81
Declaration of class stir::ProjDataInfoCylindricalNoArcCorr.
Definition: BinNormalisationWithCalibration.h:42
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
A class that extracts and reads the necessary data from GE HDF5 input files.
Definition: GEHDF5Wrapper.h:49
Declaration of class stir::ProjData.
defines the 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:73
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::GE::RDF_HDF5::GEHDF5Wrapper.
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.