STIR  6.2.0
HUToMuImageProcessor.h
Go to the documentation of this file.
1 
10 /*
11  Copyright (C) 2020, UCL
12  See STIR/LICENSE.txt for details
13 */
14 
15 #ifndef __stir_HUToMuImageProcessor_H__
16 #define __stir_HUToMuImageProcessor_H__
17 
19 #include "stir/DataProcessor.h"
21 
22 START_NAMESPACE_STIR
23 
79 template <typename TargetT>
81  : public RegisteredParsingObject<HUToMuImageProcessor<TargetT>, DataProcessor<TargetT>, DataProcessor<TargetT>>
82 {
83 private:
85 
86 public:
87  static const char* const registered_name;
88 
91 
93  void set_slope_filename(const std::string& filename);
95  void set_manufacturer_name(const std::string& name);
97  void set_kilovoltage_peak(const float kVp);
99  void set_target_photon_energy(const float gamma_energy);
100 
102  void apply_scaling_to_HU(TargetT& output_image, const TargetT& input_image) const;
103 
105  void set_slope(float a1, float a2, float b1, float b2, float breakPoint);
106 
107 protected:
108  // parsing functions
110 
112  void set_defaults() override;
113  void initialise_keymap() override;
114  bool post_processing() override;
115 
117 
118  Succeeded virtual_set_up(const TargetT& image) override;
119 
120  void virtual_apply(TargetT& out_density, const TargetT& in_density) const override;
121  void virtual_apply(TargetT& density) const override;
122 
123 private:
124  std::string filename;
125  std::string manufacturer_name;
126  float kilovoltage_peak;
127  float target_photon_energy;
128 
129  // parameters for piecewise linear curve
130  float a1;
131  float b1;
132 
133  float a2;
134  float b2;
135  float breakPoint;
136 
137 #ifdef HAVE_JSON
138  void get_record_from_json();
139 #endif
140 };
141 
142 END_NAMESPACE_STIR
143 
144 #endif
Declaration of class stir::DataProcessor.
defines the stir::DiscretisedDensity class
A class in the DataProcessor hierarchy that convert from Hounsfield Units to mu-values.
Definition: HUToMuImageProcessor.h:80
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
Declaration of class stir::RegisteredParsingObject.