18 #ifndef itkBSplineDerivativeKernelFunction_h
19 #define itkBSplineDerivativeKernelFunction_h
42 template<
unsigned int VSplineOrder = 3,
typename TRealValueType =
double >
62 TRealValueType
Evaluate(
const TRealValueType & u )
const ITK_OVERRIDE
74 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 );
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.
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
virtual ~BSplineDerivativeKernelFunction() override
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.