18 #ifndef itkBSplineDerivativeKernelFunction_h
19 #define itkBSplineDerivativeKernelFunction_h
42 template <
unsigned int VSplineOrder = 3,
typename TRealValueType =
double>
65 Evaluate(
const TRealValueType & u)
const override
78 os << indent <<
"Spline Order: " <<
SplineOrder << std::endl;
85 template <
unsigned int>
102 return static_cast<TRealValueType>(0.5);
118 return static_cast<TRealValueType>(-0.5);
128 inline TRealValueType
131 if ((u > static_cast<TRealValueType>(-0.5)) && (u < static_cast<TRealValueType>(0.5)))
133 return (static_cast<TRealValueType>(-2.0) * u);
135 else if ((u >= static_cast<TRealValueType>(0.5)) && (u < static_cast<TRealValueType>(1.5)))
137 return (static_cast<TRealValueType>(-1.5) + u);
139 else if ((u > static_cast<TRealValueType>(-1.5)) && (u <= static_cast<TRealValueType>(-0.5)))
141 return (static_cast<TRealValueType>(1.5) + u);
151 inline TRealValueType
156 return (static_cast<TRealValueType>(-2.0) * u + static_cast<TRealValueType>(1.5) * u * u);
160 return (static_cast<TRealValueType>(-2.0) * u - static_cast<TRealValueType>(1.5) * u * u);
164 return (static_cast<TRealValueType>(-2.0) + static_cast<TRealValueType>(2.0) * u -
165 static_cast<TRealValueType>(0.5) * u * u);
169 return (static_cast<TRealValueType>(2.0) + static_cast<TRealValueType>(2.0) * u +
170 static_cast<TRealValueType>(0.5) * u * u);
180 inline TRealValueType
183 itkExceptionMacro(
"Evaluate not implemented for spline order " <<
SplineOrder);