Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMedianImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMedianImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:13 $
00007   Version:   $Revision: 1.5 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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& ); //purposely not implemented
00105   void operator=( const Self& ); //purposely not implemented
00106 
00107 };
00108 
00109 } // namespace itk
00110 
00111 #ifndef ITK_MANUAL_INSTANTIATION
00112 #include "itkMedianImageFunction.txx"
00113 #endif
00114 
00115 #endif
00116 

Generated at Wed Mar 12 01:13:05 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000