KWStyle - itkMeanImageFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkMeanImageFunction.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:41 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17 DEF #ifndef _itkMeanImageFunction_h
18 DEF #define _itkMeanImageFunction_h
19
20 #include "itkImageFunction.h"
21 #include "itkNumericTraits.h"
22
23 namespace itk
24 {
25
26 /**
27  * \class MeanImageFunction
28  * \brief Calculate the mean value in the neighborhood of a pixel
29  *
30  * Calculate the mean pixel value over the standard 8, 26, etc. connected
31  * neighborhood.  This calculation uses a ZeroFluxNeumannBoundaryCondition.
32  *
33  * If called with a ContinuousIndex or Point, the calculation is performed
34  * at the nearest neighbor.
35  *
36  * This class is templated over the input image type and the
37  * coordinate representation type (e.g. float or double).
38  *
39  * \sa VectorMeanImageFunction
40  * 
41  * \ingroup ImageFunctions
42  */
43 template <class TInputImage, class TCoordRep = float >
44 class ITK_EXPORT MeanImageFunction :
45 IND **public ImageFunction< TInputImage, 
46     ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
47 IND ****TCoordRep >
48 {
49 public:
50   /** Standard class typedefs. */
51   typedef MeanImageFunction Self;
52   typedef ImageFunction<TInputImage, 
53     ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
54 TDA,IND ****TCoordRep > Superclass;
55 TDA   typedef SmartPointer<Self> Pointer;
56 TDA   typedef SmartPointer<const Self>  ConstPointer;
57   
58   /** Run-time type information (and related methods). */
59   itkTypeMacro(MeanImageFunction, ImageFunction);
60
61   /** Method for creation through the object factory. */
62   itkNewMacro(Self);
63
64   /** InputImageType typedef support. */
65   typedef TInputImage InputImageType;
66
67   /** OutputType typdef support. */
68   typedef typename Superclass::OutputType OutputType;
69
70   /** Index typedef support. */
71   typedef typename Superclass::IndexType IndexType;
72   
73   /** ContinuousIndex typedef support. */
74   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
75
76   /** Point typedef support. */
77   typedef typename Superclass::PointType PointType;
78
79   /** Dimension of the underlying image. */
80   itkStaticConstMacro(ImageDimension, unsigned int,
81                       InputImageType::ImageDimension);
82
83   /** Datatype used for the mean */
84   typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
85 IND ******RealType;
86
87   /** Evalulate the function at specified index */
88   virtual RealType EvaluateAtIndex( const IndexType& index ) const;
89   
90   /** Evaluate the function at non-integer positions */
91   virtual RealType Evaluate( const PointType& point ) const
92     { 
93 IND ******IndexType index;
94 IND ******this->ConvertPointToNearestIndex( point, index );
95 IND ******return this->EvaluateAtIndex( index ); 
96     }
97   virtual RealType EvaluateAtContinuousIndex( 
98     const ContinuousIndexType& cindex ) const
99     { 
100 IND ******IndexType index;
101 IND ******this->ConvertContinuousIndexToNearestIndex( cindex, index );
102 SEM,IND ******return this->EvaluateAtIndex( index ) ; 
103     }
104   
105   /** Get/Set the radius of the neighborhood over which the
106 IND ******statistics are evaluated */
107   itkSetMacro( NeighborhoodRadius, unsigned int );
108   itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
109
110 protected:
111   MeanImageFunction();
112   ~MeanImageFunction(){};
113   void PrintSelf(std::ostream& os, Indent indent) const;
114
115 private:
116   MeanImageFunction( const Self& ); //purposely not implemented
117   void operator=( const Self& ); //purposely not implemented
118
119   unsigned int m_NeighborhoodRadius;
120
121 };
122
123 // namespace itk
124
125 #ifndef ITK_MANUAL_INSTANTIATION
126 #include "itkMeanImageFunction.txx"
127 #endif
128
129 #endif
130
131 EOF

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:21PM
© Kitware Inc.