20 #ifndef MIRTK_GaussianErrorFunction_H 21 #define MIRTK_GaussianErrorFunction_H 23 #include "mirtk/RadialErrorFunction.h" 37 mirtkPublicAttributeMacro(
double, Variance);
46 _Variance(sigma * sigma)
52 _Variance(other._Variance)
71 virtual bool Set(
const char *name,
const char *value)
73 if (strcmp(name,
"sigma") == 0 ||
74 strcmp(name,
"standard deviation") == 0) {
77 if (sigma == .0)
return false;
78 _Variance = sigma * sigma;
80 }
else if (strcmp(name,
"variance") == 0) {
81 return FromString(value, _Variance) && _Variance > .0;
98 virtual double Value(
double d)
const 100 return exp(-.5 * d / _Variance);
106 return exp(-.5 * d / _Variance) / _Variance;
114 #endif // MIRTK_GaussianErrorFunction_H virtual ParameterList Parameter() const
Get parameter key/value as string map.
GaussianErrorFunction(const GaussianErrorFunction &other)
Copy constructor.
TypeId
Enumeration of available error functions.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
~GaussianErrorFunction()
Destructor.
virtual double Value(double d) const
Evaluate radial registration error.
virtual bool Set(const char *name, const char *value)
Set parameter value from string.
string ToString(const EnergyMeasure &value, int w, char c, bool left)
Convert energy measure enumeration value to string.
bool FromString(const char *str, EnergyMeasure &value)
Convert energy measure string to enumeration value.
virtual TypeId Type() const
Type enumeration value.
GaussianErrorFunction(double sigma=1.0)
virtual ParameterList Parameter() const
Get parameter name/value pairs.
virtual RadialErrorFunction * NewInstance() const
Copy construct a new instance.
ParameterList & Insert(ParameterList ¶ms, string name, T value)
Insert/replace value into/in parameters list.
virtual double Derivative(double d) const
Evaluate derivative of radial registration error.