OTB  5.0.0
Orfeo Toolbox
otbMassOfBelief.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbMassOfBelief_h
19 #define __otbMassOfBelief_h
20 
21 #include "itkDataObject.h"
22 #include "itkObjectFactory.h"
23 #include "itkNumericTraits.h"
24 
25 #include <set>
26 #include <map>
27 #include <ostream>
28 
29 
30 namespace otb
31 {
32 
86 template <class TLabel = unsigned short, class TMass = double>
87 class ITK_EXPORT MassOfBelief : public itk::DataObject
88 {
89 public:
91  typedef MassOfBelief Self;
95 
97  itkNewMacro(Self);
98 
100  itkTypeMacro(MassOfBelief, DataObject);
101 
102  typedef TLabel LabelType;
103  typedef TMass MassType;
104  typedef std::set<LabelType> LabelSetType;
105  typedef std::map<LabelSetType, MassType> MassMapType;
106  typedef std::set<LabelSetType> LabelSetOfSetType;
107 
109  void SetMass(const LabelSetType & labelSet, const MassType & mass);
110 
113  MassType GetMass(const LabelSetType & labelSet) const;
114 
116  void RemoveMass(const LabelSetType & labelSet);
117 
121  LabelSetOfSetType GetSupport() const;
122 
124  LabelSetType GetUniverse() const;
125 
127  void Normalize();
128 
131  void EstimateUncertainty();
132 
134  void Clear();
135 
141  void InitializePowerSetMasses(const LabelSetType & universe);
142 
144  MassType GetBelief(const LabelSetType & labelSet) const;
145 
147  MassType GetPlausibility(const LabelSetType & labelSet) const;
148 
151  MassType GetBelief(const LabelSetOfSetType & containedLabelSet) const;
152 
155  MassType GetPlausibility(const LabelSetOfSetType & intersectedLabelSet) const;
156 
158  void Copy(const Self * massOfBelief);
159 
161  bool IsEmpty() const;
162 
166  static std::ostream & PrintLabelSet(std::ostream & out,
167  const LabelSetType & labelSet);
168 
172  static std::ostream & PrintLabelSetOfSet(std::ostream & out,
173  const LabelSetOfSetType & labelSet);
174 
175 protected:
178 
180  virtual ~MassOfBelief() {}
181 
183  void PrintSelf(std::ostream& os, itk::Indent indent) const;
184 
185 private:
186  MassOfBelief(const Self&); //purposely not implemented
187  void operator=(const Self&); //purposely not implemented
188 
191 };
192 
193 } // end namespace otb
194 
195 
196 #ifndef OTB_MANUAL_INSTANTIATION
197 #include "otbMassOfBelief.txx"
198 #endif
199 
200 #endif
itk::SmartPointer< Self > Pointer
This class represent a mass of belief function.
std::set< LabelSetType > LabelSetOfSetType
MassMapType m_MassesMap
std::map< LabelSetType, MassType > MassMapType
MassOfBelief Self
itk::SmartPointer< const Self > ConstPointer
std::set< LabelType > LabelSetType
itk::DataObject Superclass