Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkVectorCentralDifferenceImageFunction_h
00019 #define __itkVectorCentralDifferenceImageFunction_h
00020
00021 #include "itkImageFunction.h"
00022 #include "itkMatrix.h"
00023 #include "itkImageBase.h"
00024
00025 namespace itk
00026 {
00027
00028 #ifndef __itkVectorInterpolateImageFunction_h
00029
00035 template <typename T>
00036 struct GetDimension
00037 {
00038 itkStaticConstMacro(Dimension, int, T::Dimension);
00039 };
00040 #endif
00041
00042
00060 template <
00061 class TInputImage,
00062 class TCoordRep = float >
00063 class ITK_EXPORT VectorCentralDifferenceImageFunction :
00064 public ImageFunction< TInputImage,
00065 Matrix<double, \
00066 ::itk::GetDimension<typename TInputImage::PixelType>::Dimension, \
00067 ::itk::GetImageDimension<TInputImage>::ImageDimension>,
00068 TCoordRep >
00069 {
00070 public:
00071 typedef typename TInputImage::PixelType InputPixelType;
00072
00074 itkStaticConstMacro(Dimension, unsigned int,
00075 InputPixelType::Dimension);
00076
00078 itkStaticConstMacro(ImageDimension, unsigned int,
00079 TInputImage::ImageDimension);
00080
00082 typedef VectorCentralDifferenceImageFunction Self;
00083 typedef ImageFunction<TInputImage,
00084 Matrix<double,itkGetStaticConstMacro(Dimension),
00085 itkGetStaticConstMacro(ImageDimension)>,
00086 TCoordRep> Superclass;
00087 typedef SmartPointer<Self> Pointer;
00088 typedef SmartPointer<const Self> ConstPointer;
00090
00092 itkTypeMacro(VectorCentralDifferenceImageFunction, ImageFunction);
00093
00095 itkNewMacro(Self);
00096
00098 typedef TInputImage InputImageType;
00099
00101 typedef typename Superclass::OutputType OutputType;
00102
00104 typedef typename Superclass::IndexType IndexType;
00105
00107 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00108
00110 typedef typename Superclass::PointType PointType;
00111
00119 virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
00120
00129 virtual OutputType Evaluate( const PointType& point ) const
00130 {
00131 IndexType index;
00132 this->ConvertPointToNearestIndex( point, index );
00133 return this->EvaluateAtIndex( index );
00134 }
00135 virtual OutputType EvaluateAtContinuousIndex(
00136 const ContinuousIndexType& cindex ) const
00137 {
00138 IndexType index;
00139 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00140 return this->EvaluateAtIndex( index );
00141 }
00143
00155 itkSetMacro( UseImageDirection, bool );
00156 itkGetConstMacro( UseImageDirection, bool );
00157 itkBooleanMacro( UseImageDirection );
00159
00160 protected:
00161 VectorCentralDifferenceImageFunction();
00162 ~VectorCentralDifferenceImageFunction(){};
00163 void PrintSelf(std::ostream& os, Indent indent) const;
00164
00165 private:
00166 VectorCentralDifferenceImageFunction( const Self& );
00167 void operator=( const Self& );
00168
00169
00170
00171 bool m_UseImageDirection;
00172
00173 };
00174
00175 }
00176
00177 #ifndef ITK_MANUAL_INSTANTIATION
00178 #include "itkVectorCentralDifferenceImageFunction.txx"
00179 #endif
00180
00181 #endif
00182