OTB  10.0.0
Orfeo Toolbox
otbLabelMapToSimulatedImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 
22 #ifndef otbLabelMapToSimulatedImageFilter_h
23 #define otbLabelMapToSimulatedImageFilter_h
24 
25 
26 #include "itkLabelMapFilter.h"
30 #include "otbSatelliteRSR.h"
31 #include <string>
32 
33 
34 namespace otb
35 {
36 
52 template <class TInputLabelMap, class TSimuStep1, class TSimuStep2, class TOutputImage>
53 class ITK_EXPORT LabelMapToSimulatedImageFilter : public itk::LabelMapFilter<TInputLabelMap, TOutputImage>
54 
55 {
56 public:
61  typedef itk::LabelMapFilter<TInputLabelMap, TOutputImage> Superclass;
62  typedef itk::SmartPointer<Self> Pointer;
63  typedef itk::SmartPointer<const Self> ConstPointer;
64 
66  typedef TInputLabelMap InputLabelMapType;
67  typedef typename InputLabelMapType::Pointer InputLabelMapPointer;
68  typedef typename InputLabelMapType::ConstPointer InputLabelMapConstPointer;
69  typedef typename InputLabelMapType::LabelObjectType LabelObjectType;
70  typedef typename LabelObjectType::ConstLineIterator ConstLineIteratorType;
71 
72  typedef typename LabelObjectType::AttributesValueType AttributesValueType;
73 
74  typedef TOutputImage OutputImageType;
75  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
76  typedef typename OutputImageType::Pointer OutputImagePointer;
77  typedef typename OutputImageType::IndexType IndexType;
78  typedef typename OutputImageType::InternalPixelType InternalPixelType;
79 
80  typedef TSimuStep1 SimulationStep1Type;
81  typedef typename SimulationStep1Type::Pointer SimulationStep1Pointer;
82  typedef TSimuStep2 SimulationStep2Type;
83  typedef typename SimulationStep2Type::Pointer SimulationStep2Pointer;
84 
85  // TODO: template ??
88 
93 
96 
97  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType;
98  typedef typename RandomGeneratorType::Pointer RandomGeneratorPointer;
99 
100 
102  itkTypeMacro(LabelMapToSimulatedImageFilter, LabelMapFilter);
103  itkNewMacro(Self);
105 
106  itkSetMacro(NumberOfComponentsPerPixel, unsigned int);
107  itkGetMacro(NumberOfComponentsPerPixel, unsigned int);
108 
109  itkSetMacro(SatRSRFilename, std::string);
110  itkGetMacro(SatRSRFilename, std::string);
111 
112  itkSetMacro(PathRoot, std::string);
113  itkGetMacro(PathRoot, std::string);
114 
115  itkSetMacro(Mean, double);
116  itkGetMacro(Mean, double);
117 
118  itkSetMacro(Variance, double);
119  itkGetMacro(Variance, double);
120 
121 
122 protected:
125  {
126  }
127  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
128 
129  void BeforeThreadedGenerateData() override;
130  void ThreadedProcessLabelObject(LabelObjectType* labelObject) override;
131  void GenerateOutputInformation() override;
132 
133 
134 private:
136  void operator=(const Self&) = delete;
137 
139  std::string m_SatRSRFilename;
140  std::string m_PathRoot;
142  double m_Mean;
143 
145  double m_Variance;
146 };
147 
148 } // end namespace itk
149 
150 #ifndef OTB_MANUAL_INSTANTIATION
152 #endif
153 
154 #endif
itk::LabelMapFilter< TInputLabelMap, TOutputImage > Superclass
InputLabelMapType::ConstPointer InputLabelMapConstPointer
LabelObjectType::AttributesValueType AttributesValueType
void operator=(const Self &)=delete
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
LabelToProSailParameters< AttributesValueType > LabelToParametersType
ReduceSpectralResponse< SpectralResponseType, SatelliteRSRType > ReduceSpectralResponseType
InputLabelMapType::LabelObjectType LabelObjectType
SpectralResponse< double, double > SpectralResponseType
LabelObjectType::ConstLineIterator ConstLineIteratorType
LabelToParametersType::Pointer LabelToParametersPointer
OutputImageType::InternalPixelType InternalPixelType
LabelMapToSimulatedImageFilter(const Self &)=delete
ReduceSpectralResponseType::Pointer ReduceSpectralResponsePointer
Take a label corresponding to a spectrum type for vegetation and outputs the ProSail parameters neede...
This class computes the reduced spectral response of each band of a sensor.
itk::SmartPointer< Self > Pointer
This class represents a hierarchy of vector data.
itk::SmartPointer< Self > Pointer
This class represents the spectral response of an object (or a satellite band).
itk::SmartPointer< Self > Pointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.