Orfeo Toolbox  4.0
itkGaussianOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkGaussianOperator_h
19 #define __itkGaussianOperator_h
20 
22 #include <cmath>
23 namespace itk
24 {
65 template< typename TPixel, unsigned int VDimension = 2,
66  typename TAllocator = NeighborhoodAllocator< TPixel > >
68  public NeighborhoodOperator< TPixel, VDimension, TAllocator >
69 {
70 public:
74 
77 
79  GaussianOperator(const Self & other):
80  NeighborhoodOperator< TPixel, VDimension, TAllocator >(other)
81  {
82  m_Variance = other.m_Variance;
85  }
86 
88  Self & operator=(const Self & other)
89  {
90  if(this != &other)
91  {
92  Superclass::operator=(other);
93  m_Variance = other.m_Variance;
96  }
97  return *this;
98  }
99 
101  void SetVariance(const double & variance)
102  {
103  m_Variance = variance;
104  }
105 
110  void SetMaximumError(const double & max_error)
111  {
112  if ( max_error >= 1 || max_error <= 0 )
113  {
114  itkExceptionMacro("Maximum Error Must be in the range [ 0.0 , 1.0 ]");
115  }
116 
117  m_MaximumError = max_error;
118  }
119 
121  double GetVariance()
122  { return m_Variance; }
123 
129  { return m_MaximumError; }
130 
135  void SetMaximumKernelWidth(unsigned int n)
136  { m_MaximumKernelWidth = n; }
137 
139  unsigned int GetMaximumKernelWidth() const
140  { return m_MaximumKernelWidth; }
141 
143  virtual void PrintSelf(std::ostream & os, Indent i) const
144  {
145  os << i << "GaussianOperator { this=" << this
146  << ", m_Variance = " << m_Variance
147  << ", m_MaximumError = " << m_MaximumError
148  << "} " << std::endl;
150  }
151 
152 protected:
154 
155 public:
158  double ModifiedBesselI0(double);
159 
162  double ModifiedBesselI1(double);
163 
166  double ModifiedBesselI(int, double);
167 
168 protected:
171 
173  void Fill(const CoefficientVector & coeff)
174  { this->FillCenteredDirectional(coeff); }
175 
176 private:
178  double m_Variance;
179 
183 
187  unsigned int m_MaximumKernelWidth;
188 
190  const char * GetNameOfClass()
191  { return "itkGaussianOperator"; }
192 };
193 } // namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkGaussianOperator.hxx"
197 #endif
198 
199 #endif

Generated at Sat Mar 8 2014 14:40:37 for Orfeo Toolbox with doxygen 1.8.3.1