18#ifndef itkImageFunction_h
19#define itkImageFunction_h
54template <
typename TInputImage,
typename TOutput,
typename TCoordinate =
float>
61 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
88#ifndef ITK_FUTURE_LEGACY_REMOVE
89 using CoordRepType ITK_FUTURE_DEPRECATED(
90 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") =
CoordinateType;
114 return m_Image.GetPointer();
141 for (
unsigned int j = 0; j < ImageDimension; ++j)
143 if (index[j] < m_StartIndex[j])
147 if (index[j] > m_EndIndex[j])
162 for (
unsigned int j = 0; j < ImageDimension; ++j)
165 if (!(index[j] >= m_StartContinuousIndex[j] && index[j] < m_EndContinuousIndex[j]))
184 const bool isInside = IsInsideBuffer(index);
194 this->ConvertContinuousIndexToNearestIndex(cindex, index);
202 cindex = m_Image->template TransformPhysicalPointToContinuousIndex<TCoordinate>(
point);
209 index.CopyWithRound(cindex);
236#ifndef ITK_MANUAL_INSTANTIATION
237# include "itkImageFunction.hxx"
A templated class holding a point in n-Dimensional image space.
Base class for all ITK function objects.
Evaluates a function of an image at specified position.
void ConvertPointToContinuousIndex(const PointType &point, ContinuousIndexType &cindex) const
TCoordinate CoordinateType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetInputImage(const InputImageType *ptr)
~ImageFunction() override=default
virtual TOutput EvaluateAtContinuousIndex(const ContinuousIndexType &index) const =0
virtual bool IsInsideBuffer(const ContinuousIndexType &index) const
typename InputImageType::PixelType InputPixelType
virtual TOutput EvaluateAtIndex(const IndexType &index) const =0
void ConvertPointToNearestIndex(const PointType &point, IndexType &index) const
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::IndexValueType IndexValueType
OutputType Evaluate(const PointType &point) const override=0
const InputImageType * GetInputImage() const
virtual bool IsInsideBuffer(const PointType &point) const
typename InputImageType::IndexType IndexType
void ConvertContinuousIndexToNearestIndex(const ContinuousIndexType &cindex, IndexType &index) const
TInputImage InputImageType
virtual bool IsInsideBuffer(const IndexType &index) const
Control indentation during Print() invocation.
Light weight base class for most itk classes.
A templated class holding a geometric point in n-Dimensional space.
SmartPointer< const Self > ConstPointer
ImageBaseType::IndexType IndexType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents