20 #ifndef MIRTK_DataFunctions_H 21 #define MIRTK_DataFunctions_H 24 #include "mirtk/DataStatistics.h" 25 #include "mirtk/Parallel.h" 28 namespace mirtk {
namespace data {
namespace op {
41 ResetMask(
bool value =
true) : _Value(value) {}
44 virtual void Process(
int n,
double *,
bool *mask =
nullptr)
46 if (mask !=
nullptr) {
47 memset(mask, _Value ? 1 : 0, n *
sizeof(
bool));
59 virtual void Process(
int n,
double *,
bool *mask =
nullptr)
61 if (mask !=
nullptr) {
62 for (
int i = 0; i < n; ++i) {
86 double *data = _Data + re.begin();
88 bool *mask = _Mask + re.begin();
89 for (
int i = re.begin(); i != re.end(); ++i, ++data, ++mask) {
90 if (*mask ==
true) *data = _Value;
93 for (
int i = re.begin(); i != re.end(); ++i, ++data) {
100 virtual void Process(
int n,
double *data,
bool *mask = NULL)
125 double *data = _Data + re.begin();
126 bool *mask = _Mask + re.begin();
127 for (
int i = re.begin(); i != re.end(); ++i, ++data, ++mask) {
128 if (*mask ==
false) *data = _Value;
133 virtual void Process(
int n,
double *data,
bool *mask = NULL)
157 double *data = _Data + re.begin();
159 bool *mask = _Mask + re.begin();
160 for (
int i = re.begin(); i != re.end(); ++i, ++data, ++mask) {
161 if (*mask) *data = this->
Op(*data, *mask);
165 for (
int i = re.begin(); i != re.end(); ++i, ++data) {
166 *data = this->
Op(*data, mask);
172 virtual double Op(
double value,
bool &)
const = 0;
175 virtual void Process(
int n,
double *data,
bool *mask = NULL)
189 mirtkPublicAttributeMacro(
double, Constant);
192 mirtkPublicAggregateMacro(
const double, ConstantPointer);
195 mirtkPublicAttributeMacro(
string,
FileName);
198 mirtkPublicAttributeMacro(
string, ArrayName);
201 mirtkPublicAttributeMacro(
bool, IsCellData);
207 SharedPtr<double> _Other;
214 _Constant(value), _ConstantPointer(nullptr), _Other(nullptr)
220 _Constant(NaN), _ConstantPointer(value), _Other(nullptr)
226 _Constant(NaN), _ConstantPointer(nullptr), _FileName(fname), _Other(nullptr)
232 _Constant(value), _ConstantPointer(nullptr), _FileName(fname), _Other(nullptr)
238 _Constant(NaN), _ConstantPointer(value), _FileName(fname), _Other(nullptr)
244 _Constant(NaN), _ConstantPointer(nullptr), _FileName(fname), _ArrayName(aname ? aname :
""), _IsCellData(cell_data), _Other(nullptr)
250 _Constant(value), _ConstantPointer(nullptr), _FileName(fname), _ArrayName(aname ? aname :
""), _IsCellData(cell_data), _Other(nullptr)
256 _Constant(NaN), _ConstantPointer(value), _FileName(fname), _ArrayName(aname ? aname :
""), _IsCellData(cell_data), _Other(nullptr)
264 double *data = _Data + re.begin();
266 double *other = _Other.get() + re.begin();
268 bool *mask = _Mask + re.begin();
269 for (
int i = re.begin(); i != re.end(); ++i) {
270 if (*mask) *data = this->
Op(*data, *other, *mask);
271 ++data, ++other, ++mask;
275 for (
int i = re.begin(); i != re.end(); ++i) {
277 *data = this->
Op(*data, *other, mask);
282 double c = (_ConstantPointer ? *_ConstantPointer : _Constant);
284 bool *mask = _Mask + re.begin();
285 for (
int i = re.begin(); i != re.end(); ++i) {
286 if (*mask) *data = this->
Op(*data, c, *mask);
291 for (
int i = re.begin(); i != re.end(); ++i) {
293 *data = this->
Op(*data, c, mask);
301 virtual double Op(
double value,
double,
bool &)
const = 0;
311 if (!_FileName.empty()) {
312 UniquePtr<double[]> other;
313 if (n !=
Read(_FileName.c_str(), other,
nullptr,
nullptr,
nullptr, _ArrayName.c_str(), _IsCellData)) {
314 cerr <<
"Input file " << _FileName <<
" has different number of data points!" << endl;
317 _Other = SharedPtr<double>(other.release(), std::default_delete<double[]>());
335 virtual double Op(
double value,
bool &)
const 341 virtual void Process(
int n,
double *data,
bool *mask = NULL)
352 mirtkPublicAttributeMacro(
double, Exponent);
356 Pow(
double exponent) : _Exponent(exponent) {}
359 virtual double Op(
double value,
bool &)
const 361 return pow(value, _Exponent);
365 virtual void Process(
int n,
double *data,
bool *mask = NULL)
379 virtual double Op(
double value,
bool &)
const 385 virtual void Process(
int n,
double *data,
bool *mask = NULL)
396 mirtkPublicAttributeMacro(
double, Base);
397 mirtkPublicAttributeMacro(
double, Threshold);
401 Log(
double base,
double threshold = .01) : _Base(base), _Threshold(threshold) {}
404 virtual double Op(
double value,
bool &)
const 406 if (value < _Threshold) value = _Threshold;
407 return log(value) / log(_Base);
411 virtual void Process(
int n,
double *data,
bool *mask = NULL)
422 mirtkPublicAttributeMacro(
double, Threshold);
426 Lb(
double threshold = .01) : _Threshold(threshold) {}
429 virtual double Op(
double value,
bool &)
const 431 if (value < _Threshold) value = _Threshold;
436 virtual void Process(
int n,
double *data,
bool *mask = NULL)
447 mirtkPublicAttributeMacro(
double, Threshold);
451 Ln(
double threshold = .01) : _Threshold(threshold) {}
454 virtual double Op(
double value,
bool &)
const 456 if (value < _Threshold) value = _Threshold;
461 virtual void Process(
int n,
double *data,
bool *mask = NULL)
472 mirtkPublicAttributeMacro(
double, Threshold);
476 Lg(
double threshold = .01) : _Threshold(threshold) {}
479 virtual double Op(
double value,
bool &)
const 481 if (value < _Threshold) value = _Threshold;
486 virtual void Process(
int n,
double *data,
bool *mask = NULL)
509 virtual double Op(
double value,
double constant,
bool &)
const 511 return value + constant;
515 virtual void Process(
int n,
double *data,
bool *mask = NULL)
517 Initialize(n, data, mask);
539 virtual double Op(
double value,
double constant,
bool &)
const 541 return value - constant;
545 virtual void Process(
int n,
double *data,
bool *mask = NULL)
547 Initialize(n, data, mask);
569 virtual double Op(
double value,
double constant,
bool &)
const 571 return value * constant;
575 virtual void Process(
int n,
double *data,
bool *mask = NULL)
577 Initialize(n, data, mask);
599 virtual double Op(
double value,
double constant,
bool &)
const 601 return (constant != .0 ? value / constant : numeric_limits<double>::quiet_NaN());
605 virtual void Process(
int n,
double *data,
bool *mask = NULL)
607 Initialize(n, data, mask);
629 virtual double Op(
double value,
double constant,
bool &)
const 631 return (constant != .0 ? value / constant : .0);
635 virtual void Process(
int n,
double *data,
bool *mask = NULL)
637 Initialize(n, data, mask);
647 typedef UnorderedMap<double, double> ValueMapType;
650 mirtkAttributeMacro(ValueMapType, ValueMap);
661 virtual double Op(
double value,
bool &)
const 663 auto it = _ValueMap.find(value);
664 if (it != _ValueMap.end()) {
672 virtual void Process(
int n,
double *data,
bool *mask = NULL)
698 virtual double Op(
double value,
double constant,
bool &mask)
const 700 const double v = (_FileName.empty() ? value : _Constant);
708 virtual void Process(
int n,
double *data,
bool *mask = NULL)
710 Initialize(n, data, mask);
729 mirtkPublicAggregateMacro(
const double, LowerThresholdPointer);
740 mirtkPublicAggregateMacro(
const double, UpperThresholdPointer);
747 _LowerThreshold(l), _LowerThresholdPointer(nullptr),
748 _UpperThreshold(u), _UpperThresholdPointer(nullptr)
754 _LowerThreshold(.0), _LowerThresholdPointer(l),
755 _UpperThreshold(.0), _UpperThresholdPointer(u)
761 _LowerThreshold(l ), _LowerThresholdPointer(nullptr),
762 _UpperThreshold(.0), _UpperThresholdPointer(u)
768 _LowerThreshold(.0), _LowerThresholdPointer(l),
769 _UpperThreshold(u ), _UpperThresholdPointer(nullptr)
773 virtual double Op(
double value,
bool &mask)
const 775 if (_LowerThreshold > _UpperThreshold) {
776 if (_UpperThreshold < value && value < _LowerThreshold) mask =
false;
778 if (value < _LowerThreshold || value > _UpperThreshold) mask =
false;
784 virtual void Process(
int n,
double *data,
bool *mask = NULL)
786 if (_LowerThresholdPointer) _LowerThreshold = *_LowerThresholdPointer;
787 if (_UpperThresholdPointer) _UpperThreshold = *_UpperThresholdPointer;
806 mirtkPublicAggregateMacro(
const double, LowerThresholdPointer);
817 mirtkPublicAggregateMacro(
const double, UpperThresholdPointer);
824 _LowerThreshold(l), _LowerThresholdPointer(nullptr),
825 _UpperThreshold(u), _UpperThresholdPointer(nullptr)
831 _LowerThreshold(.0), _LowerThresholdPointer(l),
832 _UpperThreshold(.0), _UpperThresholdPointer(u)
838 _LowerThreshold(l ), _LowerThresholdPointer(nullptr),
839 _UpperThreshold(.0), _UpperThresholdPointer(u)
845 _LowerThreshold(.0), _LowerThresholdPointer(l),
846 _UpperThreshold(u ), _UpperThresholdPointer(nullptr)
850 virtual double Op(
double value,
bool &mask)
const 852 if (_LowerThreshold > _UpperThreshold) {
853 if (_UpperThreshold <= value && value <= _LowerThreshold) mask =
false;
855 if (value <= _LowerThreshold || value >= _UpperThreshold) mask =
false;
861 virtual void Process(
int n,
double *data,
bool *mask = NULL)
863 if (_LowerThresholdPointer) _LowerThreshold = *_LowerThresholdPointer;
864 if (_UpperThresholdPointer) _UpperThreshold = *_UpperThresholdPointer;
883 mirtkPublicAggregateMacro(
const double, LowerThresholdPointer);
894 mirtkPublicAggregateMacro(
const double, UpperThresholdPointer);
901 _LowerThreshold(l), _LowerThresholdPointer(nullptr),
902 _UpperThreshold(u), _UpperThresholdPointer(nullptr)
908 _LowerThreshold(.0), _LowerThresholdPointer(l),
909 _UpperThreshold(.0), _UpperThresholdPointer(u)
915 _LowerThreshold(l ), _LowerThresholdPointer(nullptr),
916 _UpperThreshold(.0), _UpperThresholdPointer(u)
922 _LowerThreshold(.0), _LowerThresholdPointer(l),
923 _UpperThreshold(u ), _UpperThresholdPointer(nullptr)
927 virtual double Op(
double value,
bool &mask)
const 929 if (_LowerThreshold > _UpperThreshold) {
930 if (value <= _UpperThreshold || value >= _LowerThreshold) mask =
false;
932 if (_LowerThreshold <= value && value <= _UpperThreshold) mask =
false;
938 virtual void Process(
int n,
double *data,
bool *mask = NULL)
940 if (_LowerThresholdPointer) _LowerThreshold = *_LowerThresholdPointer;
941 if (_UpperThresholdPointer) _UpperThreshold = *_UpperThresholdPointer;
960 mirtkPublicAggregateMacro(
const double, LowerThresholdPointer);
971 mirtkPublicAggregateMacro(
const double, UpperThresholdPointer);
978 _LowerThreshold(l), _LowerThresholdPointer(nullptr),
979 _UpperThreshold(u), _UpperThresholdPointer(nullptr)
985 _LowerThreshold(.0), _LowerThresholdPointer(l),
986 _UpperThreshold(.0), _UpperThresholdPointer(u)
992 _LowerThreshold(l ), _LowerThresholdPointer(nullptr),
993 _UpperThreshold(.0), _UpperThresholdPointer(u)
999 _LowerThreshold(.0), _LowerThresholdPointer(l),
1000 _UpperThreshold(u ), _UpperThresholdPointer(nullptr)
1004 virtual double Op(
double value,
bool &mask)
const 1006 if (_LowerThreshold > _UpperThreshold) {
1007 if (value < _UpperThreshold || value > _LowerThreshold) mask =
false;
1009 if (_LowerThreshold < value && value < _UpperThreshold) mask =
false;
1015 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1017 if (_LowerThresholdPointer) _LowerThreshold = *_LowerThresholdPointer;
1018 if (_UpperThresholdPointer) _UpperThreshold = *_UpperThresholdPointer;
1031 virtual double Op(
double value,
bool &mask)
const 1033 if (static_cast<int>(value) % 2 == 0) mask =
false;
1038 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1052 virtual double Op(
double value,
bool &mask)
const 1054 if (static_cast<int>(value) % 2 == 1) mask =
false;
1059 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1071 mirtkPublicAttributeMacro(
double, Threshold);
1079 mirtkPublicAggregateMacro(
const double, ThresholdPointer);
1086 _Threshold(value), _ThresholdPointer(nullptr)
1092 _Threshold(.0), _ThresholdPointer(value)
1096 virtual double Op(
double value,
bool &)
const 1098 if (value <= _Threshold) value = _Threshold;
1103 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1105 if (_ThresholdPointer) _Threshold = *_ThresholdPointer;
1116 mirtkPublicAttributeMacro(
double, Threshold);
1124 mirtkPublicAggregateMacro(
const double, ThresholdPointer);
1131 _Threshold(value), _ThresholdPointer(nullptr)
1137 _Threshold(.0), _ThresholdPointer(value)
1141 virtual double Op(
double value,
bool &)
const 1143 if (value >= _Threshold) value = _Threshold;
1148 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1150 if (_ThresholdPointer) _Threshold = *_ThresholdPointer;
1169 mirtkPublicAggregateMacro(
const double, LowerThresholdPointer);
1180 mirtkPublicAggregateMacro(
const double, UpperThresholdPointer);
1187 _LowerThreshold(l), _LowerThresholdPointer(nullptr),
1188 _UpperThreshold(u), _UpperThresholdPointer(nullptr)
1194 _LowerThreshold(.0), _LowerThresholdPointer(l),
1195 _UpperThreshold(.0), _UpperThresholdPointer(u)
1201 _LowerThreshold(l ), _LowerThresholdPointer(nullptr),
1202 _UpperThreshold(.0), _UpperThresholdPointer(u)
1208 _LowerThreshold(.0), _LowerThresholdPointer(l),
1209 _UpperThreshold(u ), _UpperThresholdPointer(nullptr)
1213 virtual double Op(
double value,
bool &)
const 1215 if (value <= _LowerThreshold) value = _LowerThreshold;
1216 else if (value >= _UpperThreshold) value = _UpperThreshold;
1221 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1223 if (_LowerThresholdPointer) _LowerThreshold = *_LowerThresholdPointer;
1224 if (_UpperThresholdPointer) _UpperThreshold = *_UpperThresholdPointer;
1243 Binarize(
double l,
double u = numeric_limits<double>::infinity())
1245 _LowerThreshold(l), _UpperThreshold(u)
1249 virtual double Op(
double value,
bool &)
const 1251 if (_LowerThreshold > _UpperThreshold) {
1252 if (_UpperThreshold <= value && value <= _LowerThreshold) {
1258 if (_LowerThreshold <= value && value <= _UpperThreshold) {
1267 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1289 Rescale(
double min = .0,
double max = 1.0) : _Min(min), _Max(max) {}
1294 double *data = _Data + re.begin();
1295 for (
int i = re.begin(); i != re.end(); ++i, ++data) {
1296 *data = (*data * _Slope) + _Intercept;
1301 virtual void Process(
int n,
double *data,
bool *mask = NULL)
1304 extrema.
Process(n, data, mask);
1305 _Slope = (_Max - _Min) / (extrema.Max() - extrema.Min());
1306 _Intercept = _Min - (extrema.Min() * _Slope);
1316 #endif // MIRTK_DataFunctions_H int Read(const char *name, UniquePtr< double[]> &data, int *dtype=nullptr, ImageAttributes *attr=nullptr, void *=nullptr, const char *scalars_name=nullptr, bool cell_data=false)
Read data sequence from any supported input file type.
Get minimum and maximum values.
void Finalize()
Finalize processing and release temporary memory.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
LowerThreshold(const double *value)
Constructor.
virtual double Op(double value, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
virtual double Op(double value, double constant, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
Set value of masked data points.
Clamp values below or equal a given threshold value.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Mul(const char *fname)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
Compute element-wise power.
Mask(double value)
Constructor.
virtual double Op(double value, double constant, bool &) const
Transform data value and/or mask data value by setting *mask = false.
Element-wise subtraction.
MaskOutsideOpenInterval(const double *l, const double *u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Map values (e.g. segmentation labels)
MaskOutsideInterval(const double *l, double u)
Constructor.
string FileName(const char *, ExtensionMode=EXT_Default)
Get file name of file path excl. file extension.
Base class of all data operations.
MaskInsideOpenInterval(double l, const double *u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
MaskOutsideOpenInterval(double l, const double *u)
Constructor.
Set value of unmasked data points.
Defines base class and I/O functions for arbitrary 1D data sequences.
Mask odd values (e.g., segmentation labels of left hemisphere; cf MAL 2012)
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Mul(const double *value)
Constructor.
MaskInsideInterval(const double *l, const double *u)
Constructor.
Mask values below, equal, or above a specified lower/upper threshold.
ElementWiseBinaryOp(const char *fname)
Constructor.
Clamp(const double *l, double u)
Constructor.
virtual double Op(double value, double constant, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
DivWithZero(const char *fname)
Constructor.
MIRTKCU_API bool IsNaN(double x)
Check if floating point value is not a number (NaN)
void Initialize(int n, double *data, bool *mask=nullptr)
Initialize processing and read data from file.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
MaskOutsideOpenInterval(double l, double u)
Constructor.
ElementWiseBinaryOp(const char *fname, const char *aname, bool cell_data=false)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Sub(const double *value)
Constructor.
Compute element-wise logarithm to base 10.
UpperThreshold(double value)
Constructor.
MaskInsideOpenInterval(const double *l, const double *u)
Constructor.
Compute element-wise exponential map.
Mul(double value)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
MaskInsideOpenInterval(double l, double u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
ElementWiseBinaryOp(double value)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
ElementWiseBinaryOp(const char *fname, double value)
Constructor.
virtual double Op(double value, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
Compute element-wise absolute value.
MaskOutsideInterval(const double *l, const double *u)
Constructor.
MIRTKCU_API bool fequal(double a, double b, double tol=1e-12)
UpperThreshold(const double *value)
Constructor.
Div(double value)
Constructor.
Mask values below or above a specified lower/upper threshold.
Add(double value)
Constructor.
MaskOutsideOpenInterval(const double *l, double u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual void Process(int n, double *data, bool *mask=nullptr)
Process given data.
Compute element-wise natural logarithm.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
ElementWiseBinaryOp(const double *value)
Constructor.
Set values to either one or zero.
DivWithZero(const double *value)
Constructor.
Clamp(double l, double u)
Constructor.
Mask(const char *fname)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
Mask even values (e.g., segmentation labels of right hemisphere; cf MAL 2012)
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual void Process(int n, double *, bool *mask=nullptr)
Process given data (not thread-safe!)
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual double Op(double value, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Clamp values below or equal a given threshold value.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual double Op(double value, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual double Op(double value, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
Sub(const char *fname)
Constructor.
virtual double Op(double value, bool &mask) const
Transform data value and/or mask data value by setting *mask = false.
MaskOutsideInterval(double l, double u)
Constructor.
Mask(const char *fname, double value)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual double Op(double value, double constant, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
MaskInsideInterval(double l, const double *u)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask it by setting mask = false.
Div(const char *fname)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
Sub(double value)
Constructor.
Binarize(double l, double u=numeric_limits< double >::infinity())
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Compute element-wise logarithmic map.
ElementWiseBinaryOp(const char *fname, const double *value)
Constructor.
ElementWiseBinaryOp(const char *fname, const char *aname, const double *value, bool cell_data=false)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Add(const char *fname)
Constructor.
ElementWiseBinaryOp(const char *fname, const char *aname, double value, bool cell_data=false)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
MaskOutsideInterval(double l, const double *u)
Constructor.
Compute element-wise binary logarithm.
virtual double Op(double value, double constant, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Add(const double *value)
Constructor.
MaskInsideOpenInterval(const double *l, double u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
DivWithZero(double value)
Constructor.
virtual double Op(double value, bool &) const
Transform data value and/or mask data value by setting *mask = false.
void Insert(double a, double b)
Insert map from a to b.
MaskInsideInterval(double l, double u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)
Clamp values below or equal a given threshold value.
Mask values inside open interval.
virtual void Process(int n, double *, bool *mask=nullptr)
Process given data (not thread-safe!)
Mask values inside closed interval.
MaskInsideInterval(const double *l, double u)
Constructor.
Mask(const double *value)
Constructor.
virtual double Op(double value, double constant, bool &) const
Transform data value and/or mask data value by setting *mask = false.
LowerThreshold(double value)
Constructor.
Base class of element-wise data transformations.
Element-wise multiplication.
Base class of element-wise data transformations.
Div(const double *value)
Constructor.
void parallel_for(const Range &range, const Body &body)
parallel_for dummy template function which executes the body serially
Clamp(double l, const double *u)
Constructor.
Rescale values to new range.
Clamp(const double *l, const double *u)
Constructor.
virtual void Process(int n, double *data, bool *mask=NULL)
Process given data (not thread-safe!)