OTB  9.0.0
Orfeo Toolbox
otbImageSimulationMethod.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 otbImageSimulationMethod_h
23 #define otbImageSimulationMethod_h
24 
25 
26 #include "itkImageSource.h"
27 #include "otbProspectModel.h"
28 #include "otbSailModel.h"
30 
32 #include "otbImageList.h"
34 
35 //#include "otbStreamingResampleImageFilter.h"
36 #include "itkResampleImageFilter.h"
38 #include "itkLabelMapToLabelImageFilter.h"
39 #include <string>
40 
41 namespace otb
42 {
43 
62 template <class TInputVectorData, class TSpatialisation, class TSimulationStep1, class TSimulationStep2, class TFTM, class TOutputImage>
63 class ITK_EXPORT ImageSimulationMethod : public itk::ImageSource<TOutputImage>
64 
65 {
66 public:
71  typedef itk::ImageSource<TOutputImage> Superclass;
72  typedef itk::SmartPointer<Self> Pointer;
73  typedef itk::SmartPointer<const Self> ConstPointer;
74 
76  typedef TInputVectorData InputVectorDataType;
77  typedef typename InputVectorDataType::Pointer InputVectorDataPointer;
78  typedef typename InputVectorDataType::ConstPointer InputVectorDataConstPointer;
79 
80  typedef TSpatialisation SpatialisationType;
81  typedef typename SpatialisationType::Pointer SpatialisationPointer;
82  typedef typename SpatialisationType::OutputLabelMapType LabelMapType;
83  typedef typename LabelMapType::LabelObjectType::LabelType LabelType;
84  typedef TSimulationStep1 SimulationStep1Type;
85  typedef typename SimulationStep1Type::Pointer SimulationStep1Pointer;
86  typedef TSimulationStep2 SimulationStep2Type;
87  typedef typename SimulationStep2Type::Pointer SimulationStep2Pointer;
88  typedef TFTM FTMType;
89  typedef typename FTMType::Pointer FTMPointer;
90 
91  typedef TOutputImage OutputImageType;
92  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
93  typedef typename OutputImageType::Pointer OutputImagePointer;
94  typedef typename OutputImageType::IndexType IndexType;
95  typedef typename OutputImageType::InternalPixelType InternalPixelType;
97 
100 
108 
111  typedef itk::ResampleImageFilter<SingleImageType, SingleImageType, double> FTMFilterType;
112  // typedef otb::StreamingResampleImageFilter<SingleImageType, SingleImageType, double> FTMFilterType;
113  typedef typename FTMFilterType::Pointer FTMFilterPointer;
114 
115  typedef itk::LabelMapToLabelImageFilter<LabelMapType, OutputLabelImageType> LabelMapToLabelImageFilterType;
116  typedef typename LabelMapToLabelImageFilterType::Pointer LabelMapToLabelImageFilterPointer;
117 
119  itkTypeMacro(ImageSimulationMethod, ImageSource);
120  ;
121  itkNewMacro(Self);
122  ;
124 
125  itkSetMacro(NumberOfComponentsPerPixel, unsigned int);
126  ;
127  itkGetMacro(NumberOfComponentsPerPixel, unsigned int);
128  ;
129 
130  // prolate radius
131  itkSetMacro(Radius, unsigned int);
132  ;
133  itkGetMacro(Radius, unsigned int);
134  ;
135 
136  itkSetMacro(SatRSRFilename, std::string);
137  ;
138  itkGetMacro(SatRSRFilename, std::string);
139  ;
140 
141  itkSetMacro(PathRoot, std::string);
142  ;
143  itkGetMacro(PathRoot, std::string);
144  ;
145 
146  itkSetMacro(Mean, double);
147  ;
148  itkGetMacro(Mean, double);
149  ;
150 
151  itkSetMacro(Variance, double);
152  ;
153  itkGetMacro(Variance, double);
154  ;
155 
156  itkSetObjectMacro(Spatialisation, SpatialisationType);
157  ;
158  // itkSetObjectMacro(LabelMapToSimulatedImage, LabelMapToSimulatedImageType);
159  // itkSetObjectMacro(FTM, FTMType);
160 
161 
163  itkSetObjectMacro(InputVectorData, InputVectorDataType);
164  ;
165  itkGetConstObjectMacro(InputVectorData, InputVectorDataType);
166  ;
167  // void SetInput(const InputVectorDataType *object);
168  // InputVectorDataType * GetInput();
170 
172  virtual OutputLabelImageType* GetOutputLabelImage();
173  virtual OutputImageType* GetOutputReflectanceImage();
175 
176  void UpdateData();
177 
178 protected:
181  {
182  }
183  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
184 
185  // virtual void GenerateData();
186  void GenerateOutputInformation() override;
187 
188 private:
189  ImageSimulationMethod(const Self&) = delete;
190  void operator=(const Self&) = delete;
191 
193  unsigned int m_Radius; // radius of prolate interpolate
194  std::string m_SatRSRFilename;
195  std::string m_PathRoot;
196  double m_Mean;
197  double m_Variance;
198 
202  // FTMPointer m_FTM;
203  std::vector<MultiToMonoChannelFilterPointer> m_MultiToMonoChannelFilterList;
206 
207  std::vector<FTMFilterPointer> m_FTMFilterList;
208  std::vector<InterpolatorPointer> m_InterpolatorList;
209 
211 };
212 
213 } // end namespace itk
214 
215 #ifndef OTB_MANUAL_INSTANTIATION
217 #endif
218 
219 #endif
otbImageList.h
otb::ImageSimulationMethod::SimulationStep2Pointer
SimulationStep2Type::Pointer SimulationStep2Pointer
Definition: otbImageSimulationMethod.h:87
otb::ImageSimulationMethod::m_Mean
double m_Mean
Definition: otbImageSimulationMethod.h:196
otb::MultiToMonoChannelExtractROI::OutputImageType
Superclass::OutputImageType OutputImageType
Definition: otbMultiToMonoChannelExtractROI.h:66
otb::ImageSimulationMethod::Superclass
itk::ImageSource< TOutputImage > Superclass
Definition: otbImageSimulationMethod.h:71
otb::ImageSimulationMethod::Self
ImageSimulationMethod Self
Definition: otbImageSimulationMethod.h:70
otb::ImageSimulationMethod::SimulationStep1Type
TSimulationStep1 SimulationStep1Type
Definition: otbImageSimulationMethod.h:84
otbImageListToVectorImageFilter.h
otb::ImageSimulationMethod::InterpolatorPointer
InterpolatorType::Pointer InterpolatorPointer
Definition: otbImageSimulationMethod.h:110
otb::ImageSimulationMethod::m_ImageList
ImageListPointer m_ImageList
Definition: otbImageSimulationMethod.h:204
otb::MultiToMonoChannelExtractROI::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMultiToMonoChannelExtractROI.h:55
otb::ImageSimulationMethod::IndexType
OutputImageType::IndexType IndexType
Definition: otbImageSimulationMethod.h:94
otb::ImageSimulationMethod::InternalPixelType
OutputImageType::InternalPixelType InternalPixelType
Definition: otbImageSimulationMethod.h:95
otb::ImageSimulationMethod::m_InputVectorData
InputVectorDataPointer m_InputVectorData
Definition: otbImageSimulationMethod.h:199
otb::ImageSimulationMethod::m_Radius
unsigned int m_Radius
Definition: otbImageSimulationMethod.h:193
otb::ImageSimulationMethod::m_InterpolatorList
std::vector< InterpolatorPointer > m_InterpolatorList
Definition: otbImageSimulationMethod.h:208
otb::ImageSimulationMethod::LabelMapToSimulatedImageFilterType
otb::LabelMapToSimulatedImageFilter< LabelMapType, SimulationStep1Type, SimulationStep2Type, OutputImageType > LabelMapToSimulatedImageFilterType
Definition: otbImageSimulationMethod.h:98
otb::ImageSimulationMethod::LabelMapToLabelImageFilterPointer
LabelMapToLabelImageFilterType::Pointer LabelMapToLabelImageFilterPointer
Definition: otbImageSimulationMethod.h:116
otb::ImageSimulationMethod::SpatialisationType
TSpatialisation SpatialisationType
Definition: otbImageSimulationMethod.h:80
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::ImageSimulationMethod::SimulationStep1Pointer
SimulationStep1Type::Pointer SimulationStep1Pointer
Definition: otbImageSimulationMethod.h:85
otb::LabelMapToSimulatedImageFilter
Transform a labelMap into an image.
Definition: otbLabelMapToSimulatedImageFilter.h:53
otb::ImageListToVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageListToVectorImageFilter.h:48
otb::ImageSimulationMethod::~ImageSimulationMethod
~ImageSimulationMethod() override
Definition: otbImageSimulationMethod.h:180
otb::ImageSimulationMethod::LabelMapToLabelImageFilterType
itk::LabelMapToLabelImageFilter< LabelMapType, OutputLabelImageType > LabelMapToLabelImageFilterType
Definition: otbImageSimulationMethod.h:115
otb::ImageSimulationMethod::SimulationStep2Type
TSimulationStep2 SimulationStep2Type
Definition: otbImageSimulationMethod.h:86
otb::ImageSimulationMethod::ImageListToVectorImageFilterPointer
ImageListToVectorImageFilterType::Pointer ImageListToVectorImageFilterPointer
Definition: otbImageSimulationMethod.h:107
otb::ImageSimulationMethod::m_PathRoot
std::string m_PathRoot
Definition: otbImageSimulationMethod.h:195
otb::ImageSimulationMethod::ImageListPointer
ImageListType::Pointer ImageListPointer
Definition: otbImageSimulationMethod.h:105
otb::ImageListToVectorImageFilter
Converts an ImageList to a VectorImage.
Definition: otbImageListToVectorImageFilter.h:42
otb::ImageSimulationMethod::LabelMapToSimulatedImageFilterPointer
LabelMapToSimulatedImageFilterType::Pointer LabelMapToSimulatedImageFilterPointer
Definition: otbImageSimulationMethod.h:99
otb::ImageSimulationMethod::LabelType
LabelMapType::LabelObjectType::LabelType LabelType
Definition: otbImageSimulationMethod.h:83
otb::ImageSimulationMethod::InputVectorDataConstPointer
InputVectorDataType::ConstPointer InputVectorDataConstPointer
Definition: otbImageSimulationMethod.h:78
otb::ImageSimulationMethod::m_LabelMapToSimulatedImageFilter
LabelMapToSimulatedImageFilterPointer m_LabelMapToSimulatedImageFilter
Definition: otbImageSimulationMethod.h:201
otb::ImageSimulationMethod::m_MultiToMonoChannelFilterList
std::vector< MultiToMonoChannelFilterPointer > m_MultiToMonoChannelFilterList
Definition: otbImageSimulationMethod.h:203
otb::ImageList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageList.h:45
otb::ImageSimulationMethod::FTMFilterType
itk::ResampleImageFilter< SingleImageType, SingleImageType, double > FTMFilterType
Definition: otbImageSimulationMethod.h:111
otb::ImageSimulationMethod::InterpolatorType
otb::ProlateInterpolateImageFunction< SingleImageType > InterpolatorType
Definition: otbImageSimulationMethod.h:109
otb::ImageSimulationMethod::FTMType
TFTM FTMType
Definition: otbImageSimulationMethod.h:88
otb::ImageSimulationMethod::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageSimulationMethod.h:72
otbLabelMapToSimulatedImageFilter.h
otb::ImageSimulationMethod::MultiToMonoChannelFilterPointer
MultiToMonoChannelFilterType::Pointer MultiToMonoChannelFilterPointer
Definition: otbImageSimulationMethod.h:102
otb::MultiToMonoChannelExtractROI
Extract a mono channel part of a multi-channel image.
Definition: otbMultiToMonoChannelExtractROI.h:46
otb::ImageSimulationMethod::m_NumberOfComponentsPerPixel
unsigned int m_NumberOfComponentsPerPixel
Definition: otbImageSimulationMethod.h:192
otb::ImageSimulationMethod::InputVectorDataType
TInputVectorData InputVectorDataType
Definition: otbImageSimulationMethod.h:76
otb::ImageSimulationMethod::m_ImageListToVectorImageFilter
ImageListToVectorImageFilterPointer m_ImageListToVectorImageFilter
Definition: otbImageSimulationMethod.h:205
otbProspectModel.h
otbMultiToMonoChannelExtractROI.h
otb::ImageSimulationMethod::FTMPointer
FTMType::Pointer FTMPointer
Definition: otbImageSimulationMethod.h:89
otb::ImageSimulationMethod::OutputImageConstPointer
OutputImageType::ConstPointer OutputImageConstPointer
Definition: otbImageSimulationMethod.h:92
otb::ImageSimulationMethod::OutputImagePointer
OutputImageType::Pointer OutputImagePointer
Definition: otbImageSimulationMethod.h:93
otb::ImageSimulationMethod::ImageListToVectorImageFilterType
otb::ImageListToVectorImageFilter< ImageListType, OutputImageType > ImageListToVectorImageFilterType
Definition: otbImageSimulationMethod.h:106
otbSailModel.h
otbImageSimulationMethod.hxx
otb::ProlateInterpolateImageFunction::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbProlateInterpolateImageFunction.h:217
otb::ImageSimulationMethod::OutputLabelImageType
otb::Image< LabelType, 2 > OutputLabelImageType
Definition: otbImageSimulationMethod.h:96
otb::ImageSimulationMethod::m_LabelMapToLabelImageFilter
LabelMapToLabelImageFilterPointer m_LabelMapToLabelImageFilter
Definition: otbImageSimulationMethod.h:210
otb::ImageList
This class represent a list of images.
Definition: otbImageList.h:39
otb::ImageSimulationMethod::LabelMapType
SpatialisationType::OutputLabelMapType LabelMapType
Definition: otbImageSimulationMethod.h:82
otb::ImageSimulationMethod::m_Variance
double m_Variance
Definition: otbImageSimulationMethod.h:197
otbProlateInterpolateImageFunction.h
otb::ImageSimulationMethod::SpatialisationPointer
SpatialisationType::Pointer SpatialisationPointer
Definition: otbImageSimulationMethod.h:81
otb::ImageSimulationMethod::FTMFilterPointer
FTMFilterType::Pointer FTMFilterPointer
Definition: otbImageSimulationMethod.h:113
otb::ImageSimulationMethod::m_SatRSRFilename
std::string m_SatRSRFilename
Definition: otbImageSimulationMethod.h:194
otb::ImageSimulationMethod::m_FTMFilterList
std::vector< FTMFilterPointer > m_FTMFilterList
Definition: otbImageSimulationMethod.h:207
otb::ImageSimulationMethod::m_Spatialisation
SpatialisationPointer m_Spatialisation
Definition: otbImageSimulationMethod.h:200
otb::ImageSimulationMethod::InputVectorDataPointer
InputVectorDataType::Pointer InputVectorDataPointer
Definition: otbImageSimulationMethod.h:77
otb::ImageSimulationMethod
Image simulation method.
Definition: otbImageSimulationMethod.h:63
otb::LabelMapToSimulatedImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbLabelMapToSimulatedImageFilter.h:62
otb::ImageSimulationMethod::SingleImageType
MultiToMonoChannelFilterType::OutputImageType SingleImageType
Definition: otbImageSimulationMethod.h:103
otb::ImageSimulationMethod::ImageListType
otb::ImageList< SingleImageType > ImageListType
Definition: otbImageSimulationMethod.h:104
otb::ImageSimulationMethod::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbImageSimulationMethod.h:73
otb::ImageSimulationMethod::OutputImageType
TOutputImage OutputImageType
Definition: otbImageSimulationMethod.h:91
otb::ImageSimulationMethod::MultiToMonoChannelFilterType
otb::MultiToMonoChannelExtractROI< double, double > MultiToMonoChannelFilterType
Definition: otbImageSimulationMethod.h:101
otb::ProlateInterpolateImageFunction
Prolate interpolation of an otb::image.
Definition: otbProlateInterpolateImageFunction.h:208