ITK  4.12.0
Insight Segmentation and Registration Toolkit
itkSmoothingRecursiveGaussianImageFilter.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 itkSmoothingRecursiveGaussianImageFilter_h
19 #define itkSmoothingRecursiveGaussianImageFilter_h
20 
22 #include "itkCastImageFilter.h"
23 #include "itkImage.h"
24 #include "itkPixelTraits.h"
25 #include "itkCommand.h"
26 
27 namespace itk
28 {
49 template< typename TInputImage,
50  typename TOutputImage = TInputImage >
51 class ITK_TEMPLATE_EXPORT SmoothingRecursiveGaussianImageFilter:
52  public InPlaceImageFilter< TInputImage, TOutputImage >
53 {
54 public:
60 
62  typedef TInputImage InputImageType;
63  typedef TOutputImage OutputImageType;
64  typedef typename TInputImage::PixelType PixelType;
67 
71 
73  itkStaticConstMacro(ImageDimension, unsigned int,
74  TInputImage::ImageDimension);
75 
77  typedef FixedArray< ScalarRealType,
78  itkGetStaticConstMacro(ImageDimension) > SigmaArrayType;
79 
85  typedef typename InputImageType::template Rebind<InternalRealType>::Type RealImageType;
86 
92 
98 
100  typedef CastImageFilter<
104 
107 
110 
113 
116 
118  itkNewMacro(Self);
119 
124  void SetSigmaArray(const SigmaArrayType & sigmas);
125  void SetSigma(ScalarRealType sigma);
127 
128  SigmaArrayType GetSigmaArray() const;
129  ScalarRealType GetSigma() const;
130 
135  void SetNormalizeAcrossScale(bool normalizeInScaleSpace);
136  itkGetConstMacro(NormalizeAcrossScale, bool);
138 
139  // See super class for doxygen documentation
140  //
141  void SetNumberOfThreads(ThreadIdType nb) ITK_OVERRIDE;
142 
143  // See super class for doxygen documentation
144  //
145  virtual bool CanRunInPlace( void ) const ITK_OVERRIDE;
146 
147 #ifdef ITK_USE_CONCEPT_CHECKING
148  // Begin concept checking
149  // This concept does not work with variable length vector images
150  //itkConceptMacro( InputHasNumericTraitsCheck,
151  //( Concept::HasNumericTraits< PixelType > ) );
152  // End concept checking
153 #endif
154 
155 protected:
158  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
159 
161  void GenerateData(void) ITK_OVERRIDE;
162 
168  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
169 
170  // Override since the filter produces the entire dataset
171  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
172 
173 private:
174  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveGaussianImageFilter);
175 
176  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
177  FirstGaussianFilterPointer m_FirstSmoothingFilter;
178  CastingFilterPointer m_CastingFilter;
179 
181  bool m_NormalizeAcrossScale;
182 
184  SigmaArrayType m_Sigma;
185 };
186 } // end namespace itk
187 
188 #ifndef ITK_MANUAL_INSTANTIATION
189 #include "itkSmoothingRecursiveGaussianImageFilter.hxx"
190 #endif
191 
192 #endif
FixedArray< ScalarRealType, itkGetStaticConstMacro(ImageDimension) > SigmaArrayType
virtual void PrintSelf(std::ostream &os, Indent indent) const override
InPlaceImageFilter< TInputImage, TOutputImage > Superclass
Base class for computing IIR convolution with an approximation of a Gaussian kernel.
Base class for all process objects that output image data.
Simulate a standard C array with copy semnatics.
Definition: itkFixedArray.h:50
SmartPointer< Self > Pointer
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
NumericTraits< PixelType >::ScalarRealType ScalarRealType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Base class for all data objects in ITK.
RecursiveGaussianImageFilter< InputImageType, RealImageType > FirstGaussianFilterType
Base class for filters that take an image as input and produce an image as output.
CastImageFilter< RealImageType, OutputImageType > CastingFilterType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
RecursiveGaussianImageFilter< RealImageType, RealImageType > InternalGaussianFilterType
Define additional traits for native types such as int or float.
TOutputImage OutputImageType
Base class for filters that take an image as input and overwrite that image as the output...
InputImageType::template Rebind< InternalRealType >::Type RealImageType
Casts input pixels to output pixel type.