17 #ifndef __itkBSplineSecondOrderDerivativeKernelFunction2_h
18 #define __itkBSplineSecondOrderDerivativeKernelFunction2_h
20 #include "itkKernelFunctionBase.h"
21 #include "vnl/vnl_math.h"
41 template<
unsigned int VSplineOrder = 3 >
67 inline double Evaluate(
const double & u )
const
69 return this->
Evaluate( Dispatch< VSplineOrder >(), u );
78 void PrintSelf( std::ostream & os, Indent indent )
const
80 Superclass::PrintSelf( os, indent );
81 os << indent <<
"Spline Order: " << SplineOrder << std::endl;
91 struct DispatchBase {};
92 template<
unsigned int >
93 struct Dispatch : DispatchBase {};
138 inline double Evaluate(
const Dispatch< 2 > &,
const double & u )
const
140 double absValue = vnl_math_abs( u );
146 else if( absValue == 0.5 )
150 else if( absValue < 1.5 )
154 else if( absValue == 1.5 )
167 inline double Evaluate(
const Dispatch< 3 > &,
const double & u )
const
169 const double absValue = vnl_math_abs( u );
173 return vnl_math_sgn0( u ) * ( 3.0 * u ) - 2.0;
175 else if( absValue < 2.0 )
177 return -vnl_math_sgn( u ) * u + 2.0;
188 inline double Evaluate(
const DispatchBase &,
const double & )
const
190 itkExceptionMacro(
"Evaluate not implemented for spline\
191 order " << SplineOrder );
BSplineSecondOrderDerivativeKernelFunction2()
double Evaluate(const Dispatch< 3 > &, const double &u) const
SmartPointer< Self > Pointer
void operator=(const Self &)
BSplineSecondOrderDerivativeKernelFunction2 Self
KernelFunctionBase< double > Superclass
itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder)
double Evaluate(const DispatchBase &, const double &) const
~BSplineSecondOrderDerivativeKernelFunction2()
double Evaluate(const Dispatch< 2 > &, const double &u) const
double Evaluate(const double &u) const
Derivative of a B-spline kernel used for density estimation and nonparametric regression.
void PrintSelf(std::ostream &os, Indent indent) const