00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _itkMeanImageFunction_h
00018 #define _itkMeanImageFunction_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 MeanImageFunction :
00043 public ImageFunction< TInputImage,
00044 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00045 TCoordRep >
00046 {
00047 public:
00049 typedef MeanImageFunction Self;
00050 typedef ImageFunction<TInputImage,
00051 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00052 TCoordRep > Superclass;
00053 typedef SmartPointer<Self> Pointer;
00054 typedef SmartPointer<const Self> ConstPointer;
00055
00057 itkTypeMacro(MeanImageFunction, ImageFunction);
00058
00060 itkNewMacro(Self);
00061
00063 typedef TInputImage InputImageType;
00064
00066 typedef typename Superclass::OutputType OutputType;
00067
00069 typedef typename Superclass::IndexType IndexType;
00070
00072 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00073
00075 typedef typename Superclass::PointType PointType;
00076
00078 itkStaticConstMacro(ImageDimension, unsigned int,
00079 InputImageType::ImageDimension);
00080
00082 typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
00083 RealType;
00084
00086 virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00087
00089 virtual RealType Evaluate( const PointType& point ) const
00090 {
00091 IndexType index;
00092 this->ConvertPointToNearestIndex( point, index );
00093 return this->EvaluateAtIndex( index );
00094 }
00095 virtual RealType EvaluateAtContinuousIndex(
00096 const ContinuousIndexType& cindex ) const
00097 {
00098 IndexType index;
00099 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00100 return this->EvaluateAtIndex( index ) ;
00101 }
00102
00105 itkSetMacro( NeighborhoodRadius, unsigned int );
00106 itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00107
00108 protected:
00109 MeanImageFunction();
00110 ~MeanImageFunction(){};
00111 void PrintSelf(std::ostream& os, Indent indent) const;
00112
00113 private:
00114 MeanImageFunction( const Self& );
00115 void operator=( const Self& );
00116
00117 unsigned int m_NeighborhoodRadius;
00118
00119 };
00120
00121 }
00122
00123 #ifndef ITK_MANUAL_INSTANTIATION
00124 #include "itkMeanImageFunction.txx"
00125 #endif
00126
00127 #endif
00128