00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef _itkMedianImageFunction_h
00018
#define _itkMedianImageFunction_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 MedianImageFunction :
00043
public ImageFunction< TInputImage, ITK_TYPENAME TInputImage::PixelType,
00044 TCoordRep >
00045 {
00046
public:
00048
typedef MedianImageFunction
Self;
00049 typedef ImageFunction<TInputImage,
ITK_TYPENAME TInputImage::PixelType,
00050 TCoordRep >
Superclass;
00051 typedef SmartPointer<Self> Pointer;
00052 typedef SmartPointer<const Self> ConstPointer;
00053
00055
itkTypeMacro(MedianImageFunction,
ImageFunction);
00056
00058
itkNewMacro(
Self);
00059
00061
typedef TInputImage
InputImageType;
00062 typedef typename Superclass::InputPixelType
InputPixelType;
00063
00065
typedef typename Superclass::OutputType
OutputType;
00066
00068
typedef typename Superclass::IndexType
IndexType;
00069
00071
typedef typename Superclass::ContinuousIndexType
ContinuousIndexType;
00072
00074
typedef typename Superclass::PointType
PointType;
00075
00077
itkStaticConstMacro(ImageDimension,
unsigned int,
00078 InputImageType::ImageDimension);
00079
00081
virtual OutputType EvaluateAtIndex(
const IndexType& index )
const;
00082
00084
virtual OutputType Evaluate(
const PointType& point )
const
00085 {
00086
IndexType index;
00087 this->ConvertPointToNearestIndex( point, index );
00088
return this->EvaluateAtIndex( index );
00089 }
00090
virtual OutputType EvaluateAtContinuousIndex(
00091 const ContinuousIndexType& cindex )
const
00092
{
00093
IndexType index;
00094 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00095
return this->EvaluateAtIndex( index ) ;
00096 }
00097
00098
protected:
00099 MedianImageFunction();
00100 ~MedianImageFunction(){};
00101
void PrintSelf(std::ostream& os, Indent indent)
const;
00102
00103
private:
00104 MedianImageFunction(
const Self& );
00105
void operator=(
const Self& );
00106
00107 };
00108
00109 }
00110
00111
#ifndef ITK_MANUAL_INSTANTIATION
00112
#include "itkMedianImageFunction.txx"
00113
#endif
00114
00115
#endif
00116