OTB  10.0.0
Orfeo Toolbox
otbMaskMuParserFunctor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 
23 #ifndef otbMaskMuParserFunctor_h
24 #define otbMaskMuParserFunctor_h
25 
26 #include "otbParser.h"
27 #include "otbMacro.h"
29 #include <string>
30 
31 namespace otb
32 {
57 namespace Functor
58 {
59 
60 template <class TInputPixel>
61 class ITK_EXPORT MaskMuParserFunctor : public itk::LightObject
62 {
63 public:
65  typedef itk::LightObject Superclass;
66  typedef itk::SmartPointer<Self> Pointer;
67  typedef itk::SmartPointer<const Self> ConstPointer;
68 
70  itkNewMacro(Self);
71 
73  itkTypeMacro(MaskMuParserFunctor, itk::LightObject);
74 
75  typedef TInputPixel PixelType;
76  typedef Parser ParserType;
77 
79 
80  bool operator()(const PixelType& p);
81 
82  const std::map<std::string, Parser::ValueType*>& GetVar() const;
83 
84  Parser::FunctionMapType GetFunList() const;
85 
86  void SetExpression(const std::string& expression);
87 
89  std::string GetExpression() const;
90 
91  void SetNumberOfBands(unsigned int NbOfBands);
92 
94  void SetSpectralAngleReferencePixel(const PixelType& refPixel);
95 
97  bool CheckExpression();
98 
99 protected:
101 
102  ~MaskMuParserFunctor() override;
103 
104 private:
105  MaskMuParserFunctor(const Self&) = delete;
106  void operator=(const Self&) = delete;
107 
108  std::string m_Expression;
110  std::vector<double> m_AImage;
111  // std::vector<std::string > m_VarName;
112  unsigned int m_NbOfBands;
113  // unsigned int m_NbVar;
115 
116  // user defined variables
117  double m_Intensity;
119 
122 };
123 
124 } // end of Functor namespace
125 } // end namespace otb
126 
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
void operator=(const Self &)=delete
SpectralAngleFunctorType m_SpectralAngleFunctor
itk::SmartPointer< const Self > ConstPointer
MaskMuParserFunctor(const Self &)=delete
BinarySpectralAngleFunctor< PixelType, PixelType, double > SpectralAngleFunctorType
Definition of the standard floating point parser. Standard implementation of the mathematical express...
Definition: otbParser.h:46
std::map< std::string, int > FunctionMapType
Definition: otbParser.h:65
itk::SmartPointer< Self > Pointer
Definition: otbParser.h:51
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.