OTB  10.0.0
Orfeo Toolbox
otbGaussianAdditiveNoiseSampleListFilter.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 otbGaussianAdditiveNoiseSampleListFilter_h
22 #define otbGaussianAdditiveNoiseSampleListFilter_h
23 
25 
26 namespace otb
27 {
28 namespace Statistics
29 {
30 
47 template <class TInputSampleList, class TOutputSampleList = TInputSampleList>
48 class ITK_EXPORT GaussianAdditiveNoiseSampleListFilter : public otb::Statistics::ListSampleToListSampleFilter<TInputSampleList, TOutputSampleList>
49 {
50 public:
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
59 
61  itkNewMacro(Self);
62 
64  typedef TInputSampleList InputSampleListType;
65  typedef typename InputSampleListType::Pointer InputSampleListPointer;
66  typedef typename InputSampleListType::ConstPointer InputSampleListConstPointer;
67  typedef typename InputSampleListType::MeasurementVectorType InputMeasurementVectorType;
68  typedef typename InputMeasurementVectorType::ValueType InputValueType;
69 
71  typedef TOutputSampleList OutputSampleListType;
72  typedef typename OutputSampleListType::Pointer OutputSampleListPointer;
73  typedef typename OutputSampleListType::ConstPointer OutputSampleListConstPointer;
74  typedef typename OutputSampleListType::MeasurementVectorType OutputMeasurementVectorType;
75  typedef typename OutputMeasurementVectorType::ValueType OutputValueType;
76 
78  itkSetMacro(Mean, double);
79  itkGetMacro(Mean, double);
81 
83  itkSetMacro(Variance, double);
84  itkGetMacro(Variance, double);
86 
88  itkSetMacro(NumberOfIteration, unsigned int);
89  itkGetMacro(NumberOfIteration, unsigned int);
91 
92 protected:
94  void GenerateData() override;
95 
99  void GenerateRandomSequence();
100 
103  {
104  }
105  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
106 
107 private:
109  void operator=(const Self&) = delete;
110 
111  // Mean and variance for the white gaussian noise to generate
112  double m_Mean;
113  double m_Variance;
114  std::vector<double> m_WhiteGaussianNoiseCoefficients;
115  unsigned int m_NumberOfIteration;
116 
117 }; // end of class ImageToListGenerator
118 
119 } // end of namespace Statistics
120 } // end of namespace otb
121 
122 #ifndef OTB_MANUAL_INSTANTIATION
124 #endif
125 
126 #endif
This class generate a noised version of the input sample list.
otb::Statistics::ListSampleToListSampleFilter< TInputSampleList, TOutputSampleList > Superclass
This class is a base class for filters using ListSample as input and returning ListSample.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.