ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkGaussianDerivativeOperator.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 __itkGaussianDerivativeOperator_h
19 #define __itkGaussianDerivativeOperator_h
20 
21 #include "itkGaussianOperator.h"
22 #include "itkDerivativeOperator.h"
23 
24 #include <algorithm>
25 
26 namespace itk
27 {
77 template< typename TPixel, unsigned int VDimension = 2,
78  typename TAllocator = NeighborhoodAllocator< TPixel > >
80  public NeighborhoodOperator< TPixel, VDimension, TAllocator >
81 {
82 public:
83 
87 
91 
94 
96  GaussianDerivativeOperator(const Self & other);
97 
99  Self & operator=(const Self & other);
100 
101 
112  itkBooleanMacro(NormalizeAcrossScale);
114 
118  void SetVariance(const double variance) { m_Variance = variance; }
119  double GetVariance() const { return m_Variance; }
121 
123  void SetSpacing(const double spacing) { m_Spacing = spacing; }
124  double GetSpacing() const { return m_Spacing; }
126 
131  void SetMaximumError(const double maxerror)
132  {
133  const double Min = 0.00001;
134  const double Max = 1.0 - Min;
135 
136  m_MaximumError = std::max( Min, std::min( Max, maxerror ) );
137  }
138  double GetMaximumError() { return m_MaximumError; }
139 
144  void SetMaximumKernelWidth(unsigned int n)
145  {
147  }
148 
150  void SetOrder(const unsigned int order) { m_Order = order;}
151  unsigned int GetOrder() const { return m_Order; }
153 
155  virtual void PrintSelf(std::ostream & os, Indent i) const;
156 
157 protected:
158 
160 
163  static double ModifiedBesselI0(double);
164 
167  static double ModifiedBesselI1(double);
168 
171  static double ModifiedBesselI(int, double);
172 
175 
177  void Fill(const CoefficientVector & coeff)
178  { this->FillCenteredDirectional(coeff); }
179 
180 private:
181 
182  /* methods for generations of the coeeficients for a gaussian
183  * operator of 0-order respecting the remaining parameters */
185 
187  const char * GetNameOfClass() const
188  {
189  return "itkGaussianDerivativeOperator";
190  }
191 
194 
196  double m_Variance;
197 
201 
205  unsigned int m_MaximumKernelWidth;
206 
208  unsigned int m_Order;
209 
211  double m_Spacing;
212 };
213 } // namespace itk
214 
215 #ifndef ITK_MANUAL_INSTANTIATION
216 #include "itkGaussianDerivativeOperator.hxx"
217 #endif
218 
219 #endif
static double ModifiedBesselI(int, double)
A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian kernel...
virtual void PrintSelf(std::ostream &os, Indent i) const
CoefficientVector GenerateCoefficients()
void Fill(const CoefficientVector &coeff)
A light-weight container object for storing an N-dimensional neighborhood of values.
CoefficientVector GenerateGaussianCoefficients() const
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
NeighborhoodOperator< TPixel, VDimension, TAllocator > Superclass
std::vector< PixelRealType > CoefficientVector
Virtual class that defines a common interface to all neighborhood operator subtypes.
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel...
GaussianOperator< TPixel, VDimension, TAllocator > GaussianOperatorType
static double ModifiedBesselI1(double)
virtual void FillCenteredDirectional(const CoefficientVector &)
Superclass::CoefficientVector CoefficientVector
DerivativeOperator< TPixel, VDimension, TAllocator > DerivativeOperatorType
static double ModifiedBesselI0(double)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Self & operator=(const Self &other)
void SetOrder(const unsigned int order)