Orfeo Toolbox  4.0
otbSarBrightnessFunctor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 
19 #ifndef __otbSarBrightnessFunctor_h
20 #define __otbSarBrightnessFunctor_h
21 
22 #include "otbMath.h"
23 #include "itkNumericTraits.h"
24 
25 namespace otb
26 {
27 
28 namespace Functor
29 {
36 template<class TInput, class TOutput>
37 class ITK_EXPORT SarBrightnessFunctor
38 {
39 public:
40  typedef TInput InputType;
41  typedef TOutput OutputType;
43 
45  {
46  m_Noise = 0.0;
47  m_Scale = 1.0;
48  m_AntennaPatternOldGain = 1.0;
49  m_AntennaPatternNewGain = 1.0;
50  m_RangeSpreadLoss = 1.0;
51  };
52 
54 
55  inline TOutput operator ()(const TInput& value) const
56  {
57  RealType digitalNumber = static_cast<RealType> (vcl_abs(value));
58  RealType beta;
59 
60  beta = m_Scale * (digitalNumber * digitalNumber - m_Noise);
61  beta *= m_AntennaPatternOldGain;
62  beta /= m_AntennaPatternNewGain;
63  beta *= m_RangeSpreadLoss;
64 
65  if(beta < 0.0)
66  {
67  beta = 0.0;
68  }
69 
70  return static_cast<OutputType>(beta);
71  }
72 
74  void SetNoise(RealType value)
75  {
76  m_Noise = value;
77  }
78 
80  RealType GetNoise() const
81  {
82  return m_Noise;
83  }
84 
86  void SetScale(RealType value)
87  {
88  m_Scale = value;
89  }
90 
92  RealType GetScale() const
93  {
94  return m_Scale;
95  }
96 
98  void SetAntennaPatternNewGain(RealType value)
99  {
100  m_AntennaPatternNewGain = value;
101  }
102 
104  RealType GetAntennaPatternNewGain() const
105  {
106  return m_AntennaPatternNewGain;
107  }
108 
110  void SetAntennaPatternOldGain(RealType value)
111  {
112  m_AntennaPatternOldGain = value;
113  }
114 
116  RealType GetAntennaPatternOldGain() const
117  {
118  return m_AntennaPatternOldGain;
119  }
120 
122  void SetRangeSpreadLoss(RealType value)
123  {
124  m_RangeSpreadLoss = value;
125  }
126 
128  RealType GetRangeSpreadLoss() const
129  {
130  return m_RangeSpreadLoss;
131  }
132 
133 private:
139 };
140 }
141 
142 }
143 
144 #endif

Generated at Sat Mar 8 2014 16:16:17 for Orfeo Toolbox with doxygen 1.8.3.1