Orfeo ToolBox  4.2
Orfeo ToolBox is not a black box
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

This class represent a mass of belief function. More...

#include <otbMassOfBelief.h>

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

Public Types

typedef itk::SmartPointer
< const Self
ConstPointer
 
typedef std::set< LabelSetTypeLabelSetOfSetType
 
typedef std::set< LabelTypeLabelSetType
 
typedef TLabel LabelType
 
typedef std::map< LabelSetType,
MassType
MassMapType
 
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 LabelSetType &labelSet) const
 
MassType GetBelief (const LabelSetOfSetType &containedLabelSet) const
 
MassType GetMass (const LabelSetType &labelSet) const
 
virtual const char * GetNameOfClass () const
 
MassType GetPlausibility (const LabelSetType &labelSet) const
 
MassType GetPlausibility (const LabelSetOfSetType &intersectedLabelSet) 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 ()
 
virtual ~MassOfBelief ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const
 

Private Member Functions

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

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 to normalize all masses so that they sum to 1. The EstimateUncertainty() method allows to associate to the uncertain set (i.e. the universe set) a mass so that all masses sum to 1.

The GetUniverse() method allows to retrieve the set of all symbols (i.e. the universal set), while the GetSupport() method allows to retrieve 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 optionnaly 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 to ensure 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 to compute 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 85 of file otbMassOfBelief.h.

Member Typedef Documentation

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

Definition at line 92 of file otbMassOfBelief.h.

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

Definition at line 104 of file otbMassOfBelief.h.

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

Definition at line 102 of file otbMassOfBelief.h.

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

Definition at line 98 of file otbMassOfBelief.h.

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

Definition at line 103 of file otbMassOfBelief.h.

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

Definition at line 101 of file otbMassOfBelief.h.

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

Definition at line 91 of file otbMassOfBelief.h.

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

Standard class typedefs

Definition at line 89 of file otbMassOfBelief.h.

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

Definition at line 90 of file otbMassOfBelief.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 175 of file otbMassOfBelief.h.

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

Desctructor

Definition at line 178 of file otbMassOfBelief.h.

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

Member Function Documentation

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

Clear all masses

Definition at line 193 of file otbMassOfBelief.txx.

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

Copy masses of two mass functions

Definition at line 350 of file otbMassOfBelief.txx.

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

template<class TLabel = unsigned short, class TMass = double>
virtual::itk::LightObject::Pointer otb::MassOfBelief< TLabel, TMass >::CreateAnother ( void  ) const
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 161 of file otbMassOfBelief.txx.

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 242 of file otbMassOfBelief.txx.

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 311 of file otbMassOfBelief.txx.

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 60 of file otbMassOfBelief.txx.

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).

Reimplemented from itk::DataObject.

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 277 of file otbMassOfBelief.txx.

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 331 of file otbMassOfBelief.txx.

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

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 79 of file otbMassOfBelief.txx.

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

Get the set of universe symbols for this mass function

Definition at line 102 of file otbMassOfBelief.txx.

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 201 of file otbMassOfBelief.txx.

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

Return true if the support set is null

Definition at line 362 of file otbMassOfBelief.txx.

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

Method for creation through the object factory.

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

Normalize mass set sot that the sum of masses equals 1

Definition at line 132 of file otbMassOfBelief.txx.

template<class TLabel = unsigned short, class TMass = double>
void otb::MassOfBelief< TLabel, TMass >::operator= ( const Self )
private
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 399 of file otbMassOfBelief.txx.

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 427 of file otbMassOfBelief.txx.

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

PrintSelf method

Reimplemented from itk::DataObject.

Definition at line 370 of file otbMassOfBelief.txx.

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

Remove mass from the support

Definition at line 46 of file otbMassOfBelief.txx.

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 34 of file otbMassOfBelief.txx.

Member Data Documentation

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

The masses map

Definition at line 188 of file otbMassOfBelief.h.

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


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