18#ifndef itkWindowedSincInterpolateImageFunction_h
19#define itkWindowedSincInterpolateImageFunction_h
38template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
47 static constexpr double factor =
Math::pi / (2 * VRadius);
48 return static_cast<TOutput
>(std::cos(A * factor));
60template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
69 static constexpr double factor =
Math::pi / VRadius;
70 return static_cast<TOutput
>(0.54 + 0.46 * std::cos(A * factor));
81template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
90 static constexpr double factor = 1.0 / (VRadius * VRadius);
91 return static_cast<TOutput
>(1.0 - A * factor * A);
105template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
114 return static_cast<TOutput
>(1.0);
118 static constexpr double factor =
Math::pi / VRadius;
119 const double z = factor * A;
120 return static_cast<TOutput
>(std::sin(z) / z);
131template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
140 static constexpr double factor1 =
Math::pi / VRadius;
143 static constexpr double factor2 = 2.0 *
Math::pi / VRadius;
144 return static_cast<TOutput
>(0.42 + 0.5 * std::cos(A * factor1) + 0.08 * std::cos(A * factor2));
260template <
typename TInputImage,
261 unsigned int VRadius,
262 typename TWindowFunction = Function::HammingWindowFunction<VRadius>,
263 class TBoundaryCondition = ZeroFluxNeumannBoundaryCondition<TInputImage, TInputImage>,
264 class TCoordinate =
double>
286 using typename Superclass::OutputType;
289 using typename Superclass::InputImageType;
292 using typename Superclass::RealType;
295 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
308 using typename Superclass::ContinuousIndexType;
325 constexpr auto radius = SizeType::Filled(VRadius);
340 static constexpr unsigned int m_WindowSize{ 2 * VRadius };
343 TWindowFunction m_WindowFunction{};
350 unsigned int m_OffsetTable[m_OffsetTableSize]{};
353 unsigned int m_WeightOffsetTable[m_OffsetTableSize][ImageDimension]{};
360 return (x == 0.0) ? 1.0 : std::sin(px) / px;
366#ifndef ITK_MANUAL_INSTANTIATION
367# 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.
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
TOutput operator()(const TInput &A) const
Window function for sinc interpolation.
TOutput operator()(const TInput &A) const
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.
SizeType GetRadius() const override
~WindowedSincInterpolateImageFunction() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
WindowedSincInterpolateImageFunction()=default
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
void SetInputImage(const ImageType *image) override
static double Sinc(const double x)
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....