18 #ifndef itkBSplineDerivativeKernelFunction_h
19 #define itkBSplineDerivativeKernelFunction_h
42 template <
unsigned int VSplineOrder = 3,
typename TRealValueType =
double>
61 static constexpr
unsigned int SplineOrder = VSplineOrder;
73 Evaluate(
const TRealValueType & u)
const override
75 return Self::FastEvaluate(u);
85 Superclass::PrintSelf(os, indent);
86 os << indent <<
"Spline Order: " << SplineOrder << std::endl;
93 template <
unsigned int>
98 static inline TRealValueType
101 return TRealValueType{ 0.0 };
105 static inline TRealValueType
110 return TRealValueType{ 0.5 };
112 else if ((u > TRealValueType{ -1.0 }) && (u < TRealValueType{ 0.0 }))
114 return TRealValueType{ 1.0 };
118 return TRealValueType{ 0.0 };
120 else if ((u > TRealValueType{ 0.0 }) && (u < TRealValueType{ 1.0 }))
122 return TRealValueType{ -1.0 };
126 return TRealValueType{ -0.5 };
130 return TRealValueType{ 0.0 };
136 static inline TRealValueType
139 if ((u > TRealValueType{ -0.5 }) && (u < TRealValueType{ 0.5 }))
141 return (TRealValueType{ -2.0 } * u);
143 else if ((u >= TRealValueType{ 0.5 }) && (u < TRealValueType{ 1.5 }))
145 return (TRealValueType{ -1.5 } + u);
147 else if ((u > TRealValueType{ -1.5 }) && (u <= TRealValueType{ -0.5 }))
149 return (TRealValueType{ 1.5 } + u);
153 return TRealValueType{ 0.0 };
159 static inline TRealValueType
162 if ((u >= TRealValueType{ 0.0 }) && (u < TRealValueType{ 1.0 }))
164 return (TRealValueType{ -2.0 } * u + TRealValueType{ 1.5 } * u * u);
166 else if ((u > TRealValueType{ -1.0 }) && (u < TRealValueType{ 0.0 }))
168 return (TRealValueType{ -2.0 } * u - TRealValueType{ 1.5 } * u * u);
170 else if ((u >= TRealValueType{ 1.0 }) && (u < TRealValueType{ 2.0 }))
172 return (TRealValueType{ -2.0 } + TRealValueType{ 2.0 } * u - TRealValueType{ 0.5 } * u * u);
174 else if ((u > TRealValueType{ -2.0 }) && (u <= TRealValueType{ -1.0 }))
176 return (TRealValueType{ 2.0 } + TRealValueType{ 2.0 } * u + TRealValueType{ 0.5 } * u * u);
180 return TRealValueType{ 0.0 };
186 static inline TRealValueType
189 itkGenericExceptionMacro(
"Evaluate not implemented for spline order " << SplineOrder);