18 #ifndef itkWindowedSincInterpolateImageFunction_h
19 #define itkWindowedSincInterpolateImageFunction_h
37 template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
44 return static_cast<TOutput>(std::cos(A * m_Factor));
60 template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
67 return static_cast<TOutput>(0.54 + 0.46 * std::cos(A * m_Factor));
83 template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
90 return static_cast<TOutput>(1.0 - A * m_Factor * A);
108 template <
unsigned int VRadius,
typename TInput =
double,
typename TOutput =
double>
117 return static_cast<TOutput>(1.0);
119 const double z = m_Factor * A;
120 return static_cast<TOutput>(std::sin(z) / z);
136 template <
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));
266 template <
typename TInputImage,
267 unsigned int VRadius,
270 class TCoordinate =
double>
292 using typename Superclass::OutputType;
295 using typename Superclass::InputImageType;
298 using typename Superclass::RealType;
301 static constexpr
unsigned int ImageDimension = Superclass::ImageDimension;
314 using typename Superclass::ContinuousIndexType;
317 SetInputImage(
const ImageType * image)
override;
331 constexpr
auto radius = SizeType::Filled(VRadius);
339 PrintSelf(std::ostream & os,
Indent indent)
const override;
346 static constexpr
unsigned int m_WindowSize{ 2 * VRadius };
349 TWindowFunction m_WindowFunction{};
356 unsigned int m_OffsetTable[m_OffsetTableSize]{};
359 unsigned int m_WeightOffsetTable[m_OffsetTableSize][ImageDimension]{};
367 return (x == 0.0) ? 1.0 : std::sin(px) / px;
372 #ifndef ITK_MANUAL_INSTANTIATION
373 # include "itkWindowedSincInterpolateImageFunction.hxx"
376 #endif // _itkWindowedSincInterpolateImageFunction_h