ITK  4.3.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 >
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 
115  typedef typename OutputImageType::Pointer OutputImagePointer;
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);
142 
143  // See super class for doxygen documentation
144  //
145  virtual bool CanRunInPlace( void ) const;
146 
147 #ifdef ITK_USE_CONCEPT_CHECKING
148 
149  // This concept does not work with variable length vector images
150  //itkConceptMacro( InputHasNumericTraitsCheck,
151  //( Concept::HasNumericTraits< PixelType > ) );
152 
154 #endif
155 
156 protected:
159  void PrintSelf(std::ostream & os, Indent indent) const;
160 
162  void GenerateData(void);
163 
169  virtual void GenerateInputRequestedRegion()
171 
172  // Override since the filter produces the entire dataset
173  void EnlargeOutputRequestedRegion(DataObject *output);
174 
175 private:
176  SmoothingRecursiveGaussianImageFilter(const Self &); //purposely not
177  // implemented
178  void operator=(const Self &); //purposely not
179 
180  // implemented
181 
182  InternalGaussianFilterPointer m_SmoothingFilters[ImageDimension - 1];
183  FirstGaussianFilterPointer m_FirstSmoothingFilter;
184  CastingFilterPointer m_CastingFilter;
185 
187  bool m_NormalizeAcrossScale;
188 
190  SigmaArrayType m_Sigma;
191 };
192 } // end namespace itk
193 
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkSmoothingRecursiveGaussianImageFilter.hxx"
196 #endif
197 
198 #endif
199