OTB  10.0.0
Orfeo Toolbox
otbImageSimulationMethod.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 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
Converts an ImageList to a VectorImage.
This class represent a list of images.
Definition: otbImageList.h:40
itk::SmartPointer< Self > Pointer
Definition: otbImageList.h:45
void operator=(const Self &)=delete
otb::ProlateInterpolateImageFunction< SingleImageType > InterpolatorType
LabelMapToSimulatedImageFilterType::Pointer LabelMapToSimulatedImageFilterPointer
InputVectorDataType::Pointer InputVectorDataPointer
InterpolatorType::Pointer InterpolatorPointer
MultiToMonoChannelFilterType::Pointer MultiToMonoChannelFilterPointer
ImageSimulationMethod(const Self &)=delete
LabelMapToLabelImageFilterType::Pointer LabelMapToLabelImageFilterPointer
OutputImageType::ConstPointer OutputImageConstPointer
SpatialisationType::OutputLabelMapType LabelMapType
LabelMapType::LabelObjectType::LabelType LabelType
FTMFilterType::Pointer FTMFilterPointer
InputVectorDataType::ConstPointer InputVectorDataConstPointer
SimulationStep2Type::Pointer SimulationStep2Pointer
SimulationStep1Type::Pointer SimulationStep1Pointer
ImageListToVectorImageFilterType::Pointer ImageListToVectorImageFilterPointer
otb::MultiToMonoChannelExtractROI< double, double > MultiToMonoChannelFilterType
otb::LabelMapToSimulatedImageFilter< LabelMapType, SimulationStep1Type, SimulationStep2Type, OutputImageType > LabelMapToSimulatedImageFilterType
OutputImageType::InternalPixelType InternalPixelType
InputVectorDataPointer m_InputVectorData
std::vector< MultiToMonoChannelFilterPointer > m_MultiToMonoChannelFilterList
LabelMapToSimulatedImageFilterPointer m_LabelMapToSimulatedImageFilter
OutputImageType::Pointer OutputImagePointer
itk::ImageSource< TOutputImage > Superclass
ImageListType::Pointer ImageListPointer
ImageListToVectorImageFilterPointer m_ImageListToVectorImageFilter
LabelMapToLabelImageFilterPointer m_LabelMapToLabelImageFilter
otb::Image< LabelType, 2 > OutputLabelImageType
SpatialisationType::Pointer SpatialisationPointer
MultiToMonoChannelFilterType::OutputImageType SingleImageType
SpatialisationPointer m_Spatialisation
itk::LabelMapToLabelImageFilter< LabelMapType, OutputLabelImageType > LabelMapToLabelImageFilterType
std::vector< FTMFilterPointer > m_FTMFilterList
std::vector< InterpolatorPointer > m_InterpolatorList
otb::ImageList< SingleImageType > ImageListType
itk::SmartPointer< const Self > ConstPointer
itk::ResampleImageFilter< SingleImageType, SingleImageType, double > FTMFilterType
itk::SmartPointer< Self > Pointer
otb::ImageListToVectorImageFilter< ImageListType, OutputImageType > ImageListToVectorImageFilterType
OutputImageType::IndexType IndexType
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
Extract a mono channel part of a multi-channel image.
Prolate interpolation of an otb::image.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.