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

itkVarianceImageFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVarianceImageFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007-01-30 20:56:09 $
00007   Version:   $Revision: 1.8 $
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 __itkVarianceImageFunction_h
00018 #define __itkVarianceImageFunction_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 VarianceImageFunction :
00043   public ImageFunction< TInputImage, ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00044     TCoordRep >
00045 {
00046 public:
00047 
00049   typedef VarianceImageFunction Self;
00050   typedef ImageFunction<TInputImage, ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
00051     TCoordRep > Superclass;
00052   typedef SmartPointer<Self> Pointer;
00053   typedef SmartPointer<const Self>  ConstPointer;
00054 
00056   itkTypeMacro(VarianceImageFunction, ImageFunction);
00057 
00059   itkNewMacro(Self);
00060 
00062   typedef TInputImage InputImageType;
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   typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
00082       RealType;
00083 
00085   virtual RealType EvaluateAtIndex( const IndexType& index ) const;
00086 
00088   virtual RealType Evaluate( const PointType& point ) const
00089     { 
00090       IndexType index;
00091       this->ConvertPointToNearestIndex( point, index );
00092       return this->EvaluateAtIndex( index ); 
00093     }
00094   virtual RealType EvaluateAtContinuousIndex( 
00095     const ContinuousIndexType& cindex ) const
00096     { 
00097       IndexType index;
00098       this->ConvertContinuousIndexToNearestIndex( cindex, index );
00099       return this->EvaluateAtIndex( index ) ; 
00100     }
00102 
00105   itkSetMacro( NeighborhoodRadius, unsigned int );
00106   itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
00108 
00109  
00110 protected:
00111   VarianceImageFunction();
00112   ~VarianceImageFunction(){};
00113   void PrintSelf(std::ostream& os, Indent indent) const;
00114 
00115 private:
00116   VarianceImageFunction( const Self& ); //purposely not implemented
00117   void operator=( const Self& ); //purposely not implemented
00118 
00119   unsigned int m_NeighborhoodRadius;
00120 
00121 };
00122 
00123 } // end namespace itk
00124 
00125 // Define instantiation macro for this template.
00126 #define ITK_TEMPLATE_VarianceImageFunction(_, EXPORT, x, y) namespace itk { \
00127   _(2(class EXPORT VarianceImageFunction< ITK_TEMPLATE_2 x >)) \
00128   namespace Templates { typedef VarianceImageFunction< ITK_TEMPLATE_2 x > \
00129                                                   VarianceImageFunction##y; } \
00130   }
00131 
00132 #if ITK_TEMPLATE_EXPLICIT
00133 # include "Templates/itkVarianceImageFunction+-.h"
00134 #endif
00135 
00136 #if ITK_TEMPLATE_TXX
00137 # include "itkVarianceImageFunction.txx"
00138 #endif
00139 
00140 #endif
00141 
00142 

Generated at Sat Feb 28 13:43:38 2009 for ITK by doxygen 1.5.6 written by Dimitri van Heesch, © 1997-2000