18 #ifndef itkBSplineDerivativeKernelFunction_h
19 #define itkBSplineDerivativeKernelFunction_h
42 template<
unsigned int VSplineOrder = 3,
typename TRealValueType =
double >
64 TRealValueType
Evaluate(
const TRealValueType & u )
const override
76 os << indent <<
"Spline Order: " <<
SplineOrder << std::endl;
82 template<
unsigned int >
97 return static_cast< TRealValueType
>(0.5);
113 return static_cast< TRealValueType
>(-0.5);
125 if( ( u > static_cast< TRealValueType >(-0.5) ) && ( u < static_cast< TRealValueType >(0.5) ) )
127 return ( static_cast< TRealValueType >(-2.0) * u );
129 else if( ( u >= static_cast< TRealValueType >(0.5) ) && ( u < static_cast< TRealValueType >(1.5) ) )
131 return ( static_cast< TRealValueType >(-1.5) + u );
133 else if( ( u > static_cast< TRealValueType >(-1.5) ) && ( u <= static_cast< TRealValueType >(-0.5) ) )
135 return ( static_cast< TRealValueType >(1.5) + u );
149 return ( static_cast< TRealValueType >(-2.0)* u + static_cast< TRealValueType >(1.5) * u * u );
153 return ( static_cast< TRealValueType >(-2.0) * u - static_cast< TRealValueType >(1.5) * u * u );
157 return ( static_cast< TRealValueType >(-2.0) + static_cast< TRealValueType >(2.0) * u - static_cast< TRealValueType >(0.5) * u * u );
161 return ( static_cast< TRealValueType >(2.0) + static_cast< TRealValueType >(2.0) * u + static_cast< TRealValueType >(0.5) * u * u );
173 itkExceptionMacro(
"Evaluate not implemented for spline order " <<
SplineOrder );
BSplineDerivativeKernelFunction()=default
Define numeric traits for std::vector.
void PrintSelf(std::ostream &os, Indent indent) const override
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potetially different types...
TRealValueType Evaluate(const DispatchBase &, const TRealValueType &) const
Kernel used for density estimation and nonparameteric regression.
Derivative of a BSpline kernel used for density estimation and nonparameteric regression.
static constexpr unsigned int SplineOrder
void PrintSelf(std::ostream &os, Indent indent) const override
TRealValueType Evaluate(const Dispatch< 2 > &, const TRealValueType &u) const
TRealValueType Evaluate(const Dispatch< 0 > &, const TRealValueType &) const
TRealValueType Evaluate(const Dispatch< 3 > &, const TRealValueType &u) const
TRealValueType Evaluate(const TRealValueType &u) const override
TRealValueType Evaluate(const Dispatch< 1 > &, const TRealValueType &u) const
Control indentation during Print() invocation.
~BSplineDerivativeKernelFunction() override=default
typename Superclass::RealType RealType