OTB  9.0.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-2022 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 
108  {
109  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(0));
110  }
111 
114  {
115  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(1));
116  }
117 
120  {
121  return static_cast<OutputImageType*>(this->itk::ProcessObject::GetOutput(2));
122  }
123 
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
otb::DEMCaracteristicsExtractor::AcosImageFilterType
itk::AcosImageFilter< OutputImageType, OutputImageType > AcosImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:100
otb::DEMCaracteristicsExtractor::m_SolarAngle
double m_SolarAngle
Definition: otbDEMCaracteristicsExtractor.h:161
otb::DEMCaracteristicsExtractor::MultiplyImageFilterType
itk::MultiplyImageFilter< OutputImageType, OutputImageType, OutputImageType > MultiplyImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:99
otb::DEMCaracteristicsExtractor::Superclass
itk::ImageToImageFilter< TInputImage, OutputImageType > Superclass
Definition: otbDEMCaracteristicsExtractor.h:71
otb::DEMCaracteristicsExtractor::VectorGradientImageType
Image< VectorPixelType, 2 > VectorGradientImageType
Definition: otbDEMCaracteristicsExtractor.h:87
otbVectorImage.h
otbMultiplyByScalarImageFilter.h
otb::DEMCaracteristicsExtractor::OutputInternalPixelType
OutputImageType::InternalPixelType OutputInternalPixelType
Definition: otbDEMCaracteristicsExtractor.h:85
otb::DEMCaracteristicsExtractor::Atan2FilterType
itk::Atan2ImageFilter< AdaptorType, AdaptorType, OutputImageType > Atan2FilterType
Definition: otbDEMCaracteristicsExtractor.h:94
otbImage.h
otb::DEMCaracteristicsExtractor::VectorPixelType
itk::CovariantVector< InputInternalPixelType, 2 > VectorPixelType
Definition: otbDEMCaracteristicsExtractor.h:86
otb::DEMCaracteristicsExtractor::Self
DEMCaracteristicsExtractor Self
Definition: otbDEMCaracteristicsExtractor.h:70
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Image
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
otb::DEMCaracteristicsExtractor::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbDEMCaracteristicsExtractor.h:79
otb::DEMCaracteristicsExtractor::OutputPixelType
OutputImageType::PixelType OutputPixelType
Definition: otbDEMCaracteristicsExtractor.h:84
otb::DEMCaracteristicsExtractor::ShiftScaleImageFilterType
itk::ShiftScaleImageFilter< OutputImageType, OutputImageType > ShiftScaleImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:103
otbDEMCaracteristicsExtractor.hxx
otb::DEMCaracteristicsExtractor::InputImageType
TInputImage InputImageType
Definition: otbDEMCaracteristicsExtractor.h:66
otb::DEMCaracteristicsExtractor::AddImageFilterType
itk::AddImageFilter< OutputImageType, OutputImageType, OutputImageType > AddImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:104
otb::DEMCaracteristicsExtractor::InputInternalPixelType
InputImageType::InternalPixelType InputInternalPixelType
Definition: otbDEMCaracteristicsExtractor.h:83
otb::DEMCaracteristicsExtractor::OutputImageType
TOutputImage OutputImageType
Definition: otbDEMCaracteristicsExtractor.h:67
otb::MultiplyByScalarImageFilter
TODO.
Definition: otbMultiplyByScalarImageFilter.h:73
otb::DEMCaracteristicsExtractor::m_ViewAngle
double m_ViewAngle
Definition: otbDEMCaracteristicsExtractor.h:167
otb::DEMCaracteristicsExtractor::GetIncidenceOutput
OutputImageType * GetIncidenceOutput()
Definition: otbDEMCaracteristicsExtractor.h:119
otb::DEMCaracteristicsExtractor::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbDEMCaracteristicsExtractor.h:72
otb::DEMCaracteristicsExtractor::CosImageFilterType
itk::CosImageFilter< OutputImageType, OutputImageType > CosImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:101
otb::DEMCaracteristicsExtractor::GetSlopOutput
OutputImageType * GetSlopOutput()
Definition: otbDEMCaracteristicsExtractor.h:107
otb::DEMCaracteristicsExtractor::tutuType
GradientRecursiveGaussianImageFilterType::OutputImageType tutuType
Definition: otbDEMCaracteristicsExtractor.h:92
otb::DEMCaracteristicsExtractor::m_ViewAzimut
double m_ViewAzimut
Definition: otbDEMCaracteristicsExtractor.h:170
otb::DEMCaracteristicsExtractor::MultiplyByScalarImageFilterType
MultiplyByScalarImageFilter< OutputImageType, OutputImageType > MultiplyByScalarImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:98
otb::DEMCaracteristicsExtractor::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbDEMCaracteristicsExtractor.h:73
otb::DEMCaracteristicsExtractor::SinImageFilterType
itk::SinImageFilter< OutputImageType, OutputImageType > SinImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:102
otb::DEMCaracteristicsExtractor
Calculates the slope, the orientation incidence and exitance radius values for each pixel.
Definition: otbDEMCaracteristicsExtractor.h:57
otb::DEMCaracteristicsExtractor::GradientRecursiveGaussianImageFilterType
itk::GradientImageFilter< InputImageType, InputInternalPixelType, InputInternalPixelType > GradientRecursiveGaussianImageFilterType
Definition: otbDEMCaracteristicsExtractor.h:91
otb::DEMCaracteristicsExtractor::GetExitanceOutput
OutputImageType * GetExitanceOutput()
Definition: otbDEMCaracteristicsExtractor.h:125
otb::DEMCaracteristicsExtractor::GetAspectOutput
OutputImageType * GetAspectOutput()
Definition: otbDEMCaracteristicsExtractor.h:113
otb::DEMCaracteristicsExtractor::AtanFilterType
itk::AtanImageFilter< OutputImageType, OutputImageType > AtanFilterType
Definition: otbDEMCaracteristicsExtractor.h:95
otb::DEMCaracteristicsExtractor::m_SolarAzimut
double m_SolarAzimut
Definition: otbDEMCaracteristicsExtractor.h:164
otb::DEMCaracteristicsExtractor::GradientMagnitudeFilterType
itk::GradientMagnitudeImageFilter< InputImageType, OutputImageType > GradientMagnitudeFilterType
Definition: otbDEMCaracteristicsExtractor.h:90
otb::DEMCaracteristicsExtractor::AdaptorType
itk::NthElementImageAdaptor< tutuType, InputInternalPixelType > AdaptorType
Definition: otbDEMCaracteristicsExtractor.h:93