Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkInterpolateImageFunction_h
00018 #define __itkInterpolateImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021
00022 namespace itk
00023 {
00024
00041 template <class TInputImage, class TCoordRep = double>
00042 class ITK_EXPORT InterpolateImageFunction :
00043 public ImageFunction< TInputImage,
00044 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType, TCoordRep >
00045 {
00046 public:
00048 typedef InterpolateImageFunction Self;
00049 typedef ImageFunction<TInputImage,
00050 typename NumericTraits<typename TInputImage::PixelType>::RealType,
00051 TCoordRep> Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 itkTypeMacro(InterpolateImageFunction, ImageFunction);
00057
00059 typedef typename Superclass::OutputType OutputType;
00060
00062 typedef typename Superclass::InputImageType InputImageType;
00063
00065 itkStaticConstMacro(ImageDimension, unsigned int,
00066 Superclass::ImageDimension);
00067
00069 typedef typename Superclass::PointType PointType;
00070
00072 typedef typename Superclass::IndexType IndexType;
00073 typedef typename Superclass::IndexValueType IndexValueType;
00074
00076 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00077
00079 typedef typename NumericTraits<typename TInputImage::PixelType>::RealType RealType;
00080
00089 virtual OutputType Evaluate( const PointType& point ) const
00090 {
00091 ContinuousIndexType index;
00092 this->GetInputImage()->TransformPhysicalPointToContinuousIndex( point, index );
00093 return ( this->EvaluateAtContinuousIndex( index ) );
00094 }
00096
00107 virtual OutputType EvaluateAtContinuousIndex(
00108 const ContinuousIndexType & index ) const = 0;
00109
00118 virtual OutputType EvaluateAtIndex( const IndexType & index ) const
00119 {
00120 return ( static_cast<RealType>( this->GetInputImage()->GetPixel( index ) ) );
00121 }
00122
00123 protected:
00124 InterpolateImageFunction(){};
00125 ~InterpolateImageFunction(){};
00126 void PrintSelf(std::ostream& os, Indent indent) const
00127 { Superclass::PrintSelf( os, indent ); }
00128
00129 private:
00130 InterpolateImageFunction( const Self& );
00131 void operator=( const Self& );
00132
00133 };
00134
00135 }
00136
00137 #endif
00138