18 #ifndef itkBSplineDerivativeKernelFunction_h
19 #define itkBSplineDerivativeKernelFunction_h
42 template<
unsigned int VSplineOrder = 3,
typename TRealValueType =
double >
62 inline TRealValueType
Evaluate(
const TRealValueType & u )
const ITK_OVERRIDE
74 os << indent <<
"Spline Order: " <<
SplineOrder << std::endl;
79 void operator=(const
Self &) ITK_DELETE_FUNCTION;
83 template<
unsigned int >
98 return static_cast< TRealValueType
>(0.5);
114 return static_cast< TRealValueType
>(-0.5);
126 if( ( u > static_cast< TRealValueType >(-0.5) ) && ( u < static_cast< TRealValueType >(0.5) ) )
128 return ( static_cast< TRealValueType >(-2.0) * u );
130 else if( ( u >= static_cast< TRealValueType >(0.5) ) && ( u < static_cast< TRealValueType >(1.5) ) )
132 return ( static_cast< TRealValueType >(-1.5) + u );
134 else if( ( u > static_cast< TRealValueType >(-1.5) ) && ( u <= static_cast< TRealValueType >(-0.5) ) )
136 return ( static_cast< TRealValueType >(1.5) + u );
150 return ( static_cast< TRealValueType >(-2.0)* u + static_cast< TRealValueType >(1.5) * u * u );
154 return ( static_cast< TRealValueType >(-2.0) * u - static_cast< TRealValueType >(1.5) * u * u );
158 return ( static_cast< TRealValueType >(-2.0) + static_cast< TRealValueType >(2.0) * u - static_cast< TRealValueType >(0.5) * u * u );
162 return ( static_cast< TRealValueType >(2.0) + static_cast< TRealValueType >(2.0) * u + static_cast< TRealValueType >(0.5) * u * u );
174 itkExceptionMacro(
"Evaluate not implemented for spline order " <<
SplineOrder );
void PrintSelf(std::ostream &os, Indent indent) const override
BSplineDerivativeKernelFunction Self
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.
virtual ~BSplineDerivativeKernelFunction()
static const 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
KernelFunctionBase< TRealValueType > Superclass
Superclass::RealType RealType
TRealValueType Evaluate(const TRealValueType &u) const override
BSplineDerivativeKernelFunction()
TRealValueType Evaluate(const Dispatch< 1 > &, const TRealValueType &u) const
Control indentation during Print() invocation.
SmartPointer< Self > Pointer
Define additional traits for native types such as int or float.