Orfeo Toolbox  4.2
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 
84 template <class TLabel = unsigned short, class TMass = double>
85 class ITK_EXPORT MassOfBelief : public itk::DataObject
86 {
87 public:
89  typedef MassOfBelief Self;
93 
95  itkNewMacro(Self);
96 
98  itkTypeMacro(MassOfBelief, DataObject);
99 
100  typedef TLabel LabelType;
101  typedef TMass MassType;
102  typedef std::set<LabelType> LabelSetType;
103  typedef std::map<LabelSetType, MassType> MassMapType;
104  typedef std::set<LabelSetType> LabelSetOfSetType;
105 
107  void SetMass(const LabelSetType & labelSet, const MassType & mass);
108 
111  MassType GetMass(const LabelSetType & labelSet) const;
112 
114  void RemoveMass(const LabelSetType & labelSet);
115 
119  LabelSetOfSetType GetSupport() const;
120 
122  LabelSetType GetUniverse() const;
123 
125  void Normalize();
126 
129  void EstimateUncertainty();
130 
132  void Clear();
133 
139  void InitializePowerSetMasses(const LabelSetType & universe);
140 
142  MassType GetBelief(const LabelSetType & labelSet) const;
143 
145  MassType GetPlausibility(const LabelSetType & labelSet) const;
146 
149  MassType GetBelief(const LabelSetOfSetType & containedLabelSet) const;
150 
153  MassType GetPlausibility(const LabelSetOfSetType & intersectedLabelSet) const;
154 
156  void Copy(const Self * massOfBelief);
157 
159  bool IsEmpty() const;
160 
164  static std::ostream & PrintLabelSet(std::ostream & out,
165  const LabelSetType & labelSet);
166 
170  static std::ostream & PrintLabelSetOfSet(std::ostream & out,
171  const LabelSetOfSetType & labelSet);
172 
173 protected:
176 
178  virtual ~MassOfBelief() {}
179 
181  void PrintSelf(std::ostream& os, itk::Indent indent) const;
182 
183 private:
184  MassOfBelief(const Self&); //purposely not implemented
185  void operator=(const Self&); //purposely not implemented
186 
189 };
190 
191 } // end namespace otb
192 
193 
194 #ifndef OTB_MANUAL_INSTANTIATION
195 #include "otbMassOfBelief.txx"
196 #endif
197 
198 #endif

Generated at Sat Aug 30 2014 16:13:10 for Orfeo Toolbox with doxygen 1.8.3.1