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 #include "itkCovariantVector.h"
00022 #include "itkImageBase.h"
00023
00024 namespace itk
00025 {
00026
00039 template <
00040 class TInputImage,
00041 class TCoordRep = float >
00042 class ITK_EXPORT CentralDifferenceImageFunction :
00043 public ImageFunction< TInputImage,
00044 CovariantVector<double, ::itk::GetImageDimension<TInputImage>::ImageDimension>,
00045 TCoordRep >
00046 {
00047 public:
00049 itkStaticConstMacro(ImageDimension, unsigned int,
00050 TInputImage::ImageDimension);
00051
00053 typedef CentralDifferenceImageFunction Self;
00054 typedef ImageFunction<TInputImage,
00055 CovariantVector<double, itkGetStaticConstMacro(ImageDimension)>,
00056 TCoordRep> Superclass;
00057 typedef SmartPointer<Self> Pointer;
00058 typedef SmartPointer<const Self> ConstPointer;
00059
00061 itkTypeMacro(CentralDifferenceImageFunction, ImageFunction);
00062
00064 itkNewMacro(Self);
00065
00067 typedef TInputImage InputImageType;
00068
00070 typedef typename Superclass::OutputType OutputType;
00071
00073 typedef typename Superclass::IndexType IndexType;
00074
00076 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00077
00079 typedef typename Superclass::PointType PointType;
00080
00088 virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
00089
00097 virtual OutputType Evaluate( const PointType& point ) const
00098 {
00099 IndexType index;
00100 this->ConvertPointToNearestIndex( point, index );
00101 return this->EvaluateAtIndex( index );
00102 }
00103 virtual OutputType EvaluateAtContinuousIndex(
00104 const ContinuousIndexType& cindex ) const
00105 {
00106 IndexType index;
00107 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00108 return this->EvaluateAtIndex( index ) ;
00109 }
00110
00111 protected:
00112 CentralDifferenceImageFunction();
00113 ~CentralDifferenceImageFunction(){};
00114 void PrintSelf(std::ostream& os, Indent indent) const;
00115
00116 private:
00117 CentralDifferenceImageFunction( const Self& );
00118 void operator=( const Self& );
00119
00120 };
00121
00122 }
00123
00124 #ifndef ITK_MANUAL_INSTANTIATION
00125 #include "itkCentralDifferenceImageFunction.txx"
00126 #endif
00127
00128 #endif
00129