OTB  9.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-2022 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
otb::Functor::MaskMuParserFunctor::Superclass
itk::LightObject Superclass
Definition: otbMaskMuParserFunctor.h:65
otb::Functor::MaskMuParserFunctor::m_SpectralAngleFunctor
SpectralAngleFunctorType m_SpectralAngleFunctor
Definition: otbMaskMuParserFunctor.h:121
otb::Functor::BinarySpectralAngleFunctor< PixelType, PixelType, double >
otb::Functor::MaskMuParserFunctor::m_SpectralAngle
double m_SpectralAngle
Definition: otbMaskMuParserFunctor.h:118
otb::Functor::MaskMuParserFunctor::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbMaskMuParserFunctor.h:67
otb::Parser::FunctionMapType
std::map< std::string, int > FunctionMapType
Definition: otbParser.h:64
otb::Functor::MaskMuParserFunctor
Definition: otbMaskMuParserFunctor.h:61
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Functor::MaskMuParserFunctor::m_Parser
ParserType::Pointer m_Parser
Definition: otbMaskMuParserFunctor.h:109
otbMacro.h
otb::Functor::MaskMuParserFunctor::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMaskMuParserFunctor.h:66
otb::Functor::MaskMuParserFunctor::Self
MaskMuParserFunctor Self
Definition: otbMaskMuParserFunctor.h:64
otbBinarySpectralAngleFunctor.h
otb::Functor::MaskMuParserFunctor::ParserType
Parser ParserType
Definition: otbMaskMuParserFunctor.h:76
otb::Functor::MaskMuParserFunctor::PixelType
TInputPixel PixelType
Definition: otbMaskMuParserFunctor.h:73
otb::Functor::MaskMuParserFunctor::m_ParserResult
double m_ParserResult
Definition: otbMaskMuParserFunctor.h:114
otb::Functor::MaskMuParserFunctor::m_AImage
std::vector< double > m_AImage
Definition: otbMaskMuParserFunctor.h:110
otb::Functor::MaskMuParserFunctor::m_Expression
std::string m_Expression
Definition: otbMaskMuParserFunctor.h:108
otb::Functor::MaskMuParserFunctor::SpectralAngleFunctorType
BinarySpectralAngleFunctor< PixelType, PixelType, double > SpectralAngleFunctorType
Definition: otbMaskMuParserFunctor.h:78
otbMaskMuParserFunctor.hxx
otbParser.h
otb::Functor::MaskMuParserFunctor::m_NbOfBands
unsigned int m_NbOfBands
Definition: otbMaskMuParserFunctor.h:112
otb::Parser
Definition of the standard floating point parser. Standard implementation of the mathematical express...
Definition: otbParser.h:44
otb::Functor::MaskMuParserFunctor::m_Intensity
double m_Intensity
Definition: otbMaskMuParserFunctor.h:117
otb::Parser::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbParser.h:50
otb::Functor::MaskMuParserFunctor::m_SpectralAngleReferencePixel
PixelType m_SpectralAngleReferencePixel
Definition: otbMaskMuParserFunctor.h:120