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