Go to the documentation of this file.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:
00047
00049 typedef MedianImageFunction Self;
00050 typedef ImageFunction<TInputImage, ITK_TYPENAME TInputImage::PixelType,
00051 TCoordRep > Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00056 itkTypeMacro(MedianImageFunction, ImageFunction);
00057
00059 itkNewMacro(Self);
00060
00062 typedef TInputImage InputImageType;
00063 typedef typename Superclass::InputPixelType InputPixelType;
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 virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
00083
00085 virtual OutputType Evaluate( const PointType& point ) const
00086 {
00087 IndexType index;
00088 this->ConvertPointToNearestIndex( point, index );
00089 return this->EvaluateAtIndex( index );
00090 }
00091 virtual OutputType EvaluateAtContinuousIndex(
00092 const ContinuousIndexType& cindex ) const
00093 {
00094 IndexType index;
00095 this->ConvertContinuousIndexToNearestIndex( cindex, index );
00096 return this->EvaluateAtIndex( index );
00097 }
00099
00100 protected:
00101 MedianImageFunction();
00102 ~MedianImageFunction(){};
00103 void PrintSelf(std::ostream& os, Indent indent) const;
00104
00105 private:
00106 MedianImageFunction( const Self& );
00107 void operator=( const Self& );
00108
00109 };
00110
00111 }
00112
00113
00114 #define ITK_TEMPLATE_MedianImageFunction(_, EXPORT, x, y) namespace itk { \
00115 _(2(class EXPORT MedianImageFunction< ITK_TEMPLATE_2 x >)) \
00116 namespace Templates { typedef MedianImageFunction< ITK_TEMPLATE_2 x > \
00117 MedianImageFunction##y; } \
00118 }
00119
00120 #if ITK_TEMPLATE_EXPLICIT
00121 # include "Templates/itkMedianImageFunction+-.h"
00122 #endif
00123
00124 #if ITK_TEMPLATE_TXX
00125 # include "itkMedianImageFunction.txx"
00126 #endif
00127
00128 #endif
00129