OTB  6.7.0
Orfeo Toolbox
otbWrapperInputImageParameter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 #ifndef otbWrapperInputImageParameter_h
22 #define otbWrapperInputImageParameter_h
23 
24 
25 #include "otbImageFileReader.h"
26 #include "otbClampImageFilter.h"
27 #include "otbWrapperParameter.h"
28 
29 #include "itkImageBase.h"
30 
31 #include <string>
32 
33 namespace otb
34 {
35 namespace Wrapper
36 {
43 class OTBApplicationEngine_EXPORT InputImageParameter : public Parameter
44 {
45 public:
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(InputImageParameter, Parameter);
57 
59  bool SetFromFileName( const std::string & filename );
60  itkGetConstReferenceMacro( FileName, std::string );
62 
63 
65  ImageBaseType const* GetImage() const;
66  ImageBaseType* GetImage();
68 
70  UInt8ImageType* GetUInt8Image();
71  UInt16ImageType* GetUInt16Image();
72  Int16ImageType* GetInt16Image();
73  UInt32ImageType* GetUInt32Image();
74  Int32ImageType* GetInt32Image();
75  FloatImageType* GetFloatImage();
76  DoubleImageType* GetDoubleImage();
78 
79  UInt8VectorImageType* GetUInt8VectorImage();
80  UInt16VectorImageType* GetUInt16VectorImage();
81  Int16VectorImageType* GetInt16VectorImage();
82  UInt32VectorImageType* GetUInt32VectorImage();
83  Int32VectorImageType* GetInt32VectorImage();
84  FloatVectorImageType* GetFloatVectorImage();
85  DoubleVectorImageType* GetDoubleVectorImage();
86 
87  UInt8RGBImageType* GetUInt8RGBImage();
88  UInt8RGBAImageType* GetUInt8RGBAImage();
89 
90  // Complex image
91  ComplexInt16ImageType* GetComplexInt16Image();
92  ComplexInt32ImageType* GetComplexInt32Image();
93  ComplexFloatImageType* GetComplexFloatImage();
94  ComplexDoubleImageType* GetComplexDoubleImage();
95 
96  ComplexInt16VectorImageType* GetComplexInt16VectorImage();
97  ComplexInt32VectorImageType* GetComplexInt32VectorImage();
98  ComplexFloatVectorImageType* GetComplexFloatVectorImage();
99  ComplexDoubleVectorImageType* GetComplexDoubleVectorImage();
100 
102  template <class TImageType>
103  TImageType* GetImage();
104 
106  void SetImage(ImageBaseType* image);
107 
108 
110  template <class TInputImage, class TOutputImage>
111  TOutputImage* CastImage();
112 
113  bool HasValue() const override;
114  void ClearValue() override;
115 
116  ParameterType GetType() const override;
117  std::string ToString() const override;
118  void FromString(const std::string& value) override;
119 
120 protected:
123 
125  ~InputImageParameter() override;
126 
127 private:
128  InputImageParameter(const Parameter&) = delete;
129  void operator=(const Parameter&) = delete;
130 
131  std::string m_FileName;
133 
135 
138 
139 private:
141  template <typename T>
143 
145  template <typename T>
147 
149  template <typename TOutputImage, typename TInputImage>
150  TOutputImage* Cast(TInputImage*);
151 
153  std::string m_PreviousFileName;
154 
157 
158 }; // End class InputImage Parameter
159 
160 } // End namespace Wrapper
161 } // End namespace otb
162 
163 #ifndef OTB_MANUAL_INSTANTIATION
165 #endif
166 
167 #endif
Creation of an "otb" vector image which contains metadata.
itk::SmartPointer< const Self > ConstPointer
This class represent a parameter for the wrapper framework This class is a high level class represent...
Clamp image values to be below, over, or between threhold values.
This class represents a InputImage parameter.
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
OTBApplicationEngine_EXPORT MDType GetType(const std::string &val)
const char * ToString(const QString &str)
Append the content of a StringVector object to the content of a QStringList object.
Definition: mvdAlgorithm.h:521