ITK  4.2.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);
162 protected:
166 
168 
169  void operator=(const Self &);
170 
171  void PrintSelf(std::ostream & os, Indent indent) const;
172 
173  void RecomputeGaussianKernel();
174 
175  void RecomputeContinuousGaussianKernel(const double *offset) const;
176 
177 private:
178 
179  virtual TOutput EvaluateAtIndex(
180  const IndexType & index, const OperatorArrayType & operatorArray) const;
181 
188 
194 
198 
201 
204 
207 };
208 } // end namespace itk
209 
210 // Define instantiation macro for this template.
211 #define ITK_TEMPLATE_GaussianBlurImageFunction(_, EXPORT, TypeX, TypeY) \
212  namespace itk \
213  { \
214  _( 2 ( class EXPORT GaussianBlurImageFunction< ITK_TEMPLATE_2 TypeX > ) ) \
215  namespace Templates \
216  { \
217  typedef GaussianBlurImageFunction< ITK_TEMPLATE_2 TypeX > \
218  GaussianBlurImageFunction##TypeY; \
219  } \
220  }
221 
222 #if ITK_TEMPLATE_EXPLICIT
223 #include "Templates/itkGaussianBlurImageFunction+-.h"
224 #endif
225 
226 #if ITK_TEMPLATE_TXX
227 #include "itkGaussianBlurImageFunction.hxx"
228 #endif
229 
230 #endif
231