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
00101 protected:
00102 VarianceImageFunction();
00103 ~VarianceImageFunction(){};
00104 void PrintSelf(std::ostream& os, Indent indent) const;
00105
00106 private:
00107 VarianceImageFunction( const Self& );
00108 void operator=( const Self& );
00109
00110 };
00111
00112 }
00113
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115 #include "itkVarianceImageFunction.txx"
00116 #endif
00117
00118 #endif
00119