22 #ifndef otbSarBrightnessFunction_hxx
23 #define otbSarBrightnessFunction_hxx
26 #include "itkNumericTraits.h"
34 template <
class TInputImage,
class TCoordRep>
53 template <
class TInputImage,
class TCoordRep>
56 Superclass::SetInputImage(ptr);
57 m_Noise->SetInputImage(ptr);
58 m_AntennaPatternNewGain->SetInputImage(ptr);
59 m_AntennaPatternOldGain->SetInputImage(ptr);
60 m_RangeSpreadLoss->SetInputImage(ptr);
67 template <
class TInputImage,
class TCoordRep>
70 this->Superclass::PrintSelf(os, indent);
73 os << indent <<
"Noise:\n";
74 m_Noise->Print(os, indent.GetNextIndent());
76 if (m_AntennaPatternNewGain)
78 os << indent <<
"AntennaPatternNewGain:\n";
79 m_AntennaPatternNewGain->Print(os, indent.GetNextIndent());
81 if (m_AntennaPatternOldGain)
83 os << indent <<
"AntennaPatternOldGain:\n";
84 m_AntennaPatternOldGain->Print(os, indent.GetNextIndent());
86 if (m_RangeSpreadLoss)
88 os << indent <<
"RangeSpreadLoss:\n";
89 m_RangeSpreadLoss->Print(os, indent.GetNextIndent());
97 template <
class TInputImage,
class TCoordRep>
101 result = itk::NumericTraits<RealType>::Zero;
103 if (!this->GetInputImage())
105 return (itk::NumericTraits<OutputType>::max());
108 if (!this->IsInsideBuffer(index))
110 return (itk::NumericTraits<OutputType>::max());
115 FunctorRealType antennaPatternNewGain = itk::NumericTraits<FunctorRealType>::Zero;
116 FunctorRealType antennaPatternOldGain = itk::NumericTraits<FunctorRealType>::Zero;
117 FunctorRealType rangeSpreadLoss = itk::NumericTraits<FunctorRealType>::Zero;
123 antennaPatternNewGain =
static_cast<FunctorRealType>(m_AntennaPatternNewGain->EvaluateAtIndex(index));
124 antennaPatternOldGain =
static_cast<FunctorRealType>(m_AntennaPatternOldGain->EvaluateAtIndex(index));
125 rangeSpreadLoss =
static_cast<FunctorRealType>(m_RangeSpreadLoss->EvaluateAtIndex(index));
137 const std::complex<float> pVal = this->GetInputImage()->GetPixel(index);
138 const RealType value = std::sqrt((pVal.real() * pVal.real()) + (pVal.imag() * pVal.imag()));
140 result = functor(value);