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

itkMeanImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMeanImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-05 22:04:06 $
00007   Version:   $Revision: 1.10 $
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 __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:
00050 
00052   typedef MeanImageFunction         Self;
00053   typedef ImageFunction<TInputImage, 
00054     ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00055     TCoordRep >                     Superclass;
00056   typedef SmartPointer<Self>        Pointer;
00057   typedef SmartPointer<const Self>  ConstPointer;
00058 
00060   itkTypeMacro(MeanImageFunction, ImageFunction);
00061 
00063   itkNewMacro(Self);
00064 
00066   typedef TInputImage InputImageType;
00067 
00069   typedef typename Superclass::OutputType OutputType;
00070 
00072   typedef typename Superclass::IndexType IndexType;
00073 
00075   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
00076 
00078   typedef typename Superclass::PointType PointType;
00079 
00081   itkStaticConstMacro(ImageDimension, unsigned int,
00082                       InputImageType::ImageDimension);
00083 
00085   typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
00086       RealType;
00087 
00089   virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00090 
00092   virtual RealType Evaluate( const PointType& point ) const
00093     { 
00094     IndexType index;
00095     this->ConvertPointToNearestIndex( point, index );
00096     return this->EvaluateAtIndex( index ); 
00097     }
00098   virtual RealType EvaluateAtContinuousIndex( 
00099     const ContinuousIndexType& cindex ) const
00100     { 
00101     IndexType index;
00102     this->ConvertContinuousIndexToNearestIndex( cindex, index );
00103     return this->EvaluateAtIndex( index ); 
00104     }
00106 
00109   itkSetMacro( NeighborhoodRadius, unsigned int );
00110   itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00112 
00113 protected:
00114   MeanImageFunction();
00115   ~MeanImageFunction(){};
00116   void PrintSelf(std::ostream& os, Indent indent) const;
00117 
00118 private:
00119   MeanImageFunction( const Self& ); //purposely not implemented
00120   void operator=( const Self& ); //purposely not implemented
00121 
00122   unsigned int m_NeighborhoodRadius;
00123 
00124 };
00125 
00126 } // end namespace itk
00127 
00128 // Define instantiation macro for this template.
00129 #define ITK_TEMPLATE_MeanImageFunction(_, EXPORT, x, y) namespace itk { \
00130   _(2(class EXPORT MeanImageFunction< ITK_TEMPLATE_2 x >)) \
00131   namespace Templates { typedef MeanImageFunction< ITK_TEMPLATE_2 x > \
00132                                                   MeanImageFunction##y; } \
00133   }
00134 
00135 #if ITK_TEMPLATE_EXPLICIT
00136 # include "Templates/itkMeanImageFunction+-.h"
00137 #endif
00138 
00139 #if ITK_TEMPLATE_TXX
00140 # include "itkMeanImageFunction.txx"
00141 #endif
00142 
00143 #endif
00144 

Generated at Thu May 28 10:45:00 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000