OTB  9.0.0
Orfeo Toolbox
otbSpectralSensitivityReader.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 #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 #include "otbImageMetadata.h"
31 
32 namespace otb
33 {
34 
45 class OTBOpticalCalibration_EXPORT SpectralSensitivityReader : public itk::ProcessObject
46 {
47 public:
50  typedef itk::ProcessObject Superclass;
51  typedef itk::SmartPointer<Self> Pointer;
52  typedef itk::SmartPointer<const Self> ConstPointer;
53 
55  itkNewMacro(Self);
56 
58  itkTypeMacro(SpectralSensitivityReader, itk::ProcessObject);
59 
64 
66  itkGetConstMacro(FileName, std::string);
67  itkSetStringMacro(FileName);
69 
71  itkGetConstMacro(DataPath, std::string);
72  itkSetStringMacro(DataPath);
74 
76  virtual WavelengthSpectralBandVectorType* GetOutput(void);
77  virtual const WavelengthSpectralBandVectorType* GetOutput(void) const;
79 
81  void SetImageMetadata(const ImageMetadata * imd)
82  {
83  m_ImageMetadata = imd;
84  }
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  {
105  }
106  bool operator()(char l, char r) const
107  {
108  return r == c && l == c;
109  }
110  };
112 
113 
114 private:
115  SpectralSensitivityReader(const Self&) = delete;
116  void operator=(const Self&) = delete;
117 
118  std::string m_FileName;
119  std::string m_DataPath;
120  const ImageMetadata * m_ImageMetadata = nullptr;
121 };
122 } // end namespace otb
123 
124 #endif
otb::FilterFunctionValues::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbFilterFunctionValues.h:50
otb::SpectralSensitivityReader::FFVFPointerType
FilterFunctionValues::Pointer FFVFPointerType
Definition: otbSpectralSensitivityReader.h:58
otb::SpectralSensitivityReader
Read a file that contains spectral sensitivity.
Definition: otbSpectralSensitivityReader.h:45
otb::SpectralSensitivityReader::ValuesVectorType
FilterFunctionValues::ValuesVectorType ValuesVectorType
Definition: otbSpectralSensitivityReader.h:61
otb::SpectralSensitivityReader::m_DataPath
std::string m_DataPath
Definition: otbSpectralSensitivityReader.h:119
otb::SpectralSensitivityReader::WavelengthSpectralBandVectorType
ObjectList< FilterFunctionValues > WavelengthSpectralBandVectorType
Definition: otbSpectralSensitivityReader.h:62
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ObjectList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
otb::SpectralSensitivityReader::BothAre
Definition: otbSpectralSensitivityReader.h:100
otb::SpectralSensitivityReader::SetImageMetadata
void SetImageMetadata(const ImageMetadata *imd)
Definition: otbSpectralSensitivityReader.h:81
otb::SpectralSensitivityReader::BothAre::BothAre
BothAre(char r)
Definition: otbSpectralSensitivityReader.h:103
otb::SpectralSensitivityReader::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSpectralSensitivityReader.h:51
otbObjectList.h
otb::SpectralSensitivityReader::m_FileName
std::string m_FileName
Definition: otbSpectralSensitivityReader.h:118
otb::SpectralSensitivityReader::WavelengthSpectralBandVectorPointerType
WavelengthSpectralBandVectorType::Pointer WavelengthSpectralBandVectorPointerType
Definition: otbSpectralSensitivityReader.h:63
otb::SpectralSensitivityReader::Superclass
itk::ProcessObject Superclass
Definition: otbSpectralSensitivityReader.h:50
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::SpectralSensitivityReader::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSpectralSensitivityReader.h:52
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otbFilterFunctionValues.h
otb::SpectralSensitivityReader::BothAre::operator()
bool operator()(char l, char r) const
Definition: otbSpectralSensitivityReader.h:106
otbImageMetadata.h
otb::SpectralSensitivityReader::BothAre::c
char c
Definition: otbSpectralSensitivityReader.h:102
otb::SpectralSensitivityReader::Self
SpectralSensitivityReader Self
Definition: otbSpectralSensitivityReader.h:49
otb::FilterFunctionValues::ValuesVectorType
std::vector< WavelengthSpectralBandType > ValuesVectorType
Definition: otbFilterFunctionValues.h:60