18#ifndef itkWindowedSincInterpolateImageFunction_h
19#define itkWindowedSincInterpolateImageFunction_h
37template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
44 return static_cast<TOutput
>(std::cos(A * m_Factor));
60template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
67 return static_cast<TOutput
>(0.54 + 0.46 * std::cos(A * m_Factor));
83template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
90 return static_cast<TOutput
>(1.0 - A * m_Factor * A);
108template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
117 return static_cast<TOutput
>(1.0);
119 double z = m_Factor * A;
120 return static_cast<TOutput
>(std::sin(z) / z);
136template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
143 return static_cast<TOutput
>(0.42 + 0.5 * std::cos(A * m_Factor1) + 0.08 * std::cos(A * m_Factor2));
266template <
typename TInputImage,
267 unsigned int VRadius,
270 class TCoordRep =
double>
291 using typename Superclass::OutputType;
294 using typename Superclass::InputImageType;
297 using typename Superclass::RealType;
300 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
313 using typename Superclass::ContinuousIndexType;
330 constexpr auto radius = SizeType::Filled(VRadius);
345 static constexpr unsigned int m_WindowSize{ 2 * VRadius };
348 TWindowFunction m_WindowFunction{};
355 unsigned int m_OffsetTable[m_OffsetTableSize]{};
358 unsigned int m_WeightOffsetTable[m_OffsetTableSize][ImageDimension]{};
366 return (x == 0.0) ? 1.0 : std::sin(px) / px;
371#ifndef ITK_MANUAL_INSTANTIATION
372# include "itkWindowedSincInterpolateImageFunction.hxx"
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
NumericTraits< TInputImage::PixelType >::RealType OutputType
Window function for sinc interpolation.
static const double m_Factor1
static const double m_Factor2
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
static const double m_Factor
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
TOutput operator()(const TInput &A) const
static const double m_Factor
Window function for sinc interpolation.
static const double m_Factor
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
TOutput operator()(const TInput &A) const
static const double m_Factor
Control indentation during Print() invocation.
Base class for all image interpolators.
typename InputImageType::SizeType SizeType
Light weight base class for most itk classes.
Use the windowed sinc function to interpolate.
double Sinc(double x) const
void SetInputImage(const ImageType *image) override
void PrintSelf(std::ostream &os, Indent indent) const override
WindowedSincInterpolateImageFunction()=default
~WindowedSincInterpolateImageFunction() override=default
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
SizeType GetRadius() const override
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
constexpr TReturnType UnsignedPower(const uintmax_t base, const uintmax_t exponent) noexcept
static constexpr double pi
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....