OTB  9.0.0
Orfeo Toolbox
otbLabelMapToSimulatedImageFilter.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 
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:
135  LabelMapToSimulatedImageFilter(const Self&) = delete;
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
otb::LabelToProSailParameters
Take a label corresponding to a spectrum type for vegetation and outputs the ProSail parameters neede...
Definition: otbLabelToProSailParameters.h:69
otb::ReduceSpectralResponse
This class computes the reduced spectral response of each band of a sensor.
Definition: otbReduceSpectralResponse.h:64
otb::LabelMapToSimulatedImageFilter::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbLabelMapToSimulatedImageFilter.h:76
otb::LabelMapToSimulatedImageFilter::LabelToParametersType
LabelToProSailParameters< AttributesValueType > LabelToParametersType
Definition: otbLabelMapToSimulatedImageFilter.h:86
otb::SpectralResponse::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSpectralResponse.h:61
otb::LabelMapToSimulatedImageFilter::SimulationStep1Pointer
SimulationStep1Type::Pointer SimulationStep1Pointer
Definition: otbLabelMapToSimulatedImageFilter.h:81
otb::LabelMapToSimulatedImageFilter::m_PathRoot
std::string m_PathRoot
Definition: otbLabelMapToSimulatedImageFilter.h:140
otb::LabelMapToSimulatedImageFilter::ConstLineIteratorType
LabelObjectType::ConstLineIterator ConstLineIteratorType
Definition: otbLabelMapToSimulatedImageFilter.h:70
otb::LabelMapToSimulatedImageFilter::RandomGeneratorType
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
Definition: otbLabelMapToSimulatedImageFilter.h:97
otb::LabelMapToSimulatedImageFilter::InputLabelMapConstPointer
InputLabelMapType::ConstPointer InputLabelMapConstPointer
Definition: otbLabelMapToSimulatedImageFilter.h:68
otb::LabelMapToSimulatedImageFilter::Superclass
itk::LabelMapFilter< TInputLabelMap, TOutputImage > Superclass
Definition: otbLabelMapToSimulatedImageFilter.h:61
otb::LabelToProSailParameters::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelToProSailParameters.h:75
otb::LabelMapToSimulatedImageFilter::SimulationStep1Type
TSimuStep1 SimulationStep1Type
Definition: otbLabelMapToSimulatedImageFilter.h:80
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::LabelMapToSimulatedImageFilter::InputLabelMapPointer
InputLabelMapType::Pointer InputLabelMapPointer
Definition: otbLabelMapToSimulatedImageFilter.h:67
otb::LabelMapToSimulatedImageFilter::Self
LabelMapToSimulatedImageFilter Self
Definition: otbLabelMapToSimulatedImageFilter.h:60
otb::LabelMapToSimulatedImageFilter
Transform a labelMap into an image.
Definition: otbLabelMapToSimulatedImageFilter.h:53
otb::LabelMapToSimulatedImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbLabelMapToSimulatedImageFilter.h:74
otb::LabelMapToSimulatedImageFilter::LabelObjectType
InputLabelMapType::LabelObjectType LabelObjectType
Definition: otbLabelMapToSimulatedImageFilter.h:69
otb::LabelMapToSimulatedImageFilter::OutputImageConstPointer
OutputImageType::ConstPointer OutputImageConstPointer
Definition: otbLabelMapToSimulatedImageFilter.h:75
otb::LabelMapToSimulatedImageFilter::m_Mean
double m_Mean
Definition: otbLabelMapToSimulatedImageFilter.h:142
otbReduceSpectralResponse.h
otb::LabelMapToSimulatedImageFilter::AttributesValueType
LabelObjectType::AttributesValueType AttributesValueType
Definition: otbLabelMapToSimulatedImageFilter.h:72
otbLabelMapToSimulatedImageFilter.hxx
otb::SatelliteRSR
This class represents a hierarchy of vector data.
Definition: otbSatelliteRSR.h:48
otb::LabelMapToSimulatedImageFilter::RandomGeneratorPointer
RandomGeneratorType::Pointer RandomGeneratorPointer
Definition: otbLabelMapToSimulatedImageFilter.h:98
otb::SatelliteRSR::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSatelliteRSR.h:54
otb::LabelMapToSimulatedImageFilter::SatelliteRSRPointer
SatelliteRSRType::Pointer SatelliteRSRPointer
Definition: otbLabelMapToSimulatedImageFilter.h:92
otb::LabelMapToSimulatedImageFilter::SpectralResponseType
SpectralResponse< double, double > SpectralResponseType
Definition: otbLabelMapToSimulatedImageFilter.h:89
otb::LabelMapToSimulatedImageFilter::InternalPixelType
OutputImageType::InternalPixelType InternalPixelType
Definition: otbLabelMapToSimulatedImageFilter.h:78
otbSatelliteRSR.h
otb::LabelMapToSimulatedImageFilter::LabelToParametersPointer
LabelToParametersType::Pointer LabelToParametersPointer
Definition: otbLabelMapToSimulatedImageFilter.h:87
otb::LabelMapToSimulatedImageFilter::SpectralResponsePointer
SpectralResponseType::Pointer SpectralResponsePointer
Definition: otbLabelMapToSimulatedImageFilter.h:90
otb::LabelMapToSimulatedImageFilter::ReduceSpectralResponsePointer
ReduceSpectralResponseType::Pointer ReduceSpectralResponsePointer
Definition: otbLabelMapToSimulatedImageFilter.h:95
otbGaussianAdditiveNoiseSampleListFilter.h
otb::LabelMapToSimulatedImageFilter::IndexType
OutputImageType::IndexType IndexType
Definition: otbLabelMapToSimulatedImageFilter.h:77
otb::LabelMapToSimulatedImageFilter::ReduceSpectralResponseType
ReduceSpectralResponse< SpectralResponseType, SatelliteRSRType > ReduceSpectralResponseType
Definition: otbLabelMapToSimulatedImageFilter.h:94
otbLabelToProSailParameters.h
otb::LabelMapToSimulatedImageFilter::SimulationStep2Pointer
SimulationStep2Type::Pointer SimulationStep2Pointer
Definition: otbLabelMapToSimulatedImageFilter.h:83
otb::LabelMapToSimulatedImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelMapToSimulatedImageFilter.h:62
otb::LabelMapToSimulatedImageFilter::SimulationStep2Type
TSimuStep2 SimulationStep2Type
Definition: otbLabelMapToSimulatedImageFilter.h:82
otb::SpectralResponse
This class represents the spectral response of an object (or a satellite band).
Definition: otbSpectralResponse.h:55
otb::LabelMapToSimulatedImageFilter::~LabelMapToSimulatedImageFilter
~LabelMapToSimulatedImageFilter() override
Definition: otbLabelMapToSimulatedImageFilter.h:124
otb::ReduceSpectralResponse::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbReduceSpectralResponse.h:71
otb::LabelMapToSimulatedImageFilter::m_Variance
double m_Variance
Definition: otbLabelMapToSimulatedImageFilter.h:145
otb::LabelMapToSimulatedImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbLabelMapToSimulatedImageFilter.h:63
otb::LabelMapToSimulatedImageFilter::InputLabelMapType
TInputLabelMap InputLabelMapType
Definition: otbLabelMapToSimulatedImageFilter.h:66
otb::LabelMapToSimulatedImageFilter::SatelliteRSRType
SatelliteRSR< double, double > SatelliteRSRType
Definition: otbLabelMapToSimulatedImageFilter.h:91
otb::LabelMapToSimulatedImageFilter::m_NumberOfComponentsPerPixel
unsigned int m_NumberOfComponentsPerPixel
Definition: otbLabelMapToSimulatedImageFilter.h:138
otb::LabelMapToSimulatedImageFilter::m_SatRSRFilename
std::string m_SatRSRFilename
Definition: otbLabelMapToSimulatedImageFilter.h:139