OTB  10.0.0
Orfeo Toolbox
otbLeeImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbLeeImageFilter_h
22 #define otbLeeImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkImage.h"
26 #include "itkNumericTraits.h"
27 
28 namespace otb
29 {
30 
49 template <class TInputImage, class TOutputImage>
50 class ITK_EXPORT LeeImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
51 {
52 public:
54  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
55  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
57 
58  typedef TInputImage InputImageType;
59  typedef TOutputImage OutputImageType;
60 
63  typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
64  typedef itk::SmartPointer<Self> Pointer;
65  typedef itk::SmartPointer<const Self> ConstPointer;
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(LeeImageFilter, ImageToImageFilter);
72 
73  typedef typename InputImageType::PixelType InputPixelType;
74  typedef typename OutputImageType::PixelType OutputPixelType;
75  typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType;
76  typedef typename InputImageType::RegionType InputImageRegionType;
77  typedef typename OutputImageType::RegionType OutputImageRegionType;
78  typedef typename InputImageType::SizeType SizeType;
79 
81  itkSetMacro(Radius, SizeType);
82 
84  itkGetConstReferenceMacro(Radius, SizeType);
85 
87  itkSetMacro(NbLooks, double);
88 
90  itkGetConstReferenceMacro(NbLooks, double);
91 
98  void GenerateInputRequestedRegion() override;
99 
100 protected:
101  LeeImageFilter();
102  ~LeeImageFilter() override
103  {
104  }
105  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
106 
117  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
118 
119 private:
120  LeeImageFilter(const Self&) = delete;
121  void operator=(const Self&) = delete;
122 
125 
127  double m_NbLooks;
128 };
129 } // end namespace otb
130 
131 #ifndef OTB_MANUAL_INSTANTIATION
132 #include "otbLeeImageFilter.hxx"
133 #endif
134 
135 #endif
Anti-speckle image filter.
itk::NumericTraits< InputPixelType >::RealType InputRealType
InputImageType::RegionType InputImageRegionType
TInputImage InputImageType
OutputImageType::RegionType OutputImageRegionType
itk::SmartPointer< const Self > ConstPointer
void operator=(const Self &)=delete
TOutputImage OutputImageType
OutputImageType::PixelType OutputPixelType
itk::ImageToImageFilter< InputImageType, OutputImageType > Superclass
InputImageType::SizeType SizeType
InputImageType::PixelType InputPixelType
LeeImageFilter(const Self &)=delete
itk::SmartPointer< Self > Pointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.