OTB  6.7.0
Orfeo Toolbox
otbGaussianAdditiveNoiseSampleListFilter.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 otbGaussianAdditiveNoiseSampleListFilter_h
22 #define otbGaussianAdditiveNoiseSampleListFilter_h
23 
25 
26 namespace otb {
27 namespace Statistics {
28 
45 template < class TInputSampleList, class TOutputSampleList = TInputSampleList >
47  public otb::Statistics::ListSampleToListSampleFilter<TInputSampleList, TOutputSampleList>
48 {
49 public:
53  <TInputSampleList, TOutputSampleList> Superclass;
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  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
104 
105 private:
106  GaussianAdditiveNoiseSampleListFilter(const Self&) = delete;
107  void operator=(const Self&) = delete;
108 
109  // Mean and variance for the white gaussian noise to generate
110  double m_Mean;
111  double m_Variance;
112  std::vector<double> m_WhiteGaussianNoiseCoefficients;
113  unsigned int m_NumberOfIteration;
114 
115 }; // end of class ImageToListGenerator
116 
117 } // end of namespace Statistics
118 } // end of namespace otb
119 
120 #ifndef OTB_MANUAL_INSTANTIATION
122 #endif
123 
124 #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.