28 #ifndef itkBSplineInterpolateImageFunction_h
29 #define itkBSplineInterpolateImageFunction_h
34 #include "vnl/vnl_matrix.h"
82 typename TCoordRep = double,
83 typename TCoefficientType =
double >
101 typedef typename Superclass::OutputType
OutputType;
107 itkStaticConstMacro(ImageDimension,
unsigned int, Superclass::ImageDimension);
124 itkGetStaticConstMacro(ImageDimension) >
133 itkGetStaticConstMacro(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 ITK_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 virtual void SetInputImage(
const TImageType *inputData) ITK_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 ITK_OVERRIDE;
364 unsigned int m_SplineOrder;
374 const vnl_matrix<
long > & EvaluateIndex,
375 vnl_matrix<
double > & weights,
376 unsigned int splineOrder) const;
380 const vnl_matrix<
long > & EvaluateIndex,
381 vnl_matrix<
double > & weights,
382 unsigned int splineOrder) const;
386 void GeneratePointsToIndex();
389 void DetermineRegionOfSupport(vnl_matrix<
long > & evaluateIndex,
391 unsigned int splineOrder) const;
395 void ApplyMirrorBoundaryConditions(vnl_matrix<
long > & evaluateIndex,
396 unsigned int splineOrder) const;
401 unsigned long m_MaxNumberInterpolationPoints;
414 bool m_UseImageDirection;
417 vnl_matrix<
long > * m_ThreadedEvaluateIndex;
418 vnl_matrix<
double > *m_ThreadedWeights;
419 vnl_matrix<
double > *m_ThreadedWeightsDerivative;
423 #ifndef ITK_MANUAL_INSTANTIATION
424 #include "itkBSplineInterpolateImageFunction.hxx"
Superclass::PointType PointType
virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
Image< CoefficientDataType, itkGetStaticConstMacro(ImageDimension) > CoefficientImageType
Light weight base class for most itk classes.
BSplineDecompositionImageFilter< TImageType, CoefficientImageType > CoefficientFilter
Superclass::InputImageType InputImageType
BSplineInterpolateImageFunction Self
CovariantVectorType EvaluateDerivative(const PointType &point) const
TCoefficientType CoefficientDataType
Superclass::ContinuousIndexType ContinuousIndexType
CoefficientFilter::Pointer CoefficientFilterPointer
CovariantVectorType EvaluateDerivative(const PointType &point, ThreadIdType threadId) const
ImageLinearIteratorWithIndex< TImageType > Iterator
ImageBaseType::PointType PointType
void EvaluateValueAndDerivativeAtContinuousIndex(const ContinuousIndexType &x, OutputType &value, CovariantVectorType &deriv) const
virtual OutputType Evaluate(const PointType &point, ThreadIdType threadId) const
SmartPointer< const Self > ConstPointer
unsigned int ThreadIdType
Superclass::IndexType IndexType
Base class for all image interpolaters.
Superclass::OutputType OutputType
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.
InterpolateImageFunction< TImageType, TCoordRep > Superclass
void EvaluateValueAndDerivative(const PointType &point, OutputType &value, CovariantVectorType &deriv) const
Control indentation during Print() invocation.
virtual OutputType Evaluate(const PointType &point) const override
ImageBaseType::SizeType SizeType
Evaluates the B-Spline interpolation of an image. Spline order may be from 0 to 5.
CovariantVectorType EvaluateDerivativeAtContinuousIndex(const ContinuousIndexType &x) const
SmartPointer< Self > Pointer
A templated class holding a n-Dimensional covariant vector.
CovariantVector< OutputType, itkGetStaticConstMacro(ImageDimension) > CovariantVectorType
NumericTraits< TImageType::PixelType >::RealType OutputType
Templated n-dimensional image class.
ImageBaseType::IndexType IndexType