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
00043
template <
class TInputImage,
class TCoordRep =
float >
00044 class ITK_EXPORT MeanImageFunction :
00045
public ImageFunction< TInputImage,
00046 ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00047 TCoordRep >
00048 {
00049
public:
00051
typedef MeanImageFunction
Self;
00052 typedef ImageFunction<TInputImage,
00053
ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00054 TCoordRep >
Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057
00059
itkTypeMacro(MeanImageFunction,
ImageFunction);
00060
00062
itkNewMacro(
Self);
00063
00065
typedef TInputImage
InputImageType;
00066
00068
typedef typename Superclass::OutputType
OutputType;
00069
00071
typedef typename Superclass::IndexType
IndexType;
00072
00074
typedef typename Superclass::ContinuousIndexType
ContinuousIndexType;
00075
00077
typedef typename Superclass::PointType
PointType;
00078
00080
itkStaticConstMacro(ImageDimension,
unsigned int,
00081 InputImageType::ImageDimension);
00082
00084
typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
00085
RealType;
00086
00088
virtual RealType EvaluateAtIndex(
const IndexType& index )
const;
00089
00091
virtual RealType Evaluate(
const PointType& point )
const
00092 {
00093
IndexType index;
00094 this->ConvertPointToNearestIndex( point, index );
00095
return this->EvaluateAtIndex( index );
00096 }
00097
virtual RealType EvaluateAtContinuousIndex(
00098 const ContinuousIndexType& cindex )
const
00099
{
00100
IndexType index;
00101 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00102
return this->EvaluateAtIndex( index ) ;
00103 }
00104
00107
itkSetMacro( NeighborhoodRadius,
unsigned int );
00108
itkGetConstReferenceMacro( NeighborhoodRadius,
unsigned int );
00109
00110
protected:
00111 MeanImageFunction();
00112 ~MeanImageFunction(){};
00113
void PrintSelf(std::ostream& os, Indent indent)
const;
00114
00115 private:
00116 MeanImageFunction(
const Self& );
00117
void operator=(
const Self& );
00118
00119
unsigned int m_NeighborhoodRadius;
00120
00121 };
00122
00123 }
00124
00125
#ifndef ITK_MANUAL_INSTANTIATION
00126
#include "itkMeanImageFunction.txx"
00127
#endif
00128
00129
#endif
00130