37 #include <drain/Type.h>
38 #include <drain/image/AccumulationConverter.h>
40 #include "data/ODIM.h"
42 #include "DataSelector.h"
43 #include "QuantityMap.h"
66 dataODIM(defaultDataODIM), qualityODIM(defaultQualityODIM) {
72 dataODIM(dataODIM), qualityODIM(defaultQualityODIM) {
79 dataODIM(dataODIM), qualityODIM(qualityODIM) {
83 DataCoder(
const DataCoder & converter) : BeanLike(__FUNCTION__), defaultQuality(converter.defaultQuality),
84 dataODIM(defaultDataODIM), qualityODIM(defaultQualityODIM) {
85 defaultDataODIM = converter.dataODIM;
86 defaultQualityODIM = converter.qualityODIM;
94 double getNoReadingMarker()
const override {
95 return dataODIM.undetect;
99 bool decode(
double & value)
const override;
103 bool decode(
double & value,
double & weight)
const override;
110 void encode(
double & value,
double & weight)
const override;
113 void encodeWeight(
double & weight)
const override;
116 void encodeDiff(
double & diff)
const override;
158 const ODIM & dataODIM;
159 const ODIM & qualityODIM;
161 ODIM defaultDataODIM;
162 ODIM defaultQualityODIM;
192 std::ostream & operator<<(std::ostream & ostr,
const DataCoder & coder) {
193 ostr << coder.
getName() <<
':' << coder.getParameters() <<
'\n';
195 ostr <<
"\t data: " <<
EncodingODIM(coder.dataODIM) <<
'\n';
196 ostr <<
"\t q: " <<
EncodingODIM(coder.qualityODIM) <<
'\n';
Something which has a name, a description and possibly some parameters of varying type.
Definition: BeanLike.h:60
virtual const std::string & getName() const
Return the name of an instance.
Definition: BeanLike.h:69
Converts ODIM encoded data (with markers) to natural values and backwards.
Definition: DataCoder.h:61
static double undetectQualityCoeff
Quality, relative to data quality, applied in locations marked with undetect .
Definition: DataCoder.h:156
DataCoder(const ODIM &dataODIM)
Without quality (with impicit quality)
Definition: DataCoder.h:71
double undetectValue
Physical value applied in locations marked with undetect . This should be compatible with the quantit...
Definition: DataCoder.h:151
double minCodeValue
In extraction (encoding), values lower than this value will be marked undetect .
Definition: DataCoder.h:179
double detectionThreshold
A physical value greater than undetectValue. In \i encoding, lower values will be marked undetect ....
Definition: DataCoder.h:186
double defaultQuality
If source data has no quality field, this value is applied for (detected) data.
Definition: DataCoder.h:143
Structure for data storage type, scaling and marker codes. Does not contain quantity.
Definition: EncodingODIM.h:75
ODIM metadata (quantity, gain, offset, undetect, nodata, date, time)
Definition: ODIM.h:79
Definition: QuantityMap.h:50
bool setQuantityDefaults(EncodingODIM &dst, const std::string &quantity, const std::string &values="") const
Sets default values of given quantity - but not the quantity itself. Optionally overrides with user v...
Definition: QuantityMap.cpp:398
Namespace for images and image processing tools.
Definition: AccumulationArray.cpp:45
Definition: DataSelector.cpp:44
Converts raw data to values appropriate for accumulation.
Definition: AccumulationConverter.h:50