20 #ifndef MIRTK_PeronaMalikErrorFunction_H 21 #define MIRTK_PeronaMalikErrorFunction_H 23 #include "mirtk/RadialErrorFunction.h" 24 #include "mirtk/Math.h" 38 mirtkPublicAttributeMacro(
double, SquaredThreshold);
45 _SquaredThreshold(threshold * threshold)
51 _SquaredThreshold(other._SquaredThreshold)
70 bool Set(
const char *name,
const char *value)
72 if (strcmp(name,
"Threshold") == 0) {
73 double threshold = .0;
74 if (!
FromString(value, threshold) || threshold <= .0)
return false;
75 _SquaredThreshold = threshold * threshold;
77 }
else if (strcmp(name,
"Squared threshold") == 0) {
78 return FromString(value, _SquaredThreshold) && _SquaredThreshold <= .0;
95 virtual double Value(
double d)
const 97 return _SquaredThreshold * log(1.0 + d / _SquaredThreshold);
103 return 1.0 / (1.0 + d / _SquaredThreshold);
111 #endif // MIRTK_PeronaMalikErrorFunction_H Perona-Malik fiducial registration error.
virtual TypeId Type() const
Type enumeration value.
ParameterList Parameter() const
Get parameter key/value as string map.
TypeId
Enumeration of available error functions.
PeronaMalikErrorFunction(double threshold=1.0)
Constructor.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
virtual RadialErrorFunction * NewInstance() const
Copy construct a new instance.
virtual double Derivative(double d) const
Evaluate derivative of radial registration error.
PeronaMalikErrorFunction(const PeronaMalikErrorFunction &other)
Copy constructor.
virtual double Value(double d) const
Evaluate radial registration error.
string ToString(const EnergyMeasure &value, int w, char c, bool left)
Convert energy measure enumeration value to string.
bool Set(const char *name, const char *value)
Set parameter value from string.
bool FromString(const char *str, EnergyMeasure &value)
Convert energy measure string to enumeration value.
virtual ParameterList Parameter() const
Get parameter name/value pairs.
ParameterList & Insert(ParameterList ¶ms, string name, T value)
Insert/replace value into/in parameters list.
~PeronaMalikErrorFunction()
Destructor.