28 #ifndef itkBSplineInterpolateImageFunction_h
29 #define itkBSplineInterpolateImageFunction_h
34 #include "vnl/vnl_matrix.h"
82 typename TCoordRep = double,
83 typename TCoefficientType =
double >
109 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
126 Self::ImageDimension >;
134 Self::ImageDimension >;
148 this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point,
151 return ( this->EvaluateAtContinuousIndex(index) );
159 this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point,
161 return ( this->EvaluateAtContinuousIndex(index, threadId) );
165 index)
const override
169 vnl_matrix< long > evaluateIndex( ImageDimension, ( m_SplineOrder + 1 ) );
170 vnl_matrix< double > weights( ImageDimension, ( m_SplineOrder + 1 ) );
174 return this->EvaluateAtContinuousIndexInternal(index,
179 virtual OutputType EvaluateAtContinuousIndex(
const ContinuousIndexType &
187 this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point,
190 return ( this->EvaluateDerivativeAtContinuousIndex(index) );
198 this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point,
200 return ( this->EvaluateDerivativeAtContinuousIndex(index, threadId) );
210 vnl_matrix< long > evaluateIndex( ImageDimension, ( m_SplineOrder + 1 ) );
211 vnl_matrix< double > weights( ImageDimension, ( m_SplineOrder + 1 ) );
212 vnl_matrix< double > weightsDerivative( ImageDimension, ( m_SplineOrder + 1 ) );
217 return this->EvaluateDerivativeAtContinuousIndexInternal(x,
223 CovariantVectorType EvaluateDerivativeAtContinuousIndex(
224 const ContinuousIndexType & x,
233 this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point,
237 this->EvaluateValueAndDerivativeAtContinuousIndex(index,
249 this->GetInputImage()->TransformPhysicalPointToContinuousIndex(point,
251 this->EvaluateValueAndDerivativeAtContinuousIndex(index,
267 vnl_matrix< long > evaluateIndex( ImageDimension, ( m_SplineOrder + 1 ) );
268 vnl_matrix< double > weights( ImageDimension, ( m_SplineOrder + 1 ) );
269 vnl_matrix< double > weightsDerivative( ImageDimension, ( m_SplineOrder + 1 ) );
274 this->EvaluateValueAndDerivativeAtContinuousIndexInternal(x,
282 void EvaluateValueAndDerivativeAtContinuousIndex(
283 const ContinuousIndexType & x,
285 CovariantVectorType & deriv,
290 void SetSplineOrder(
unsigned int SplineOrder);
292 itkGetConstMacro(SplineOrder,
int);
299 void SetInputImage(
const TImageType *inputData)
override;
311 itkSetMacro(UseImageDirection,
bool);
312 itkGetConstMacro(UseImageDirection,
bool);
313 itkBooleanMacro(UseImageDirection);
336 virtual OutputType EvaluateAtContinuousIndexInternal(
const ContinuousIndexType & index,
337 vnl_matrix< long > & evaluateIndex,
338 vnl_matrix< double > & weights)
const;
340 virtual void EvaluateValueAndDerivativeAtContinuousIndexInternal(
const ContinuousIndexType & x,
342 CovariantVectorType & derivativeValue,
343 vnl_matrix< long > & evaluateIndex,
344 vnl_matrix< double > & weights,
345 vnl_matrix< double > & weightsDerivative
348 virtual CovariantVectorType EvaluateDerivativeAtContinuousIndexInternal(
const ContinuousIndexType & x,
349 vnl_matrix< long > & evaluateIndex,
350 vnl_matrix< double > & weights,
351 vnl_matrix< double > & weightsDerivative
356 void PrintSelf(std::ostream & os,
Indent indent)
const override;
372 const vnl_matrix< long > & EvaluateIndex,
373 vnl_matrix< double > & weights,
374 unsigned int splineOrder)
const;
378 const vnl_matrix< long > & EvaluateIndex,
379 vnl_matrix< double > & weights,
380 unsigned int splineOrder)
const;
384 void GeneratePointsToIndex();
387 void DetermineRegionOfSupport(vnl_matrix< long > & evaluateIndex,
389 unsigned int splineOrder)
const;
393 void ApplyMirrorBoundaryConditions(vnl_matrix< long > & evaluateIndex,
394 unsigned int splineOrder)
const;
421 #ifndef ITK_MANUAL_INSTANTIATION
422 #include "itkBSplineInterpolateImageFunction.hxx"
vnl_matrix< long > * m_ThreadedEvaluateIndex
NumericTraits< TImageType::PixelType >::RealType OutputType
typename Superclass::IndexType IndexType
std::vector< CoefficientDataType > m_Scratch
OutputType Evaluate(const PointType &point) const override
Light weight base class for most itk classes.
unsigned long m_MaxNumberInterpolationPoints
CoefficientFilterPointer m_CoefficientFilter
CovariantVectorType EvaluateDerivative(const PointType &point) const
vnl_matrix< double > * m_ThreadedWeights
typename CoefficientFilter::Pointer CoefficientFilterPointer
std::vector< IndexType > m_PointsToIndex
CovariantVectorType EvaluateDerivative(const PointType &point, ThreadIdType threadId) const
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
ImageBaseType::SizeType SizeType
ImageBaseType::IndexType IndexType
void EvaluateValueAndDerivativeAtContinuousIndex(const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
typename Superclass::PointType PointType
virtual OutputType Evaluate(const PointType &point, ThreadIdType threadId) const
ThreadIdType m_NumberOfWorkUnits
TImageType::PixelType CoefficientDataType
unsigned int ThreadIdType
Base class for all image interpolaters.
typename Superclass::InputImageType InputImageType
void EvaluateValueAndDerivative(const PointType &point, OutputType &value, CovariantVectorType &deriv, ThreadIdType threadId) const
Calculates the B-Spline coefficients of an image. Spline order may be from 0 to 5.
TImageType::SizeType m_DataLength
void EvaluateValueAndDerivative(const PointType &point, OutputType &value, CovariantVectorType &deriv) const
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
Evaluates the B-Spline interpolation of an image. Spline order may be from 0 to 5.
CovariantVectorType EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType &x) const
CoefficientImageType::ConstPointer m_Coefficients
typename Superclass::ContinuousIndexType ContinuousIndexType
A templated class holding a n-Dimensional covariant vector.
unsigned int m_SplineOrder
Templated n-dimensional image class.
vnl_matrix< double > * m_ThreadedWeightsDerivative