OTB  6.7.0
Orfeo Toolbox
otbReduceSpectralResponse.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 otbReduceSpectralResponse_h
22 #define otbReduceSpectralResponse_h
23 
24 
25 #include "itkDataObject.h"
26 #include <itkObjectFactory.h>
27 #include <vector>
28 #include <utility>
29 #include <limits>
30 
31 namespace otb
32 {
63 template <class TSpectralResponse , class TRSR>
65 {
66 
67 public:
68 
74 
76  typedef TSpectralResponse InputSpectralResponseType;
77  typedef TRSR InputRSRType;
78 
79  typedef typename InputSpectralResponseType::PairType PairType;
80  typedef typename InputRSRType::Pointer InputRSRPointerType;
81  typedef typename InputSpectralResponseType::Pointer InputSpectralResponsePointerType;
82 
83  typedef typename InputRSRType::PrecisionType PrecisionType;
84  typedef typename InputRSRType::ValuePrecisionType ValuePrecisionType;
85 
86  typedef typename InputSpectralResponseType::VectorPairType VectorPairType;
87 
88  //TODO need a specific class for the integration of stectral responses (now it is in the functor)
89  typedef typename InputRSRType::RSRVectorType RSRVectorType;
90  typedef typename std::vector<ValuePrecisionType> ReduceSpectralResponseVectorType;
92  itkNewMacro(Self);
93 ; itkTypeMacro(ReduceSpectralResponse, DataObject);
94 ;
96 
97  itkGetConstObjectMacro(InputSatRSR, InputRSRType);
98 ; itkSetObjectMacro(InputSatRSR, InputRSRType);
99 ;
100 
101  itkGetConstObjectMacro(InputSpectralResponse, InputSpectralResponseType);
102 ; itkSetObjectMacro(InputSpectralResponse, InputSpectralResponseType);
103 ;
104 
107 ;
109 
110  itkSetMacro(ReflectanceMode, bool);
111  itkGetConstMacro(ReflectanceMode, bool);
112 
114  virtual bool Clear();
115 
117  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
118 
123  inline ValuePrecisionType operator()(const unsigned int numBand);
124 
126  void CalculateResponse();
127 
129  void LoadInputsFromFiles(const std::string & spectralResponseFile, const std::string & RSRFile,
130  const unsigned int nbRSRBands, ValuePrecisionType coefNormSpectre = 1.0,
131  ValuePrecisionType coefNormRSR = 1.0);
132 
133 protected:
136 
138  //ReduceSpectralResponse( const std::string & filename );
139 
142  {
143  }
144 ;
145 
147  //void PrintSelf(std::ostream& os, itk::Indent indent) const;
148 
151 
154 
155 private:
156  ReduceSpectralResponse(const Self&) = delete;
157  void operator=(const Self&) = delete;
158 
161 
164 };
165 
166 }// end namespace otb
167 
168 
169 #ifndef OTB_MANUAL_INSTANTIATION
171 #endif
172 
173 #endif
174 
itk::SmartPointer< const Self > ConstPointer
InputRSRType::RSRVectorType RSRVectorType
void operator=(const Self &)=delete
InputSpectralResponseType::Pointer InputSpectralResponsePointerType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::SmartPointer< Self > Pointer
InputSpectralResponsePointerType m_InputSpectralResponse
InputRSRType::Pointer InputRSRPointerType
InputSpectralResponseType::VectorPairType VectorPairType
std::vector< ValuePrecisionType > ReduceSpectralResponseVectorType
ValuePrecisionType operator()(const unsigned int numBand)
InputRSRType::PrecisionType PrecisionType
InputSpectralResponsePointerType m_ReduceResponse
This class computes the reduced spectral response of each band of a sensor.
InputRSRType::ValuePrecisionType ValuePrecisionType
void LoadInputsFromFiles(const std::string &spectralResponseFile, const std::string &RSRFile, const unsigned int nbRSRBands, ValuePrecisionType coefNormSpectre=1.0, ValuePrecisionType coefNormRSR=1.0)
InputSpectralResponseType::PairType PairType
itkGetObjectMacro(ReduceResponse, InputSpectralResponseType)