00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkCentralDifferenceImageFunction_h
00018 #define _itkCentralDifferenceImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021
00022 namespace itk
00023 {
00024
00037 template <class TInputImage, class TCoordRep = float >
00038 class ITK_EXPORT CentralDifferenceImageFunction :
00039 public ImageFunction< TInputImage, double, TCoordRep >
00040 {
00041 public:
00043 typedef CentralDifferenceImageFunction Self;
00044 typedef ImageFunction<TInputImage, double, TCoordRep> Superclass;
00045 typedef SmartPointer<Self> Pointer;
00046 typedef SmartPointer<const Self> ConstPointer;
00047
00049 itkTypeMacro(CentralDifferenceImageFunction, ImageFunction);
00050
00052 itkNewMacro(Self);
00053
00055 typedef TInputImage InputImageType;
00056
00058 typedef typename Superclass::OutputType OutputType;
00059
00061 typedef typename Superclass::IndexType IndexType;
00062
00064 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00065
00067 typedef typename Superclass::PointType PointType;
00068
00070 itkStaticConstMacro(ImageDimension, unsigned int,
00071 InputImageType::ImageDimension);
00072
00074 virtual double EvaluateAtIndex( const IndexType& index ) const
00075 { return ( this->EvaluateAtIndex( index, 0 ) ); }
00076 virtual double EvaluateAtIndex( const IndexType& index,
00077 unsigned int dim ) const;
00078
00080 virtual double Evaluate( const PointType& point ) const
00081 {
00082 IndexType index;
00083 this->ConvertPointToNearestIndex( point, index );
00084 return this->EvaluateAtIndex( index, 0 );
00085 }
00086 virtual double EvaluateAtContinuousIndex(
00087 const ContinuousIndexType& cindex ) const
00088 {
00089 IndexType index;
00090 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00091 return this->EvaluateAtIndex( index, 0 ) ;
00092 }
00093
00094 protected:
00095 CentralDifferenceImageFunction();
00096 ~CentralDifferenceImageFunction(){};
00097 void PrintSelf(std::ostream& os, Indent indent) const;
00098
00099 private:
00100 CentralDifferenceImageFunction( const Self& );
00101 void operator=( const Self& );
00102
00103 };
00104
00105 }
00106
00107 #ifndef ITK_MANUAL_INSTANTIATION
00108 #include "itkCentralDifferenceImageFunction.txx"
00109 #endif
00110
00111 #endif
00112