17 #ifndef __itkImageFunction_h
18 #define __itkImageFunction_h
58 class TCoordRep =
float
62 ::itk::GetImageDimension<TInputImage>::ImageDimension>,
67 itkStaticConstMacro(ImageDimension,
unsigned int,
68 TInputImage::ImageDimension);
97 typedef typename InputImageType::IndexType
IndexType;
115 {
return m_Image.GetPointer(); }
119 virtual TOutput Evaluate(
const PointType& point )
const = 0;
123 virtual TOutput EvaluateAtIndex(
const IndexType & index )
const = 0;
127 virtual TOutput EvaluateAtContinuousIndex(
128 const ContinuousIndexType & index )
const = 0;
137 virtual bool IsInsideBuffer(
const IndexType & index )
const
139 for(
unsigned int j = 0; j < ImageDimension; j++ )
141 if( index[j] < m_StartIndex[j] )
145 if( index[j] > m_EndIndex[j] )
158 for(
unsigned int j = 0; j < ImageDimension; j++ )
160 if( index[j] < m_StartContinuousIndex[j] )
164 #ifdef ITK_USE_CENTERED_PIXEL_COORDINATES_CONSISTENTLY
165 if( index[j] >= m_EndContinuousIndex[j] )
167 if( index[j] > m_EndContinuousIndex[j] )
179 virtual bool IsInsideBuffer(
const PointType & point )
const
182 m_Image->TransformPhysicalPointToContinuousIndex( point, index );
183 return this->IsInsideBuffer( index );
187 void ConvertPointToNearestIndex(
const PointType & point,
191 m_Image->TransformPhysicalPointToContinuousIndex( point, cindex );
192 this->ConvertContinuousIndexToNearestIndex( cindex, index );
196 void ConvertPointToContinousIndex(
const PointType & point,
199 itkWarningMacro(
"Please change your code to use ConvertPointToContinuousIndex "
200 <<
"rather than ConvertPointToContinousIndex. The latter method name was "
201 <<
"mispelled and the ITK developers failed to correct it before it was released."
202 <<
"The mispelled method name is retained in order to maintain backward compatibility.");
203 this->ConvertPointToContinuousIndex( point, cindex );
207 void ConvertPointToContinuousIndex(
const PointType & point,
210 m_Image->TransformPhysicalPointToContinuousIndex( point, cindex );
217 index.CopyWithRound( cindex );
220 itkGetConstReferenceMacro(StartIndex, IndexType);
221 itkGetConstReferenceMacro(EndIndex, IndexType);
223 itkGetConstReferenceMacro(StartContinuousIndex, ContinuousIndexType);
224 itkGetConstReferenceMacro(EndContinuousIndex, ContinuousIndexType);
229 void PrintSelf(std::ostream& os,
Indent indent)
const;
242 void operator=(
const Self&);
250 #define ITK_TEMPLATE_ImageFunction(_, EXPORT, x, y) namespace itk { \
251 _(3(class EXPORT ImageFunction< ITK_TEMPLATE_3 x >)) \
252 namespace Templates { typedef ImageFunction< ITK_TEMPLATE_3 x > ImageFunction##y; } \
255 #if ITK_TEMPLATE_EXPLICIT
256 # include "Templates/itkImageFunction+-.h"