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, \
00045 ::itk::GetImageDimension<TInputImage>::ImageDimension>,
00046 TCoordRep >
00047 {
00048 public:
00049
00051 itkStaticConstMacro(ImageDimension, unsigned int,
00052 TInputImage::ImageDimension);
00053
00055 typedef CentralDifferenceImageFunction Self;
00056 typedef ImageFunction<TInputImage,
00057 CovariantVector<double,
00058 itkGetStaticConstMacro(ImageDimension)>,
00059 TCoordRep> Superclass;
00060 typedef SmartPointer<Self> Pointer;
00061 typedef SmartPointer<const Self> ConstPointer;
00062
00064 itkTypeMacro(CentralDifferenceImageFunction, ImageFunction);
00065
00067 itkNewMacro(Self);
00068
00070 typedef TInputImage InputImageType;
00071
00073 typedef typename Superclass::OutputType OutputType;
00074
00076 typedef typename Superclass::IndexType IndexType;
00077
00079 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00080
00082 typedef typename Superclass::PointType PointType;
00083
00091 virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
00092
00101 virtual OutputType Evaluate( const PointType& point ) const
00102 {
00103 IndexType index;
00104 this->ConvertPointToNearestIndex( point, index );
00105 return this->EvaluateAtIndex( index );
00106 }
00107 virtual OutputType EvaluateAtContinuousIndex(
00108 const ContinuousIndexType& cindex ) const
00109 {
00110 IndexType index;
00111 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00112 return this->EvaluateAtIndex( index );
00113 }
00115
00124 itkSetMacro( UseImageDirection, bool );
00125 itkGetMacro( UseImageDirection, bool );
00126 itkBooleanMacro( UseImageDirection );
00128
00129 protected:
00130 CentralDifferenceImageFunction();
00131 ~CentralDifferenceImageFunction(){};
00132 void PrintSelf(std::ostream& os, Indent indent) const;
00133
00134 private:
00135 CentralDifferenceImageFunction( const Self& );
00136 void operator=( const Self& );
00137
00138
00139
00140 bool m_UseImageDirection;
00141
00142 };
00143
00144 }
00145
00146
00147 #define ITK_TEMPLATE_CentralDifferenceImageFunction(_, EXPORT, x, y) namespace itk { \
00148 _(2(class EXPORT CentralDifferenceImageFunction< ITK_TEMPLATE_2 x >)) \
00149 namespace Templates { typedef CentralDifferenceImageFunction< ITK_TEMPLATE_2 x > \
00150 CentralDifferenceImageFunction##y; } \
00151 }
00152
00153 #if ITK_TEMPLATE_EXPLICIT
00154 # include "Templates/itkCentralDifferenceImageFunction+-.h"
00155 #endif
00156
00157 #if ITK_TEMPLATE_TXX
00158 # include "itkCentralDifferenceImageFunction.txx"
00159 #endif
00160
00161 #endif
00162