KWStyle - itkScatterMatrixImageFunction.h
 
Matrix View
Description

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

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