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