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 __itkGaussianDerivativeImageFunction_h
00018 #define __itkGaussianDerivativeImageFunction_h
00019
00020 #include "itkNeighborhoodOperatorImageFunction.h"
00021 #include "itkImageFunction.h"
00022 #include "itkGaussianDerivativeSpatialFunction.h"
00023 #include "itkGaussianSpatialFunction.h"
00024
00025 namespace itk
00026 {
00027
00037 template <class TInputImage,class TOutput=double>
00038 class ITK_EXPORT GaussianDerivativeImageFunction :
00039 public ImageFunction< TInputImage,
00040 Vector<TOutput,::itk::GetImageDimension<TInputImage>::ImageDimension>,
00041 TOutput >
00042 {
00043 public:
00044
00046 typedef GaussianDerivativeImageFunction Self;
00047
00049 typedef ImageFunction<TInputImage,
00050 Vector<TOutput,::itk::GetImageDimension<TInputImage>::ImageDimension>,
00051 TOutput > Superclass;
00052
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00058 itkNewMacro(Self);
00059
00061 itkTypeMacro( GaussianDerivativeImageFunction, ImageFunction );
00062
00064 typedef TInputImage InputImageType;
00065 typedef typename InputImageType::PixelType InputPixelType;
00066 typedef typename InputImageType::IndexType IndexType;
00067
00069 itkStaticConstMacro(ImageDimension2, unsigned int,
00070 InputImageType::ImageDimension);
00071
00072 typedef ContinuousIndex<TOutput,itkGetStaticConstMacro(ImageDimension2)>
00073 ContinuousIndexType;
00074
00075
00076 typedef Neighborhood<InputPixelType, itkGetStaticConstMacro(ImageDimension2)> NeighborhoodType;
00077 typedef Neighborhood<TOutput, itkGetStaticConstMacro(ImageDimension2)> OperatorNeighborhoodType;
00078
00079 typedef Vector<TOutput,itkGetStaticConstMacro(ImageDimension2)> VectorType;
00080 typedef typename Superclass::OutputType OutputType;
00081 typedef FixedArray<OperatorNeighborhoodType,2*itkGetStaticConstMacro(ImageDimension2)> OperatorArrayType;
00082 typedef NeighborhoodOperatorImageFunction<InputImageType,
00083 TOutput> OperatorImageFunctionType;
00084 typedef typename OperatorImageFunctionType::Pointer OperatorImageFunctionPointer;
00085
00086 typedef GaussianDerivativeSpatialFunction<TOutput,1> GaussianDerivativeFunctionType;
00087 typedef typename GaussianDerivativeFunctionType::Pointer GaussianDerivativeFunctionPointer;
00088
00089 typedef GaussianSpatialFunction<TOutput,1> GaussianFunctionType;
00090 typedef typename GaussianFunctionType::Pointer GaussianFunctionPointer;
00091
00093 typedef Point<TOutput,itkGetStaticConstMacro(ImageDimension2)> PointType;
00094
00096 virtual OutputType Evaluate(const PointType& point) const;
00097
00098
00100 virtual OutputType EvaluateAtIndex( const IndexType & index ) const;
00101
00103 virtual OutputType EvaluateAtContinuousIndex(
00104 const ContinuousIndexType & index ) const;
00105
00112 void SetSigma( const double* sigma);
00113 void SetSigma( const double sigma);
00114 const double* GetSigma() const {return m_Sigma;}
00116
00118 void SetExtent( const double* extent);
00119 void SetExtent( const double extent);
00120 const double* GetExtent() const {return m_Extent;}
00122
00127 virtual void SetInputImage( const InputImageType * ptr );
00128
00129 protected:
00130 GaussianDerivativeImageFunction();
00131 GaussianDerivativeImageFunction( const Self& ){};
00132
00133 ~GaussianDerivativeImageFunction(){};
00134
00135 void operator=( const Self& ){};
00136 void PrintSelf(std::ostream& os, Indent indent) const;
00137
00138 void RecomputeGaussianKernel();
00139 void RecomputeContinuousGaussianKernel(
00140 const double* offset) const;
00141
00142
00143 private:
00144
00145 double m_Sigma[ImageDimension2];
00146
00149 mutable OperatorArrayType m_OperatorArray;
00150 mutable OperatorArrayType m_ContinuousOperatorArray;
00151
00153 OperatorImageFunctionPointer m_OperatorImageFunction;
00154 double m_Extent[ImageDimension2];
00155
00157 bool m_UseImageSpacing;
00158
00160 GaussianDerivativeFunctionPointer m_GaussianDerivativeFunction;
00161 GaussianFunctionPointer m_GaussianFunction;
00162
00163 };
00164
00165 }
00166
00167
00168 #define ITK_TEMPLATE_GaussianDerivativeImageFunction(_, EXPORT, x, y) namespace itk { \
00169 _(2(class EXPORT GaussianDerivativeImageFunction< ITK_TEMPLATE_2 x >)) \
00170 namespace Templates { typedef GaussianDerivativeImageFunction< ITK_TEMPLATE_2 x > \
00171 GaussianDerivativeImageFunction##y; } \
00172 }
00173
00174 #if ITK_TEMPLATE_EXPLICIT
00175 # include "Templates/itkGaussianDerivativeImageFunction+-.h"
00176 #endif
00177
00178 #if ITK_TEMPLATE_TXX
00179 # include "itkGaussianDerivativeImageFunction.txx"
00180 #endif
00181
00182 #endif
00183