18#ifndef itkNearestNeighborExtrapolateImageFunction_h
19#define itkNearestNeighborExtrapolateImageFunction_h
41template <
typename TInputImage,
typename TCoordRep =
float>
61 using typename Superclass::OutputType;
64 using typename Superclass::InputImageType;
67 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
74 using typename Superclass::ContinuousIndexType;
88 const IndexType startIndex = this->GetStartIndex();
89 const IndexType endIndex = this->GetEndIndex();
91 for (
unsigned int j = 0; j < ImageDimension; ++j)
93 nindex[j] = std::clamp(Math::RoundHalfIntegerUp<IndexValueType>(index[j]), startIndex[j], endIndex[j]);
95 return static_cast<OutputType>(this->GetInputImage()->GetPixel(nindex));
110 const IndexType startIndex = this->GetStartIndex();
111 const IndexType endIndex = this->GetEndIndex();
113 for (
unsigned int j = 0; j < ImageDimension; ++j)
115 nindex[j] = std::clamp(index[j], startIndex[j], endIndex[j]);
117 return static_cast<OutputType>(this->GetInputImage()->GetPixel(nindex));
126 Superclass::PrintSelf(os, indent);
NumericTraits< TInputImage::PixelType >::RealType OutputType
typename InputImageType::IndexType IndexType
Control indentation during Print() invocation.
Light weight base class for most itk classes.
ImageBaseType::IndexType IndexType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....