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:
00048 typedef VarianceImageFunction Self;
00049 typedef ImageFunction<TInputImage, ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00050 TCoordRep > Superclass;
00051 typedef SmartPointer<Self> Pointer;
00052 typedef SmartPointer<const Self> ConstPointer;
00053
00055 itkTypeMacro(VarianceImageFunction, ImageFunction);
00056
00058 itkNewMacro(Self);
00059
00061 typedef TInputImage InputImageType;
00062
00064 typedef typename Superclass::OutputType OutputType;
00065
00067 typedef typename Superclass::IndexType IndexType;
00068
00070 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00071
00073 typedef typename Superclass::PointType PointType;
00074
00076 itkStaticConstMacro(ImageDimension, unsigned int,
00077 InputImageType::ImageDimension);
00078
00080 typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
00081 RealType;
00082
00084 virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00085
00087 virtual RealType Evaluate( const PointType& point ) const
00088 {
00089 IndexType index;
00090 this->ConvertPointToNearestIndex( point, index );
00091 return this->EvaluateAtIndex( index );
00092 }
00093 virtual RealType EvaluateAtContinuousIndex(
00094 const ContinuousIndexType& cindex ) const
00095 {
00096 IndexType index;
00097 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00098 return this->EvaluateAtIndex( index ) ;
00099 }
00100
00103 itkSetMacro( NeighborhoodRadius, unsigned int );
00104 itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00105
00106
00107 protected:
00108 VarianceImageFunction();
00109 ~VarianceImageFunction(){};
00110 void PrintSelf(std::ostream& os, Indent indent) const;
00111
00112 private:
00113 VarianceImageFunction( const Self& );
00114 void operator=( const Self& );
00115
00116 unsigned int m_NeighborhoodRadius;
00117
00118 };
00119
00120 }
00121
00122 #ifndef ITK_MANUAL_INSTANTIATION
00123 #include "itkVarianceImageFunction.txx"
00124 #endif
00125
00126 #endif
00127