18 #ifndef itkImageFunction_h
19 #define itkImageFunction_h
56 typename TCoordRep =
float
59 public FunctionBase< Point< TCoordRep, TInputImage::ImageDimension >, TOutput >
65 static constexpr
unsigned int ImageDimension = TInputImage::ImageDimension;
72 Self::ImageDimension >,
102 Self::ImageDimension >;
115 {
return m_Image.GetPointer(); }
119 TOutput Evaluate(
const PointType & point)
const override = 0;
123 virtual TOutput EvaluateAtIndex(
const IndexType & index)
const = 0;
127 virtual TOutput EvaluateAtContinuousIndex(
128 const ContinuousIndexType & index)
const = 0;
138 for (
unsigned int j = 0; j < ImageDimension; j++ )
140 if ( index[j] < m_StartIndex[j] )
144 if ( index[j] > m_EndIndex[j] )
158 for (
unsigned int j = 0; j < ImageDimension; j++ )
161 if ( ! (index[j] >= m_StartContinuousIndex[j] &&
162 index[j] < m_EndContinuousIndex[j] ) )
177 m_Image->TransformPhysicalPointToContinuousIndex(point, index);
181 bool isInside = IsInsideBuffer( index );
192 m_Image->TransformPhysicalPointToContinuousIndex(point, cindex);
193 this->ConvertContinuousIndexToNearestIndex(cindex, index);
200 m_Image->TransformPhysicalPointToContinuousIndex(point, cindex);
208 index.CopyWithRound(cindex);
211 itkGetConstReferenceMacro(StartIndex,
IndexType);
212 itkGetConstReferenceMacro(EndIndex,
IndexType);
214 itkGetConstReferenceMacro(StartContinuousIndex, ContinuousIndexType);
215 itkGetConstReferenceMacro(EndContinuousIndex, ContinuousIndexType);
220 void PrintSelf(std::ostream & os,
Indent indent)
const override;
234 #ifndef ITK_MANUAL_INSTANTIATION
235 #include "itkImageFunction.hxx"
void ConvertPointToContinuousIndex(const PointType &point, ContinuousIndexType &cindex) const
Light weight base class for most itk classes.
ContinuousIndexType m_EndContinuousIndex
typename InputImageType::ConstPointer InputImageConstPointer
virtual bool IsInsideBuffer(const IndexType &index) const
void ConvertPointToNearestIndex(const PointType &point, IndexType &index) const
ContinuousIndexType m_StartContinuousIndex
typename InputImageType::PixelType InputPixelType
const InputImageType * GetInputImage() const
TInputImage InputImageType
Base class for all ITK function objects.
ImageBaseType::IndexType IndexType
signed long IndexValueType
virtual bool IsInsideBuffer(const PointType &point) const
virtual bool IsInsideBuffer(const ContinuousIndexType &index) const
typename InputImageType::IndexType IndexType
Control indentation during Print() invocation.
ImageBaseType::PointType PointType
typename InputImageType::IndexValueType IndexValueType
InputImageConstPointer m_Image
void ConvertContinuousIndexToNearestIndex(const ContinuousIndexType &cindex, IndexType &index) const
A templated class holding a geometric point in n-Dimensional space.
Evaluates a function of an image at specified position.