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: 2009-02-05 22:04:06 $
00007   Version:   $Revision: 1.9 $
00008 
00009   Copyright (c) Insight Software 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:
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& ); //purposely not implemented
00107   void operator=( const Self& ); //purposely not implemented
00108 
00109 };
00110 
00111 } // end namespace itk
00112 
00113 // Define instantiation macro for this template.
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 

Generated at Mon Jul 12 2010 19:08:11 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000