OTB  6.7.0
Orfeo Toolbox
otbKuanImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbKuanImageFilter_h
22 #define otbKuanImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkImage.h"
26 #include "itkNumericTraits.h"
27 
28 namespace otb
29 {
30 
42 template <class TInputImage, class TOutputImage>
43 class ITK_EXPORT KuanImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
44 {
45 public:
47  itkStaticConstMacro(InputImageDimension,
48  unsigned int,
49  TInputImage::ImageDimension);
50  itkStaticConstMacro(OutputImageDimension,
51  unsigned int,
52  TOutputImage::ImageDimension);
54 
55  typedef TInputImage InputImageType;
56  typedef TOutputImage OutputImageType;
57 
63 
65  itkNewMacro(Self);
66 
68  itkTypeMacro(KuanImageFilter, ImageToImageFilter);
69 
70  typedef typename InputImageType::PixelType InputPixelType;
71  typedef typename OutputImageType::PixelType OutputPixelType;
73  typedef typename InputImageType::RegionType InputImageRegionType;
74  typedef typename OutputImageType::RegionType OutputImageRegionType;
76 
78  itkSetMacro(Radius, SizeType);
79 
81  itkGetConstReferenceMacro(Radius, SizeType);
82 
84  itkSetMacro(NbLooks, double);
85 
87  itkGetConstReferenceMacro(NbLooks, double);
88 
95  void GenerateInputRequestedRegion()
96  throw(itk::InvalidRequestedRegionError) override;
97 
98 protected:
100  ~KuanImageFilter() override {}
101  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
102 
106  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
107  itk::ThreadIdType threadId) override;
108 
109 private:
110  KuanImageFilter(const Self &) = delete;
111  void operator =(const Self&) = delete;
112 
115 
117  double m_NbLooks;
118 };
119 } // end namespace otb
120 
121 #ifndef OTB_MANUAL_INSTANTIATION
122 #include "otbKuanImageFilter.hxx"
123 #endif
124 
125 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
OutputImageType::PixelType OutputPixelType
InputImageType::SizeType SizeType
itk::SmartPointer< const Self > ConstPointer
InputImageType::RegionType InputImageRegionType
InputImageType::PixelType InputPixelType
OutputImageType::RegionType OutputImageRegionType
itk::NumericTraits< InputPixelType >::RealType InputRealType
unsigned int ThreadIdType
Anti-speckle image filter.
itk::SmartPointer< Self > Pointer
TOutputImage OutputImageType
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass