ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkGaussianBlurImageFunction.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 __itkGaussianBlurImageFunction_h
19 #define __itkGaussianBlurImageFunction_h
20 
22 #include "itkGaussianOperator.h"
24 
25 namespace itk
26 {
42 template< class TInputImage, class TOutput = double >
43 class ITK_EXPORT GaussianBlurImageFunction:
44  public ImageFunction< TInputImage, TOutput >
45 {
46 public:
47 
50 
53 
57 
59  itkNewMacro(Self);
60 
63 
65  typedef TInputImage InputImageType;
66  typedef typename InputImageType::PixelType InputPixelType;
67  typedef typename Superclass::IndexType IndexType;
68  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
69 
71  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
72 
73  typedef GaussianOperator<
74  TOutput, itkGetStaticConstMacro(ImageDimension) > GaussianOperatorType;
77 
81  typedef itk::Image<
82  InputPixelRealType, itkGetStaticConstMacro(ImageDimension) > InternalImageType;
84 
87 
90 
94 
96  typedef typename Superclass::PointType PointType;
97 
99  virtual TOutput Evaluate(const PointType & point) const;
100 
102  virtual TOutput EvaluateAtIndex(const IndexType & index) const;
103 
105  virtual TOutput EvaluateAtContinuousIndex(
106  const ContinuousIndexType & index) const;
107 
114  void SetSigma(const double *sigma);
115 
116  void SetSigma(const float *sigma);
117 
118  void SetSigma(const double sigma);
119 
120  itkSetMacro(Sigma, SigmaArrayType);
121  itkGetConstReferenceMacro(Sigma, SigmaArrayType);
122 
127  virtual void SetInputImage(const InputImageType *ptr);
128 
132  itkSetMacro(Extent, ExtentArrayType);
133  itkGetConstReferenceMacro(Extent, ExtentArrayType);
134  void SetExtent(const double *extent);
136 
137  void SetExtent(const double extent);
138 
142  itkSetMacro(MaximumError, ErrorArrayType);
143  itkGetConstReferenceMacro(MaximumError, ErrorArrayType);
145 
150  itkSetMacro(MaximumKernelWidth, int);
151  itkGetConstMacro(MaximumKernelWidth, int);
153 
159  itkSetMacro(UseImageSpacing, bool);
160  itkGetConstMacro(UseImageSpacing, bool);
161  itkBooleanMacro(UseImageSpacing);
163 
164 protected:
167 
169 
170  void operator=(const Self &);
171 
172  void PrintSelf(std::ostream & os, Indent indent) const;
173 
174  void RecomputeGaussianKernel();
175 
176  void RecomputeContinuousGaussianKernel(const double *offset) const;
177 
178 private:
179 
180  virtual TOutput EvaluateAtIndex(
181  const IndexType & index, const OperatorArrayType & operatorArray) const;
182 
189 
195 
199 
202 
205 
208 };
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkGaussianBlurImageFunction.hxx"
213 #endif
214 
215 #endif
216