KWStyle - itkVarianceImageFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkVarianceImageFunction.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:49 $
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 _itkVarianceImageFunction_h
18 DEF #define _itkVarianceImageFunction_h
19
20 #include "itkImageFunction.h"
21 #include "itkNumericTraits.h"
22
23 namespace itk
24 {
25
26 /**
27  * \class VarianceImageFunction
28  * \brief Calculate the variance in the neighborhood of a pixel
29  *
30  * Calculate the variance 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  * \ingroup ImageFunctions
40  */
41 template <class TInputImage, class TCoordRep = float >
42 class ITK_EXPORT VarianceImageFunction :
43 LEN,IND **public ImageFunction< TInputImage, ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
44 IND ****TCoordRep >
45 {
46 public:
47   /** Standard class typedefs. */
48   typedef VarianceImageFunction Self;
49 LEN   typedef ImageFunction<TInputImage, ITK_TYPENAME NumericTraits<typename TInputImage::PixelType>::RealType,
50 TDA,IND ****TCoordRep > Superclass;
51 TDA   typedef SmartPointer<Self> Pointer;
52 TDA   typedef SmartPointer<const Self>  ConstPointer;
53   
54   /** Run-time type information (and related methods). */
55   itkTypeMacro(VarianceImageFunction, ImageFunction);
56
57   /** Method for creation through the object factory. */
58   itkNewMacro(Self);
59
60   /** InputImageType typedef support. */
61   typedef TInputImage InputImageType;
62
63   /** OutputType typdef support. */
64   typedef typename Superclass::OutputType OutputType;
65
66   /** Index typedef support. */
67   typedef typename Superclass::IndexType IndexType;
68   
69   /** ContinuousIndex typedef support. */
70   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
71
72   /** Point typedef support. */
73   typedef typename Superclass::PointType PointType;
74
75   /** Dimension of the underlying image. */
76   itkStaticConstMacro(ImageDimension, unsigned int,
77                       InputImageType::ImageDimension);
78
79   /** Datatype used for the variance */
80   typedef typename NumericTraits<typename InputImageType::PixelType>::RealType
81 IND ******RealType;
82
83   /** Evalulate the function at specified index */
84   virtual RealType EvaluateAtIndex( const IndexType& index ) const;
85   
86   /** Evaluate the function at non-integer positions */
87   virtual RealType Evaluate( const PointType& point ) const
88     { 
89 IND ******IndexType index;
90 IND ******this->ConvertPointToNearestIndex( point, index );
91 IND ******return this->EvaluateAtIndex( index ); 
92     }
93   virtual RealType EvaluateAtContinuousIndex( 
94     const ContinuousIndexType& cindex ) const
95     { 
96 IND ******IndexType index;
97 IND ******this->ConvertContinuousIndexToNearestIndex( cindex, index );
98 SEM,IND ******return this->EvaluateAtIndex( index ) ; 
99     }
100
101   /** Get/Set the radius of the neighborhood over which the
102 IND ******statistics are evaluated */
103   itkSetMacro( NeighborhoodRadius, unsigned int );
104   itkGetConstReferenceMacro( NeighborhoodRadius, unsigned int );
105
106  
107 protected:
108   VarianceImageFunction();
109   ~VarianceImageFunction(){};
110   void PrintSelf(std::ostream& os, Indent indent) const;
111
112 private:
113   VarianceImageFunction( const Self& ); //purposely not implemented
114   void operator=( const Self& ); //purposely not implemented
115
116   unsigned int m_NeighborhoodRadius;
117
118 };
119
120 // namespace itk
121
122 #ifndef ITK_MANUAL_INSTANTIATION
123 #include "itkVarianceImageFunction.txx"
124 #endif
125
126 #endif
127
128 EOF

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