18 #ifndef itkCompositeValleyFunction_h
19 #define itkCompositeValleyFunction_h
22 #include "ITKBiasCorrectionExport.h"
79 TargetClass(
double mean,
double sigma)
100 SetSigma(
double sigma)
116 class ITKBiasCorrection_EXPORT CompositeValleyFunction :
public CacheableScalarFunction
120 using Superclass = CacheableScalarFunction;
123 using MeasureType = Superclass::MeasureType;
124 using MeasureArrayType = Superclass::MeasureArrayType;
127 CompositeValleyFunction(
const MeasureArrayType & classMeans,
const MeasureArrayType & classSigmas);
130 ~CompositeValleyFunction()
override;
134 GetUpperBound()
const
141 GetLowerBound()
const
149 operator()(MeasureType x)
151 if (x > m_UpperBound || x < m_LowerBound)
156 if (!this->IsCacheAvailable())
158 return this->Evaluate(x);
162 return GetCachedValue(x);
168 Evaluate(MeasureType x)
override;
172 valley(MeasureType d)
174 return 1 - 1 / (1 + d * d / 3);
179 AddNewClass(
double mean,
double sigma)
181 TargetClass aClass(mean, sigma);
183 m_Targets.push_back(aClass);
192 std::vector<TargetClass> m_Targets;