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/09/11 19:57:13 $
00007   Version:   $Revision: 1.4 $
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   
00103 protected:
00104   MeanImageFunction();
00105   ~MeanImageFunction(){};
00106   void PrintSelf(std::ostream& os, Indent indent) const;
00107 
00108 private:
00109   MeanImageFunction( const Self& ); //purposely not implemented
00110   void operator=( const Self& ); //purposely not implemented
00111 
00112 };
00113 
00114 } // namespace itk
00115 
00116 #ifndef ITK_MANUAL_INSTANTIATION
00117 #include "itkMeanImageFunction.txx"
00118 #endif
00119 
00120 #endif
00121 

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