18 #ifndef itkImageFunction_h
19 #define itkImageFunction_h
56 typename TCoordRep =
float
59 public FunctionBase< Point< TCoordRep, TInputImage::ImageDimension >, TOutput >
63 itkStaticConstMacro(ImageDimension,
unsigned int,
64 TInputImage::ImageDimension);
71 itkGetStaticConstMacro(ImageDimension) >,
114 {
return m_Image.GetPointer(); }
118 virtual TOutput Evaluate(
const PointType & point)
const ITK_OVERRIDE = 0;
122 virtual TOutput EvaluateAtIndex(
const IndexType & index)
const = 0;
126 virtual TOutput EvaluateAtContinuousIndex(
127 const ContinuousIndexType & index)
const = 0;
137 for (
unsigned int j = 0; j < ImageDimension; j++ )
139 if ( index[j] < m_StartIndex[j] )
143 if ( index[j] > m_EndIndex[j] )
157 for (
unsigned int j = 0; j < ImageDimension; j++ )
160 if ( ! (index[j] >= m_StartContinuousIndex[j] &&
161 index[j] < m_EndContinuousIndex[j] ) )
176 m_Image->TransformPhysicalPointToContinuousIndex(point, index);
180 bool isInside = IsInsideBuffer( index );
191 m_Image->TransformPhysicalPointToContinuousIndex(point, cindex);
192 this->ConvertContinuousIndexToNearestIndex(cindex, index);
199 m_Image->TransformPhysicalPointToContinuousIndex(point, cindex);
207 index.CopyWithRound(cindex);
210 itkGetConstReferenceMacro(StartIndex,
IndexType);
211 itkGetConstReferenceMacro(EndIndex,
IndexType);
213 itkGetConstReferenceMacro(StartContinuousIndex, ContinuousIndexType);
214 itkGetConstReferenceMacro(EndContinuousIndex, ContinuousIndexType);
219 void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
236 #ifndef ITK_MANUAL_INSTANTIATION
237 #include "itkImageFunction.hxx"
void ConvertPointToContinuousIndex(const PointType &point, ContinuousIndexType &cindex) const
InputImageType::ConstPointer InputImageConstPointer
Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) > PointType
ContinuousIndexType m_EndContinuousIndex
virtual bool IsInsideBuffer(const IndexType &index) const
signed long IndexValueType
void ConvertPointToNearestIndex(const PointType &point, IndexType &index) const
ContinuousIndexType m_StartContinuousIndex
const InputImageType * GetInputImage() const
Base class for all ITK function objects.
ImageBaseType::PointType PointType
InputImageType::PixelType InputPixelType
SmartPointer< const Self > ConstPointer
InputImageType::IndexType IndexType
TInputImage InputImageType
FunctionBase< Point< TCoordRep, itkGetStaticConstMacro(ImageDimension) >, TOutput > Superclass
ContinuousIndex< TCoordRep, itkGetStaticConstMacro(ImageDimension) > ContinuousIndexType
virtual bool IsInsideBuffer(const PointType &point) const
virtual bool IsInsideBuffer(const ContinuousIndexType &index) const
A templated class holding a point in n-Dimensional image space.
Control indentation during Print() invocation.
InputImageConstPointer m_Image
void ConvertContinuousIndexToNearestIndex(const ContinuousIndexType &cindex, IndexType &index) const
A templated class holding a geometric point in n-Dimensional space.
~ImageFunction() override
Evaluates a function of an image at specified position.
InputImageType::IndexValueType IndexValueType
SmartPointer< Self > Pointer
ImageBaseType::IndexType IndexType