ITK  4.13.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 
19 #ifndef itkSmoothingRecursiveGaussianImageFilter_h
20 #define itkSmoothingRecursiveGaussianImageFilter_h
21 
23 #include "itkCastImageFilter.h"
24 #include "itkImage.h"
25 #include "itkPixelTraits.h"
26 #include "itkCommand.h"
27 
28 namespace itk
29 {
30 
51 template< typename TInputImage,
52  typename TOutputImage = TInputImage >
53 class ITK_TEMPLATE_EXPORT SmoothingRecursiveGaussianImageFilter:
54  public InPlaceImageFilter< TInputImage, TOutputImage >
55 {
56 public:
62 
64  typedef TInputImage InputImageType;
65  typedef TOutputImage OutputImageType;
66  typedef typename TInputImage::PixelType PixelType;
69 
73 
75  itkStaticConstMacro(ImageDimension, unsigned int,
76  TInputImage::ImageDimension);
77 
79  typedef FixedArray< ScalarRealType,
80  itkGetStaticConstMacro(ImageDimension) > SigmaArrayType;
81 
86  typedef typename InputImageType::template Rebind<InternalRealType>::Type RealImageType;
87 
90 
93 
96 
99 
102 
105 
107  typedef typename OutputImageType::Pointer OutputImagePointer;
108 
110  itkNewMacro(Self);
111 
116  void SetSigmaArray(const SigmaArrayType & sigmas);
117  void SetSigma(ScalarRealType sigma);
119 
121  SigmaArrayType GetSigmaArray() const;
122 
125  ScalarRealType GetSigma() const;
126 
131  void SetNormalizeAcrossScale(bool normalizeInScaleSpace);
132  itkGetConstMacro(NormalizeAcrossScale, bool);
133  itkBooleanMacro( NormalizeAcrossScale );
135 
136  void SetNumberOfThreads(ThreadIdType nb) ITK_OVERRIDE;
137 
138  virtual bool CanRunInPlace( void ) const ITK_OVERRIDE;
139 
140 #ifdef ITK_USE_CONCEPT_CHECKING
141  // Begin concept checking
142  // This concept does not work with variable length vector images
143  //itkConceptMacro( InputHasNumericTraitsCheck,
144  //( Concept::HasNumericTraits< PixelType > ) );
145  // End concept checking
146 #endif
147 
148 protected:
150  virtual ~SmoothingRecursiveGaussianImageFilter() ITK_OVERRIDE {}
151  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
152 
153  void GenerateData(void) ITK_OVERRIDE;
154 
161  virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
162 
163  // Override since the filter produces the entire dataset
164  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
165 
166 private:
167  ITK_DISALLOW_COPY_AND_ASSIGN(SmoothingRecursiveGaussianImageFilter);
168 
169  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
170  FirstGaussianFilterPointer m_FirstSmoothingFilter;
171  CastingFilterPointer m_CastingFilter;
172 
173  bool m_NormalizeAcrossScale;
174 
175  SigmaArrayType m_Sigma;
176 };
177 } // end namespace itk
178 
179 #ifndef ITK_MANUAL_INSTANTIATION
180 #include "itkSmoothingRecursiveGaussianImageFilter.hxx"
181 #endif
182 
183 #endif
FixedArray< ScalarRealType, itkGetStaticConstMacro(ImageDimension) > SigmaArrayType
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
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
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.
Base class for filters that take an image as input and overwrite that image as the output...
InputImageType::template Rebind< InternalRealType >::Type RealImageType
Base class for all data objects in ITK.
Casts input pixels to output pixel type.