ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkBilateralImageFilter.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 __itkBilateralImageFilter_h
19 #define __itkBilateralImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkFixedArray.h"
24 #include "itkNeighborhood.h"
25 
26 namespace itk
27 {
74 template< class TInputImage, class TOutputImage >
75 class ITK_EXPORT BilateralImageFilter:
76  public ImageToImageFilter< TInputImage, TOutputImage >
77 {
78 public:
84 
86  itkNewMacro(Self);
87 
90 
92  typedef TInputImage InputImageType;
93  typedef TOutputImage OutputImageType;
94 
96  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
97 
100  typedef typename TOutputImage::PixelType OutputPixelType;
101  typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
103  typedef typename TInputImage::PixelType InputPixelType;
104  typedef typename TInputImage::InternalPixelType InputInternalPixelType;
105 
108  itkStaticConstMacro(ImageDimension, unsigned int,
109  TOutputImage::ImageDimension);
110 
113 
116 
118  typedef
120  typedef typename KernelType::SizeType SizeType;
122 
126 
128  typedef
130 
134  itkSetMacro(DomainSigma, ArrayType);
135  itkGetConstMacro(DomainSigma, const ArrayType);
136  itkSetMacro(DomainMu, double);
137  itkGetConstReferenceMacro(DomainMu, double);
138  itkSetMacro(RangeSigma, double);
139  itkGetConstMacro(RangeSigma, double);
140  itkGetConstMacro(FilterDimensionality, unsigned int);
141  itkSetMacro(FilterDimensionality, unsigned int);
143 
146  void SetDomainSigma(const double v)
147  {
148  m_DomainSigma.Fill(v);
149  }
150 
156  itkBooleanMacro(AutomaticKernelSize);
157  itkGetConstMacro(AutomaticKernelSize, bool);
158  itkSetMacro(AutomaticKernelSize, bool);
160 
163  void SetRadius(const SizeValueType);
164 
165  itkSetMacro(Radius, SizeType);
166  itkGetConstReferenceMacro(Radius, SizeType);
167 
171  itkSetMacro(NumberOfRangeGaussianSamples, unsigned long);
172  itkGetConstMacro(NumberOfRangeGaussianSamples, unsigned long);
174 
175 #ifdef ITK_USE_CONCEPT_CHECKING
176 
177  itkConceptMacro( OutputHasNumericTraitsCheck,
179 
181 #endif
182 
183 protected:
186 
189 
191  void PrintSelf(std::ostream & os, Indent indent) const;
192 
194  void BeforeThreadedGenerateData();
195 
198  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
199  ThreadIdType threadId);
200 
207  virtual void GenerateInputRequestedRegion()
209 
210 private:
211  BilateralImageFilter(const Self &); //purposely not implemented
212  void operator=(const Self &); //purposely not implemented
213 
216  double m_RangeSigma;
217 
220  ArrayType m_DomainSigma;
221 
224  double m_DomainMu;
225  double m_RangeMu;
226 
228  unsigned int m_FilterDimensionality;
229 
231  KernelType m_GaussianKernel;
232  SizeType m_Radius;
233  bool m_AutomaticKernelSize;
234 
236  unsigned long m_NumberOfRangeGaussianSamples;
237  double m_DynamicRange;
238  double m_DynamicRangeUsed;
239  std::vector< double > m_RangeGaussianTable;
240 };
241 } // end namespace itk
242 
243 #ifndef ITK_MANUAL_INSTANTIATION
244 #include "itkBilateralImageFilter.hxx"
245 #endif
246 
247 #endif
248