OTB  10.0.0
Orfeo Toolbox
otbSpectralSensitivityReader.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 #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 
77  virtual const WavelengthSpectralBandVectorType* GetOutput(void) const;
79 
81  void SetImageMetadata(const ImageMetadata * imd)
82  {
83  m_ImageMetadata = imd;
84  }
85 
86 protected:
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
std::vector< WavelengthSpectralBandType > ValuesVectorType
itk::SmartPointer< Self > Pointer
Generic class containing image metadata used in OTB.
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:41
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
Read a file that contains spectral sensitivity.
ObjectList< FilterFunctionValues > WavelengthSpectralBandVectorType
SpectralSensitivityReader(const Self &)=delete
itk::SmartPointer< const Self > ConstPointer
WavelengthSpectralBandVectorType::Pointer WavelengthSpectralBandVectorPointerType
virtual const WavelengthSpectralBandVectorType * GetOutput(void) const
FilterFunctionValues::Pointer FFVFPointerType
FilterFunctionValues::ValuesVectorType ValuesVectorType
void SetImageMetadata(const ImageMetadata *imd)
virtual WavelengthSpectralBandVectorType * GetOutput(void)
void operator=(const Self &)=delete
void PrintSelf(std::ostream &os, itk::Indent indent) const override
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.