ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkDiscreteGradientMagnitudeGaussianImageFunction.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 itkDiscreteGradientMagnitudeGaussianImageFunction_h
19 #define itkDiscreteGradientMagnitudeGaussianImageFunction_h
20 
23 
24 namespace itk
25 {
46 template< typename TInputImage, typename TOutput = double >
48  public ImageFunction< TInputImage, TOutput, TOutput >
49 {
50 public:
51 
54 
57 
61 
63  itkNewMacro(Self);
64 
67 
71  typedef typename Superclass::IndexType IndexType;
74  typedef typename Superclass::PointType PointType;
75 
77  itkStaticConstMacro(ImageDimension2, unsigned int,
78  InputImageType::ImageDimension);
79 
82 
87 
88  typedef itk::GaussianDerivativeOperator< TOutput,
90 
94 
97 
101 
106 
109 
110 public:
111 
113  virtual OutputType Evaluate(const PointType & point) const ITK_OVERRIDE;
114 
116  virtual OutputType EvaluateAtIndex(const IndexType & index) const ITK_OVERRIDE;
117 
120  const ContinuousIndexType & index) const ITK_OVERRIDE;
121 
126  itkSetMacro(Variance, VarianceArrayType);
127  itkGetConstMacro(Variance, const VarianceArrayType);
128  itkSetVectorMacro(Variance, double, VarianceArrayType::Length);
130 
132  virtual void SetVariance(double variance)
133  {
134  m_Variance.Fill(variance);
135  this->Modified();
136  }
138 
141  void SetSigma(const double sigma)
142  {
143  SetVariance(sigma * sigma);
144  }
145 
151  itkSetClampMacro(MaximumError, double, 0.00001, 0.99999);
152  itkGetConstMacro(MaximumError, double);
154 
158  itkSetMacro(NormalizeAcrossScale, bool);
159  itkGetConstMacro(NormalizeAcrossScale, bool);
160  itkBooleanMacro(NormalizeAcrossScale);
162 
164  itkSetMacro(UseImageSpacing, bool);
165  itkGetConstMacro(UseImageSpacing, bool);
166  itkBooleanMacro(UseImageSpacing);
168 
173  itkSetMacro(MaximumKernelWidth, unsigned int);
174  itkGetConstMacro(MaximumKernelWidth, unsigned int);
176 
178  itkSetMacro(InterpolationMode, InterpolationModeType);
179  itkGetConstMacro(InterpolationMode, InterpolationModeType);
181 
186  virtual void SetInputImage(const InputImageType *ptr) ITK_OVERRIDE;
187 
190  virtual void Initialize() { RecomputeGaussianKernel(); }
191 
192 protected:
193 
196 
198 
199  void operator=(const Self &){}
200  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
201 
203 
204  // void RecomputeContinuousGaussianKernel(
205  // const double* offset) const;
206 
207 private:
208 
211 
215 
219  unsigned int m_MaximumKernelWidth;
220 
225 
228 
231 
234 
237 
240 };
241 } // namespace itk
242 
243 #ifndef ITK_MANUAL_INSTANTIATION
244 #include "itkDiscreteGradientMagnitudeGaussianImageFunction.hxx"
245 #endif
246 
247 #endif
void PrintSelf(std::ostream &os, Indent indent) const override
Light weight base class for most itk classes.
Point< TOutput, itkGetStaticConstMacro(ImageDimension) > PointType
virtual OutputType Evaluate(const PointType &point) const override
virtual void SetInputImage(const InputImageType *ptr) override
FixedArray< KernelType, itkGetStaticConstMacro(ImageDimension2) > KernelArrayType
FixedArray< double, itkGetStaticConstMacro(ImageDimension2) > VarianceArrayType
Compute the convolution of a neighborhood operator with the image at a specific location in space...
FixedArray< GaussianDerivativeOperatorType, 2 *itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorArrayType
void Fill(const ValueType &)
A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel...
Compute the discrete gradient magnitude gaussian of an the image at a specific location in space...
virtual void SetVariance(VarianceArrayType _arg)
FixedArray< unsigned int, itkGetStaticConstMacro(ImageDimension2) > OrderArrayType
Neighborhood< TOutput, itkGetStaticConstMacro(ImageDimension2) > KernelType
virtual OutputType EvaluateAtIndex(const IndexType &index) const override
virtual void Modified() const
ContinuousIndex< TOutput, itkGetStaticConstMacro(ImageDimension) > ContinuousIndexType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &index) const override
itk::GaussianDerivativeOperator< TOutput, itkGetStaticConstMacro(ImageDimension2) > GaussianDerivativeOperatorType
Evaluates a function of an image at specified position.
NeighborhoodOperatorImageFunction< InputImageType, TOutput > OperatorImageFunctionType