18 #ifndef __itkBSplineSecondOrderDerivativeKernelFunction2_h 19 #define __itkBSplineSecondOrderDerivativeKernelFunction2_h 21 #include "itkKernelFunctionBase.h" 22 #include "vnl/vnl_math.h" 42 template<
unsigned int VSplineOrder = 3 >
68 inline double Evaluate(
const double & u )
const 70 return this->
Evaluate( Dispatch< VSplineOrder >(), u );
79 void PrintSelf( std::ostream & os, Indent indent )
const 81 Superclass::PrintSelf( os, indent );
82 os << indent <<
"Spline Order: " << SplineOrder << std::endl;
92 struct DispatchBase {};
93 template<
unsigned int >
94 struct Dispatch : DispatchBase {};
139 inline double Evaluate(
const Dispatch< 2 > &,
const double & u )
const 141 double absValue = vnl_math_abs( u );
147 else if( absValue == 0.5 )
151 else if( absValue < 1.5 )
155 else if( absValue == 1.5 )
168 inline double Evaluate(
const Dispatch< 3 > &,
const double & u )
const 170 const double absValue = vnl_math_abs( u );
174 return vnl_math_sgn0( u ) * ( 3.0 * u ) - 2.0;
176 else if( absValue < 2.0 )
178 return -vnl_math_sgn( u ) * u + 2.0;
189 inline double Evaluate(
const DispatchBase &,
const double & )
const 191 itkExceptionMacro(
"Evaluate not implemented for spline\ 192 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