OTB  9.0.0
Orfeo Toolbox
otbMultiChannelsPolarimetricSynthesisFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbMultiChannelsPolarimetricSynthesisFilter_h
22 #define otbMultiChannelsPolarimetricSynthesisFilter_h
23 
24 #include "itkInPlaceImageFilter.h"
26 #include "otbPolarimetricData.h"
27 #include <complex>
28 
29 namespace otb
30 {
31 
46 template <class TInputImage, class TOutputImage,
47  class TFunction = Functor::PolarimetricSynthesisFunctor<typename TInputImage::InternalPixelType, typename TInputImage::InternalPixelType,
48  typename TInputImage::InternalPixelType, typename TInputImage::InternalPixelType,
49  typename TOutputImage::PixelType>>
50 class ITK_EXPORT MultiChannelsPolarimetricSynthesisFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
51 {
52 public:
55  typedef itk::InPlaceImageFilter<TInputImage, TOutputImage> Superclass;
56  typedef itk::SmartPointer<Self> Pointer;
57  typedef itk::SmartPointer<const Self> ConstPointer;
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(MultiChannelsPolarimetricSynthesisFilter, InPlaceImageFilter);
64 
66  typedef std::complex<double> InputPixelType;
67  typedef TFunction FunctorType;
68  typedef TInputImage InputImageType;
69  typedef typename InputImageType::ConstPointer InputImagePointer;
70  typedef typename InputImageType::RegionType InputImageRegionType;
71  typedef typename InputImageType::PixelType InputImagePixelType;
72  typedef TOutputImage OutputImageType;
73  typedef typename OutputImageType::Pointer OutputImagePointer;
74  typedef typename OutputImageType::RegionType OutputImageRegionType;
75  typedef typename OutputImageType::PixelType OutputImagePixelType;
76  typedef typename std::complex<double> ComplexType;
77  typedef typename itk::FixedArray<ComplexType, 2> ComplexArrayType;
78  typedef typename itk::FixedArray<int, 4> IndexArrayType;
79 
85  {
86  return m_Functor;
87  }
88  const FunctorType& GetFunctor() const
89  {
90  return m_Functor;
91  }
93 
100  void SetFunctor(const FunctorType& functor)
101  {
102  if (m_Functor != functor)
103  {
104  m_Functor = functor;
105  this->Modified();
106  }
107  }
108 
111  {
112  m_Ei = ei;
113  this->GetFunctor().SetEi(ei);
114  this->Modified();
115  }
116 
119  {
120  m_Er = er;
121  this->GetFunctor().SetEr(er);
122  this->Modified();
123  }
125 
127  itkSetMacro(PsiI, double);
128  itkGetMacro(PsiI, double);
129 
131  itkSetMacro(KhiI, double);
132  itkGetMacro(KhiI, double);
133 
135  itkSetMacro(PsiR, double);
136  itkGetMacro(PsiR, double);
137 
139  itkSetMacro(KhiR, double);
140  itkGetMacro(KhiR, double);
141 
143  itkSetMacro(EmissionH, bool);
144  itkGetMacro(EmissionH, bool);
145 
147  itkSetMacro(EmissionV, bool);
148  itkGetMacro(EmissionV, bool);
149 
151  itkSetMacro(Mode, int);
152  itkGetMacro(Mode, int);
153 
155  itkSetMacro(Gain, double);
156  itkGetMacro(Gain, double);
157 
159  void ForceCoPolar();
160 
162  void ForceCrossPolar();
163 
164 protected:
167 
170  {
171  }
172 
183  void GenerateOutputInformation() override;
184 
185  void BeforeThreadedGenerateData() override;
186 
197  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
198 
200  void ComputeElectromagneticFields();
201 
203  void VerifyAndForceInputs();
204 
205  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
206 
207 private:
208  MultiChannelsPolarimetricSynthesisFilter(const Self&) = delete;
209 
211  double m_PsiI;
212 
214  double m_KhiI;
215 
217  double m_PsiR;
218 
220  double m_KhiR;
221 
223  double m_Gain;
224 
226  int m_Mode;
227 
230 
233 
236 
238 
242 };
243 
244 } // end namespace otb
245 
246 #ifndef OTB_MANUAL_INSTANTIATION
248 #endif
249 
250 #endif
otb::MultiChannelsPolarimetricSynthesisFilter::m_Er
ComplexArrayType m_Er
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:232
otb::MultiChannelsPolarimetricSynthesisFilter::m_Ei
ComplexArrayType m_Ei
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:229
otb::MultiChannelsPolarimetricSynthesisFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:74
otb::MultiChannelsPolarimetricSynthesisFilter::SetEr
void SetEr(ComplexArrayType er)
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:118
otbPolarimetricSynthesisFunctor.h
otb::MultiChannelsPolarimetricSynthesisFilter::m_Mode
int m_Mode
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:226
otb::MultiChannelsPolarimetricSynthesisFilter
This class computes the polarimetric synthesis from two to four radar images, depending on the polari...
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:50
otb::MultiChannelsPolarimetricSynthesisFilter::~MultiChannelsPolarimetricSynthesisFilter
~MultiChannelsPolarimetricSynthesisFilter() override
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:169
otb::MultiChannelsPolarimetricSynthesisFilter::m_KhiI
double m_KhiI
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:214
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::MultiChannelsPolarimetricSynthesisFilter::ComplexType
std::complex< double > ComplexType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:76
otb::MultiChannelsPolarimetricSynthesisFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:70
otb::MultiChannelsPolarimetricSynthesisFilter::Self
MultiChannelsPolarimetricSynthesisFilter Self
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:54
otb::PolarimetricData::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPolarimetricData.h:51
otb::MultiChannelsPolarimetricSynthesisFilter::SetEi
void SetEi(ComplexArrayType ei)
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:110
otb::MultiChannelsPolarimetricSynthesisFilter::Superclass
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:55
otb::MultiChannelsPolarimetricSynthesisFilter::InputImagePointer
InputImageType::ConstPointer InputImagePointer
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:69
otb::MultiChannelsPolarimetricSynthesisFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:88
otbMultiChannelsPolarimetricSynthesisFilter.hxx
otb::MultiChannelsPolarimetricSynthesisFilter::m_PsiI
double m_PsiI
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:211
otb::MultiChannelsPolarimetricSynthesisFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:73
otb::MultiChannelsPolarimetricSynthesisFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:72
otb::MultiChannelsPolarimetricSynthesisFilter::GetFunctor
FunctorType & GetFunctor()
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:84
otb::MultiChannelsPolarimetricSynthesisFilter::m_KhiR
double m_KhiR
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:220
otb::MultiChannelsPolarimetricSynthesisFilter::InputImageType
TInputImage InputImageType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:68
otb::MultiChannelsPolarimetricSynthesisFilter::InputPixelType
std::complex< double > InputPixelType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:63
otb::MultiChannelsPolarimetricSynthesisFilter::m_EmissionH
bool m_EmissionH
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:240
otb::MultiChannelsPolarimetricSynthesisFilter::m_Gain
double m_Gain
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:223
otb::MultiChannelsPolarimetricSynthesisFilter::m_ArchitectureType
PolarimetricData::Pointer m_ArchitectureType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:235
otb::MultiChannelsPolarimetricSynthesisFilter::FunctorType
TFunction FunctorType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:67
otb::MultiChannelsPolarimetricSynthesisFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:56
otb::MultiChannelsPolarimetricSynthesisFilter::m_Functor
FunctorType m_Functor
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:237
otb::MultiChannelsPolarimetricSynthesisFilter::OutputImagePixelType
OutputImageType::PixelType OutputImagePixelType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:75
otbPolarimetricData.h
otb::MultiChannelsPolarimetricSynthesisFilter::ComplexArrayType
itk::FixedArray< ComplexType, 2 > ComplexArrayType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:77
otb::MultiChannelsPolarimetricSynthesisFilter::m_EmissionV
bool m_EmissionV
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:241
otb::MultiChannelsPolarimetricSynthesisFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:100
otb::MultiChannelsPolarimetricSynthesisFilter::IndexArrayType
itk::FixedArray< int, 4 > IndexArrayType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:78
otb::MultiChannelsPolarimetricSynthesisFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:71
otb::MultiChannelsPolarimetricSynthesisFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:57
otb::MultiChannelsPolarimetricSynthesisFilter::m_PsiR
double m_PsiR
Definition: otbMultiChannelsPolarimetricSynthesisFilter.h:217