OTB  6.7.0
Orfeo Toolbox
otbSpectralSensitivityReader.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 otbSpectralSensitivityReader_h
22 #define otbSpectralSensitivityReader_h
23 
24 #include "itkProcessObject.h"
25 #include "itkImageBase.h"
26 #include "otbObjectList.h"
28 #include "OTBOpticalCalibrationExport.h"
29 #include <string>
30 
31 namespace otb
32 {
33 
44 class OTBOpticalCalibration_EXPORT SpectralSensitivityReader : public itk::ProcessObject
45 {
46 public:
52 
54  itkNewMacro(Self);
55 
58 
65 
67  itkGetConstMacro(FileName, std::string);
68  itkSetStringMacro(FileName);
70 
72  itkGetConstMacro(DataPath, std::string);
73  itkSetStringMacro(DataPath);
75 
77  virtual WavelengthSpectralBandVectorType * GetOutput(void);
78  virtual const WavelengthSpectralBandVectorType * GetOutput(void) const;
80 
82  itkSetObjectMacro(Image, ImageType);
83  itkGetConstObjectMacro(Image, ImageType);
85 
86 protected:
88  ~SpectralSensitivityReader() override;
89 
91  void GenerateData() override;
92 
94  void FindFileName();
95 
97  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
98 
100  struct BothAre
101 {
102  char c;
103  BothAre(char r) : c(r) {}
104  bool operator()(char l, char r) const
105  {
106  return r == c && l == c;
107  }
108 };
110 
111 
112 private:
113  SpectralSensitivityReader(const Self &) = delete;
114  void operator =(const Self&) = delete;
115 
116  std::string m_FileName;
117  std::string m_DataPath;
119 };
120 } // end namespace otb
121 
122 #endif
WavelengthSpectralBandVectorType::Pointer WavelengthSpectralBandVectorPointerType
Read a file that contains spectral sensitivity.
ObjectList< FilterFunctionValues > WavelengthSpectralBandVectorType
std::vector< WavelengthSpectralBandType > ValuesVectorType
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >...
Definition: otbObjectList.h:40
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
FilterFunctionValues::Pointer FFVFPointerType
itk::SmartPointer< const Self > ConstPointer
FilterFunctionValues::ValuesVectorType ValuesVectorType