18 #ifndef __itkNearestNeighborExtrapolateImageFunction_h
19 #define __itkNearestNeighborExtrapolateImageFunction_h
39 template<
class TInputImage,
class TCoordRep =
float >
58 typedef typename Superclass::OutputType
OutputType;
64 itkStaticConstMacro(ImageDimension,
unsigned int, Superclass::ImageDimension);
85 for (
unsigned int j = 0; j < ImageDimension; j++ )
87 nindex[j] = Math::RoundHalfIntegerUp< IndexValueType >(index[j]);
88 if ( nindex[j] < this->GetStartIndex()[j] )
90 nindex[j] = this->GetStartIndex()[j];
92 else if ( nindex[j] > this->GetEndIndex()[j] )
94 nindex[j] = this->GetEndIndex()[j];
97 return static_cast< OutputType >( this->GetInputImage()->GetPixel(nindex) );
112 for (
unsigned int j = 0; j < ImageDimension; j++ )
114 if ( index[j] < this->GetStartIndex()[j] )
116 nindex[j] = this->GetStartIndex()[j];
118 else if ( index[j] > this->GetEndIndex()[j] )
120 nindex[j] = this->GetEndIndex()[j];
124 nindex[j] = index[j];
127 return static_cast< OutputType >( this->GetInputImage()->GetPixel(nindex) );
133 void PrintSelf(std::ostream & os,
Indent indent)
const
134 { Superclass::PrintSelf(os, indent); }
138 void operator=(
const Self &);