KWStyle - itkMedianImageFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkMedianImageFunction.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 _itkMedianImageFunction_h
18 DEF #define _itkMedianImageFunction_h
19
20 #include "itkImageFunction.h"
21 #include "itkNumericTraits.h"
22
23 namespace itk
24 {
25
26 /**
27  * \class MedianImageFunction
28  * \brief Calculate the median value in the neighborhood of a pixel
29  *
30  * Calculate the median 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 MedianImageFunction :
43 IND **public ImageFunction< TInputImage, ITK_TYPENAME TInputImage::PixelType,
44     TCoordRep >
45 {
46 public:
47   /** Standard class typedefs. */
48   typedef MedianImageFunction Self;
49   typedef ImageFunction<TInputImage, ITK_TYPENAME TInputImage::PixelType,
50 TDA     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(MedianImageFunction, ImageFunction);
56
57   /** Method for creation through the object factory. */
58   itkNewMacro(Self);
59
60   /** InputImageType typedef support. */
61   typedef TInputImage InputImageType;
62 TDA   typedef typename Superclass::InputPixelType InputPixelType;
63
64   /** OutputType typedef support. */
65   typedef typename Superclass::OutputType OutputType;
66
67   /** Index typedef support. */
68   typedef typename Superclass::IndexType IndexType;
69   
70   /** ContinuousIndex typedef support. */
71   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
72
73   /** Point typedef support. */
74   typedef typename Superclass::PointType PointType;
75
76   /** Dimension of the underlying image. */
77   itkStaticConstMacro(ImageDimension, unsigned int,
78                       InputImageType::ImageDimension);
79
80   /** Evalulate the function at specified index */
81   virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
82   
83   /** Evaluate the function at non-integer positions */
84   virtual OutputType Evaluate( const PointType& point ) const
85     { 
86 IND ******IndexType index;
87 IND ******this->ConvertPointToNearestIndex( point, index );
88 IND ******return this->EvaluateAtIndex( index ); 
89     }
90   virtual OutputType EvaluateAtContinuousIndex( 
91     const ContinuousIndexType& cindex ) const
92     { 
93 IND ******IndexType index;
94 IND ******this->ConvertContinuousIndexToNearestIndex( cindex, index );
95 SEM,IND ******return this->EvaluateAtIndex( index ) ; 
96     }
97   
98 protected:
99   MedianImageFunction();
100   ~MedianImageFunction(){};
101   void PrintSelf(std::ostream& os, Indent indent) const;
102
103 private:
104   MedianImageFunction( const Self& ); //purposely not implemented
105   void operator=( const Self& ); //purposely not implemented
106
107 };
108
109 // namespace itk
110
111 #ifndef ITK_MANUAL_INSTANTIATION
112 #include "itkMedianImageFunction.txx"
113 #endif
114
115 #endif
116
117 EOF

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