OTB  7.2.0
Orfeo Toolbox
otbDEMCaracteristicsExtractor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2020 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbDEMCaracteristicsExtractor_h
23 #define otbDEMCaracteristicsExtractor_h
24 
25 #include "otbImage.h"
26 #include "otbVectorImage.h"
27 #include "itkUnaryFunctorImageFilter.h"
28 #include "itkGradientMagnitudeImageFilter.h"
29 #include "itkGradientRecursiveGaussianImageFilter.h"
30 #include "itkAtan2ImageFilter.h"
31 #include "itkAtanImageFilter.h"
33 #include "itkMultiplyImageFilter.h"
34 #include "itkAcosImageFilter.h"
35 #include "itkCosImageFilter.h"
36 #include "itkSinImageFilter.h"
37 #include "itkShiftScaleImageFilter.h"
38 #include "itkAddImageFilter.h"
39 
40 #include "itkGradientImageFilter.h"
41 
42 namespace otb
43 {
44 
56 template <class TInputImage, class TOutputImage>
57 class ITK_EXPORT DEMCaracteristicsExtractor : public itk::ImageToImageFilter<TInputImage, TOutputImage>
58 {
59 public:
61  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
62  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
64 
66  typedef TInputImage InputImageType;
67  typedef TOutputImage OutputImageType;
68 
71  typedef itk::ImageToImageFilter<TInputImage, OutputImageType> Superclass;
72  typedef itk::SmartPointer<Self> Pointer;
73  typedef itk::SmartPointer<const Self> ConstPointer;
74 
76  itkNewMacro(Self);
77 
79  itkTypeMacro(DEMCaracteristicsExtractor, ImageToImageFilter);
80 
82  typedef typename InputImageType::PixelType InputPixelType;
83  typedef typename InputImageType::InternalPixelType InputInternalPixelType;
84  typedef typename OutputImageType::PixelType OutputPixelType;
85  typedef typename OutputImageType::InternalPixelType OutputInternalPixelType;
86  typedef itk::CovariantVector<InputInternalPixelType, 2> VectorPixelType;
88 
90  typedef itk::GradientMagnitudeImageFilter<InputImageType, OutputImageType> GradientMagnitudeFilterType;
91  typedef itk::GradientImageFilter<InputImageType, InputInternalPixelType, InputInternalPixelType> GradientRecursiveGaussianImageFilterType;
92  typedef typename GradientRecursiveGaussianImageFilterType::OutputImageType tutuType;
93  typedef itk::NthElementImageAdaptor<tutuType, InputInternalPixelType> AdaptorType;
94  typedef itk::Atan2ImageFilter<AdaptorType, AdaptorType, OutputImageType> Atan2FilterType;
95  typedef itk::AtanImageFilter<OutputImageType, OutputImageType> AtanFilterType;
96 
99  typedef itk::MultiplyImageFilter<OutputImageType, OutputImageType, OutputImageType> MultiplyImageFilterType;
100  typedef itk::AcosImageFilter<OutputImageType, OutputImageType> AcosImageFilterType;
101  typedef itk::CosImageFilter<OutputImageType, OutputImageType> CosImageFilterType;
102  typedef itk::SinImageFilter<OutputImageType, OutputImageType> SinImageFilterType;
103  typedef itk::ShiftScaleImageFilter<OutputImageType, OutputImageType> ShiftScaleImageFilterType;
104  typedef itk::AddImageFilter<OutputImageType, OutputImageType, OutputImageType> AddImageFilterType;
105 
107  OutputImageType* GetSlopOutput()
108  {
109  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(0));
110  }
111 
113  OutputImageType* GetAspectOutput()
114  {
115  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(1));
116  }
117 
119  OutputImageType* GetIncidenceOutput()
120  {
121  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(2));
122  }
123 
125  OutputImageType* GetExitanceOutput()
126  {
127  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(3));
128  }
129 
133  itkSetMacro(SolarAngle, double);
134  itkGetConstMacro(SolarAngle, double);
135 
137  itkSetMacro(SolarAzimut, double);
138  itkGetConstMacro(SolarAzimut, double);
139 
141  itkSetMacro(ViewAngle, double);
142  itkGetConstMacro(ViewAngle, double);
143 
145  itkSetMacro(ViewAzimut, double);
146  itkGetConstMacro(ViewAzimut, double);
148 
149 protected:
151  ~DEMCaracteristicsExtractor() override;
153  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
154 
155  void GenerateData() override;
156 
157 private:
161  double m_SolarAngle;
162 
165 
167  double m_ViewAngle;
168 
170  double m_ViewAzimut;
171 };
172 
173 } // end namespace otb
174 
175 #ifndef OTB_MANUAL_INSTANTIATION
177 #endif
178 
179 #endif
OutputImageType::InternalPixelType OutputInternalPixelType
itk::GradientImageFilter< InputImageType, InputInternalPixelType, InputInternalPixelType > GradientRecursiveGaussianImageFilterType
itk::AcosImageFilter< OutputImageType, OutputImageType > AcosImageFilterType
itk::GradientMagnitudeImageFilter< InputImageType, OutputImageType > GradientMagnitudeFilterType
itk::NthElementImageAdaptor< tutuType, InputInternalPixelType > AdaptorType
itk::Atan2ImageFilter< AdaptorType, AdaptorType, OutputImageType > Atan2FilterType
GradientRecursiveGaussianImageFilterType::OutputImageType tutuType
MultiplyByScalarImageFilter< OutputImageType, OutputImageType > MultiplyByScalarImageFilterType
itk::CosImageFilter< OutputImageType, OutputImageType > CosImageFilterType
Calculates the slope, the orientation incidence and exitance radius values for each pixel...
itk::SmartPointer< const Self > ConstPointer
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
itk::ShiftScaleImageFilter< OutputImageType, OutputImageType > ShiftScaleImageFilterType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::AtanImageFilter< OutputImageType, OutputImageType > AtanFilterType
itk::ImageToImageFilter< TInputImage, OutputImageType > Superclass
itk::AddImageFilter< OutputImageType, OutputImageType, OutputImageType > AddImageFilterType
itk::CovariantVector< InputInternalPixelType, 2 > VectorPixelType
itk::MultiplyImageFilter< OutputImageType, OutputImageType, OutputImageType > MultiplyImageFilterType
Image< VectorPixelType, 2 > VectorGradientImageType
InputImageType::InternalPixelType InputInternalPixelType
itk::SinImageFilter< OutputImageType, OutputImageType > SinImageFilterType