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: 2002/11/14 19:19:25 $
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 _itkMeanImageFunction_h
00018 #define _itkMeanImageFunction_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 MeanImageFunction :
00043   public ImageFunction< TInputImage, 
00044     ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00045     TCoordRep >
00046 {
00047 public:
00049   typedef MeanImageFunction Self;
00050   typedef ImageFunction<TInputImage, 
00051     ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00052     TCoordRep > Superclass;
00053   typedef SmartPointer<Self> Pointer;
00054   typedef SmartPointer<const Self>  ConstPointer;
00055   
00057   itkTypeMacro(MeanImageFunction, ImageFunction);
00058 
00060   itkNewMacro(Self);
00061 
00063   typedef TInputImage InputImageType;
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   typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
00083       RealType;
00084 
00086   virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00087   
00089   virtual RealType Evaluate( const PointType& point ) const
00090     { 
00091       IndexType index;
00092       this->ConvertPointToNearestIndex( point, index );
00093       return this->EvaluateAtIndex( index ); 
00094     }
00095   virtual RealType EvaluateAtContinuousIndex( 
00096     const ContinuousIndexType& cindex ) const
00097     { 
00098       IndexType index;
00099       this->ConvertContinuousIndexToNearestIndex( cindex, index );
00100       return this->EvaluateAtIndex( index ) ; 
00101     }
00102   
00105   itkSetMacro( NeighborhoodRadius, unsigned int );
00106   itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00107 
00108 protected:
00109   MeanImageFunction();
00110   ~MeanImageFunction(){};
00111   void PrintSelf(std::ostream& os, Indent indent) const;
00112 
00113 private:
00114   MeanImageFunction( const Self& ); //purposely not implemented
00115   void operator=( const Self& ); //purposely not implemented
00116 
00117   unsigned int m_NeighborhoodRadius;
00118 
00119 };
00120 
00121 } // namespace itk
00122 
00123 #ifndef ITK_MANUAL_INSTANTIATION
00124 #include "itkMeanImageFunction.txx"
00125 #endif
00126 
00127 #endif
00128 

Generated at Fri May 21 01:15:02 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000