STIR 6.4.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
22START_NAMESPACE_STIR
23
79template <typename TargetT>
81 : public RegisteredParsingObject<HUToMuImageProcessor<TargetT>, DataProcessor<TargetT>, DataProcessor<TargetT>>
82{
83private:
85
86public:
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
107protected:
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
123private:
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
142END_NAMESPACE_STIR
143
144#endif
Declaration of class stir::DataProcessor.
defines the stir::DiscretisedDensity class
Declaration of class stir::RegisteredParsingObject.
Base class that defines an interface for classes that do data processing.
Definition DataProcessor.h:47
void apply_scaling_to_HU(TargetT &output_image, const TargetT &input_image) const
same as apply
Definition HUToMuImageProcessor.cxx:193
bool post_processing() override
This will be called at the end of the parsing.
Definition HUToMuImageProcessor.cxx:93
Succeeded virtual_set_up(const TargetT &image) override
just checks if all variables are set
Definition HUToMuImageProcessor.cxx:100
void initialise_keymap() override
Initialise all keywords.
Definition HUToMuImageProcessor.cxx:77
void set_target_photon_energy(const float gamma_energy)
set the gamma photon energy (in keV) used to select from the JSON entries
Definition HUToMuImageProcessor.cxx:60
void set_manufacturer_name(const std::string &name)
set the manufacturer name used to select from the JSON entries
Definition HUToMuImageProcessor.cxx:46
HUToMuImageProcessor()
Default constructor.
Definition HUToMuImageProcessor.cxx:32
void virtual_apply(TargetT &out_density, const TargetT &in_density) const override
Performs actual operation (virtual_set_up is called before this function)
Definition HUToMuImageProcessor.cxx:217
void set_slope(float a1, float a2, float b1, float b2, float breakPoint)
set the slope without JSON file
Definition HUToMuImageProcessor.cxx:182
void set_slope_filename(const std::string &filename)
set the JSON filename with the slopes
Definition HUToMuImageProcessor.cxx:39
void set_defaults() override
sets default values
Definition HUToMuImageProcessor.cxx:67
void set_kilovoltage_peak(const float kVp)
set the CT kVp used to select from the JSON entries
Definition HUToMuImageProcessor.cxx:53
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44