OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::MassOfBelief< TLabel, TMass > Class Template Reference

#include <otbMassOfBelief.h>

+ Inheritance diagram for otb::MassOfBelief< TLabel, TMass >:
+ Collaboration diagram for otb::MassOfBelief< TLabel, TMass >:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::set< LabelSetTypeLabelSetOfSetType
 
typedef std::set< LabelTypeLabelSetType
 
typedef TLabel LabelType
 
typedef std::map< LabelSetType, MassTypeMassMapType
 
typedef TMass MassType
 
typedef itk::SmartPointer< SelfPointer
 
typedef MassOfBelief Self
 
typedef itk::DataObject Superclass
 

Public Member Functions

void Clear ()
 
void Copy (const Self *massOfBelief)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
void EstimateUncertainty ()
 
MassType GetBelief (const LabelSetOfSetType &containedLabelSet) const
 
MassType GetBelief (const LabelSetType &labelSet) const
 
MassType GetMass (const LabelSetType &labelSet) const
 
virtual const char * GetNameOfClass () const
 
MassType GetPlausibility (const LabelSetOfSetType &intersectedLabelSet) const
 
MassType GetPlausibility (const LabelSetType &labelSet) const
 
LabelSetOfSetType GetSupport () const
 
LabelSetType GetUniverse () const
 
void InitializePowerSetMasses (const LabelSetType &universe)
 
bool IsEmpty () const
 
void Normalize ()
 
void RemoveMass (const LabelSetType &labelSet)
 
void SetMass (const LabelSetType &labelSet, const MassType &mass)
 

Static Public Member Functions

static Pointer New ()
 
static std::ostream & PrintLabelSet (std::ostream &out, const LabelSetType &labelSet)
 
static std::ostream & PrintLabelSetOfSet (std::ostream &out, const LabelSetOfSetType &labelSet)
 

Protected Member Functions

 MassOfBelief ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 ~MassOfBelief () override
 

Private Member Functions

 MassOfBelief (const Self &)=delete
 
void operator= (const Self &)=delete
 

Private Attributes

MassMapType m_MassesMap
 

Detailed Description

template<class TLabel = unsigned short, class TMass = double>
class otb::MassOfBelief< TLabel, TMass >

This class represent a mass of belief function.

This class represent a Mass of Belief function to be used in Dempster-Shafer theory.

Template parameter TLabel is the type of the elements in the universe set, while TMass is the type of the mass. TLabel can be any type implementing ordering operator, while TMass should be a floating point type.

An element of the power-set is represented by the sub-type LabelSetType, which is a std::set<TLabel>.

A mass can be associated with a given element from the power set by calling the SetMass method. It is not necessary to associate masses with each element of the power set: mass is supposed to be null otherwise declared.

A mass associated with an element from the power-set can be removed using the RemoveMass method, and all masses can be cleared using the Clear() function.

The mass associated with a given element from the power-set can be retrieved using the GetMass method. If no mass has been associated with this element, null is returned.

The Normalize() method allows normalizing all masses so that they sum to 1. The EstimateUncertainty() method allows associating to the uncertain set (i.e. the universe set) a mass so that all masses sum to 1.

The GetUniverse() method allows retrieving the set of all symbols (i.e. the universal set), while the GetSupport() method allows retrieving the set of all elements of the power-set for which a mass has been associated. This method returns a LabelSetOfSetType, which is a std::set<std::set<TLabel> >.

The mass function can be optionally initialized from a given universe set by building the power-set and associating a null mass with every elements of this power-set. This allows ensuring that two mass functions will share the exact same universe and power-set, but is not mandatory, since mass is supposed to be null for any set if not stated otherwise.

Once masses are set, the GetPlausibility() and GetBelief() function allow computing the belief and plausibility for an element of the power-set, or directly for a set of elements of the power-set intersecting (resp. contained in) a given hypothesis.

Definition at line 90 of file otbMassOfBelief.h.

Member Typedef Documentation

◆ ConstPointer

template<class TLabel = unsigned short, class TMass = double>
typedef itk::SmartPointer<const Self> otb::MassOfBelief< TLabel, TMass >::ConstPointer

Definition at line 97 of file otbMassOfBelief.h.

◆ LabelSetOfSetType

template<class TLabel = unsigned short, class TMass = double>
typedef std::set<LabelSetType> otb::MassOfBelief< TLabel, TMass >::LabelSetOfSetType

Definition at line 109 of file otbMassOfBelief.h.

◆ LabelSetType

template<class TLabel = unsigned short, class TMass = double>
typedef std::set<LabelType> otb::MassOfBelief< TLabel, TMass >::LabelSetType

Definition at line 107 of file otbMassOfBelief.h.

◆ LabelType

template<class TLabel = unsigned short, class TMass = double>
typedef TLabel otb::MassOfBelief< TLabel, TMass >::LabelType

Definition at line 103 of file otbMassOfBelief.h.

◆ MassMapType

template<class TLabel = unsigned short, class TMass = double>
typedef std::map<LabelSetType, MassType> otb::MassOfBelief< TLabel, TMass >::MassMapType

Definition at line 108 of file otbMassOfBelief.h.

◆ MassType

template<class TLabel = unsigned short, class TMass = double>
typedef TMass otb::MassOfBelief< TLabel, TMass >::MassType

Definition at line 106 of file otbMassOfBelief.h.

◆ Pointer

template<class TLabel = unsigned short, class TMass = double>
typedef itk::SmartPointer<Self> otb::MassOfBelief< TLabel, TMass >::Pointer

Definition at line 96 of file otbMassOfBelief.h.

◆ Self

template<class TLabel = unsigned short, class TMass = double>
typedef MassOfBelief otb::MassOfBelief< TLabel, TMass >::Self

Standard class typedefs

Definition at line 94 of file otbMassOfBelief.h.

◆ Superclass

template<class TLabel = unsigned short, class TMass = double>
typedef itk::DataObject otb::MassOfBelief< TLabel, TMass >::Superclass

Definition at line 95 of file otbMassOfBelief.h.

Constructor & Destructor Documentation

◆ MassOfBelief() [1/2]

template<class TLabel = unsigned short, class TMass = double>
otb::MassOfBelief< TLabel, TMass >::MassOfBelief ( )
inlineprotected

Constructor

Definition at line 178 of file otbMassOfBelief.h.

◆ ~MassOfBelief()

template<class TLabel = unsigned short, class TMass = double>
otb::MassOfBelief< TLabel, TMass >::~MassOfBelief ( )
inlineoverrideprotected

Destructor

Definition at line 183 of file otbMassOfBelief.h.

◆ MassOfBelief() [2/2]

template<class TLabel = unsigned short, class TMass = double>
otb::MassOfBelief< TLabel, TMass >::MassOfBelief ( const Self )
privatedelete

Member Function Documentation

◆ Clear()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::Clear

Clear all masses

Definition at line 173 of file otbMassOfBelief.hxx.

◆ Copy()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::Copy ( const Self massOfBelief)

Copy masses of two mass functions

Definition at line 309 of file otbMassOfBelief.hxx.

References otb::MassOfBelief< TLabel, TMass >::m_MassesMap.

◆ CreateAnother()

template<class TLabel = unsigned short, class TMass = double>
virtual::itk::LightObject::Pointer otb::MassOfBelief< TLabel, TMass >::CreateAnother ( void  ) const

◆ EstimateUncertainty()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::EstimateUncertainty

Associate to uncertainty a mass such that the sum of masses equals 1

Definition at line 144 of file otbMassOfBelief.hxx.

◆ GetBelief() [1/2]

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::MassType otb::MassOfBelief< TLabel, TMass >::GetBelief ( const LabelSetOfSetType containedLabelSet) const

Get the belief for an hypothesis containing a given set of elements from the power-set

Definition at line 277 of file otbMassOfBelief.hxx.

◆ GetBelief() [2/2]

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::MassType otb::MassOfBelief< TLabel, TMass >::GetBelief ( const LabelSetType labelSet) const

Get the belief of a given element of the power-set

Definition at line 216 of file otbMassOfBelief.hxx.

◆ GetMass()

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::MassType otb::MassOfBelief< TLabel, TMass >::GetMass ( const LabelSetType labelSet) const

Retrieve the mass associated with the given element of the power set

Definition at line 56 of file otbMassOfBelief.hxx.

◆ GetNameOfClass()

template<class TLabel = unsigned short, class TMass = double>
virtual const char* otb::MassOfBelief< TLabel, TMass >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ GetPlausibility() [1/2]

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::MassType otb::MassOfBelief< TLabel, TMass >::GetPlausibility ( const LabelSetOfSetType intersectedLabelSet) const

Get the belief for an hypothesis intersecting a given set of elements from the power set.

Definition at line 293 of file otbMassOfBelief.hxx.

◆ GetPlausibility() [2/2]

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::MassType otb::MassOfBelief< TLabel, TMass >::GetPlausibility ( const LabelSetType labelSet) const

Get the plausibility of a given element of the power-set

Definition at line 247 of file otbMassOfBelief.hxx.

◆ GetSupport()

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::LabelSetOfSetType otb::MassOfBelief< TLabel, TMass >::GetSupport

Retrieve the support of the mass of belief (i.e. a vector of element of the power set for which the mass of belief is not null)

Definition at line 72 of file otbMassOfBelief.hxx.

◆ GetUniverse()

template<class TLabel , class TMass >
MassOfBelief< TLabel, TMass >::LabelSetType otb::MassOfBelief< TLabel, TMass >::GetUniverse

Get the set of universe symbols for this mass function

Definition at line 92 of file otbMassOfBelief.hxx.

◆ InitializePowerSetMasses()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::InitializePowerSetMasses ( const LabelSetType universe)

Initialize with all elements from the power set with null masses. Please note that this is not mandatory and only allows to ensure that two mass functions share the same universe, even if most of masses are null.

Definition at line 179 of file otbMassOfBelief.hxx.

◆ IsEmpty()

template<class TLabel , class TMass >
bool otb::MassOfBelief< TLabel, TMass >::IsEmpty

Return true if the support set is null

Definition at line 319 of file otbMassOfBelief.hxx.

◆ New()

template<class TLabel = unsigned short, class TMass = double>
static Pointer otb::MassOfBelief< TLabel, TMass >::New ( )
static

Method for creation through the object factory.

◆ Normalize()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::Normalize

Normalize mass set sot that the sum of masses equals 1

Definition at line 119 of file otbMassOfBelief.hxx.

◆ operator=()

template<class TLabel = unsigned short, class TMass = double>
void otb::MassOfBelief< TLabel, TMass >::operator= ( const Self )
privatedelete

◆ PrintLabelSet()

template<class TLabel , class TMass >
std::ostream & otb::MassOfBelief< TLabel, TMass >::PrintLabelSet ( std::ostream &  out,
const LabelSetType labelSet 
)
static

Define a Print static method for label sets Do not overload << for std::set since it causes namespace issues.

Definition at line 351 of file otbMassOfBelief.hxx.

◆ PrintLabelSetOfSet()

template<class TLabel , class TMass >
std::ostream & otb::MassOfBelief< TLabel, TMass >::PrintLabelSetOfSet ( std::ostream &  out,
const LabelSetOfSetType labelSet 
)
static

Define a Print static method for label sets Do not overload << for std::set since it causes namespace issues.

Definition at line 376 of file otbMassOfBelief.hxx.

◆ PrintSelf()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

Definition at line 325 of file otbMassOfBelief.hxx.

◆ RemoveMass()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::RemoveMass ( const LabelSetType labelSet)

Remove mass from the support

Definition at line 45 of file otbMassOfBelief.hxx.

◆ SetMass()

template<class TLabel , class TMass >
void otb::MassOfBelief< TLabel, TMass >::SetMass ( const LabelSetType labelSet,
const MassType mass 
)

Register a mass associated with an element of the power-set

Definition at line 35 of file otbMassOfBelief.hxx.

Member Data Documentation

◆ m_MassesMap

template<class TLabel = unsigned short, class TMass = double>
MassMapType otb::MassOfBelief< TLabel, TMass >::m_MassesMap
private

The masses map

Definition at line 195 of file otbMassOfBelief.h.

Referenced by otb::MassOfBelief< TLabel, TMass >::Copy().


The documentation for this class was generated from the following files: