KWStyle - itkGaussianSpatialFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkGaussianSpatialFunction.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:36 $
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 #ifndef __itkGaussianSpatialFunction_h
18 #define __itkGaussianSpatialFunction_h
19
20 #include "itkSpatialFunction.h"
21 #include "itkFixedArray.h"
22 #include "itkPoint.h"
23
24 namespace itk
25 {
26
27 /** \class GaussianSpatialFunction
28  * \brief N-dimensional gaussian spatial function class
29  *
30  * GaussianSpatialFunction implements a standard gaussian curve in N-d.
31  * m_Normalized determines whether or not the Gaussian is normalized
32  * (whether or not the sum over infinite space is 1.0)
33  *
34  * m_Scale scales the output of the Gaussian to span a range
35  * larger than 0->1, and is often set to the maximum value
36  * of the output data type (for instance, 255 for uchars)
37  *
38  * \ingroup SpatialFunctions
39  */
40 template <typename TOutput=double, 
41           unsigned int VImageDimension=3,
42           typename TInput=Point<double, VImageDimension> >
43 LEN class ITK_EXPORT GaussianSpatialFunction : public SpatialFunction<TOutput, VImageDimension, TInput>
44 {
45 public:
46   /** Standard class typedefs. */
47   typedef GaussianSpatialFunction Self;
48 TDA   typedef SpatialFunction<TOutput, VImageDimension, TInput> Superclass;
49 TDA   typedef SmartPointer<Self>  Pointer;
50 TDA   typedef SmartPointer<const Self>  ConstPointer;
51   
52   /** Method for creation through the object factory. */
53   itkNewMacro(Self);
54
55   /** Run-time type information (and related methods). */
56   itkTypeMacro(GaussianSpatialFunction, SpatialFunction);
57
58   /** Input type for the function. */
59   typedef typename Superclass::InputType InputType;
60
61   /** Output type for the function. */
62   typedef typename Superclass::OutputType OutputType;
63
64   /** Type used to store gaussian parameters. */
65   typedef FixedArray<double, VImageDimension> ArrayType;
66
67   /** Evaluate the function at a given position. */
68   OutputType Evaluate(const TInput& position) const;
69
70   /** Gets and sets for gaussian parameters */
71   itkSetMacro(Scale, double);
72   itkGetMacro(Scale, double);
73   itkSetMacro(Normalized, bool);
74   itkGetMacro(Normalized, bool);
75   itkSetMacro(Sigma, ArrayType);
76   itkGetMacro(Sigma, ArrayType);
77   itkSetMacro(Mean, ArrayType);
78   itkGetMacro(Mean, ArrayType);
79
80 protected:
81   GaussianSpatialFunction();
82   virtual ~GaussianSpatialFunction();
83   void PrintSelf(std::ostream& os, Indent indent) const;
84
85 private:
86   GaussianSpatialFunction(const Self&); //purposely not implemented
87   void operator=(const Self&); //purposely not implemented
88
89   /** The standard deviation in each direction. */
90   ArrayType m_Sigma;
91
92   /** The mean in each direction. */
93   ArrayType m_Mean;
94
95   /** A scale factor multiplied by the true value of the Gaussian. */
96   double m_Scale;
97
98   /** Whether or not to normalize the Gaussian. */
99   bool m_Normalized;
100
101 };
102
103 // end namespace itk
104
105 #ifndef ITK_MANUAL_INSTANTIATION
106 #include "itkGaussianSpatialFunction.txx"
107 #endif
108
109 #endif
110

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