itkCovarianceImageFunction.h
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 __itkCovarianceImageFunction_h
00018 #define __itkCovarianceImageFunction_h
00019
00020 #include "itkImageFunction.h"
00021 #include "itkNumericTraits.h"
00022
00023 namespace itk
00024 {
00025
00043 template <class TInputImage, class TCoordRep = float >
00044 class ITK_EXPORT CovarianceImageFunction :
00045 public ImageFunction< TInputImage,
00046 vnl_matrix<
00047 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType::ValueType>::RealType >,
00048 TCoordRep >
00049 {
00050 public:
00051
00053 typedef CovarianceImageFunction Self;
00054 typedef ImageFunction<TInputImage,
00055 vnl_matrix<
00056 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType::ValueType>::RealType >,
00057 TCoordRep > Superclass;
00058 typedef SmartPointer<Self> Pointer;
00059 typedef SmartPointer<const Self> ConstPointer;
00060
00062 itkTypeMacro(CovarianceImageFunction, ImageFunction);
00063
00065 itkNewMacro(Self);
00066
00068 typedef TInputImage InputImageType;
00069
00071 typedef typename Superclass::OutputType OutputType;
00072
00074 typedef typename Superclass::IndexType IndexType;
00075
00077 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00078
00080 typedef typename Superclass::PointType PointType;
00081
00083 itkStaticConstMacro(ImageDimension, unsigned int,
00084 InputImageType::ImageDimension);
00085
00087 typedef vnl_matrix<
00088 typename NumericTraits<typename InputImageType::PixelType::ValueType>::RealType >
00089 RealType;
00090
00092 virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00093
00095 virtual RealType Evaluate( const PointType& point ) const
00096 {
00097 IndexType index;
00098 this->ConvertPointToNearestIndex( point, index );
00099 return this->EvaluateAtIndex( index );
00100 }
00101 virtual RealType EvaluateAtContinuousIndex(
00102 const ContinuousIndexType& cindex ) const
00103 {
00104 IndexType index;
00105 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00106 return this->EvaluateAtIndex( index );
00107 }
00109
00112 itkSetMacro( NeighborhoodRadius, unsigned int );
00113 itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00115
00116 protected:
00117 CovarianceImageFunction();
00118 ~CovarianceImageFunction(){};
00119 void PrintSelf(std::ostream& os, Indent indent) const;
00120
00121 private:
00122 CovarianceImageFunction( const Self& );
00123 void operator=( const Self& );
00124
00125 unsigned int m_NeighborhoodRadius;
00126
00127 };
00128
00129 }
00130
00131
00132 #define ITK_TEMPLATE_CovarianceImageFunction(_, EXPORT, x, y) namespace itk { \
00133 _(2(class EXPORT CovarianceImageFunction< ITK_TEMPLATE_2 x >)) \
00134 namespace Templates { typedef CovarianceImageFunction< ITK_TEMPLATE_2 x > \
00135 CovarianceImageFunction##y; } \
00136 }
00137
00138 #if ITK_TEMPLATE_EXPLICIT
00139 # include "Templates/itkCovarianceImageFunction+-.h"
00140 #endif
00141
00142 #if ITK_TEMPLATE_TXX
00143 # include "itkCovarianceImageFunction.txx"
00144 #endif
00145
00146 #endif
00147