SMIL  1.0.4
Dendrogram< MarkerLabelT, NodeT, ValGraphT > Class Template Reference

Dendrogram. More...

Detailed Description

template<class MarkerLabelT = size_t, class NodeT = size_t, class ValGraphT = size_t>
class smil::Dendrogram< MarkerLabelT, NodeT, ValGraphT >

Dendrogram.

#include <Dendrogram.hpp>

+ Collaboration diagram for Dendrogram< MarkerLabelT, NodeT, ValGraphT >:

Public Types

typedef Dendrogram< MarkerLabelT, NodeT, ValGraphT > DendrogramType
 
typedef DendroNode< MarkerLabelT > DendroNodeType
 
typedef std::map< NodeT, ValGraphT > NodeValuesType
 
typedef std::vector< Edge< NodeT, ValGraphT > > EdgeListType
 

Public Member Functions

 Dendrogram ()
 Default constructor.
 
 Dendrogram (const Dendrogram &dendrogramToCopy)
 Copy constructor.
 
 Dendrogram (Graph< NodeT, ValGraphT > &mst)
 Dendrogram constructor from a MST graph. More...
 
 Dendrogram (Graph< NodeT, ValGraphT > &mst, smil::Image< MarkerLabelT > &imLabels, smil::Image< MarkerLabelT > &imIn, const size_t nbOfMoments=5)
 Constructor from a MST graph and labels/image to compute the moments. More...
 
virtual ~Dendrogram ()
 Destructor.
 
Dendrogram clone ()
 Clone Dendrogram.
 
void sortNodes (bool reverse=false)
 Reorganizes dendroNodes...
 
void sortReverseNodes ()
 Reorganizes dendroNodes by decreasing valuationInitial.
 
void addDendroNodes (DendroNodeType *dendroNode)
 
DendroNodeTyperesearchLabel (MarkerLabelT researchedLabel) const
 
void setMomentsContours (Image< MarkerLabelT > &imLabels, Image< MarkerLabelT > &imIn, const size_t nbOfMoments)
 
void reorganize ()
 
void normalize (const std::string typeOfNormalization="reg")
 Dendrogram ultrametric values normalization. More...
 
void putValuationsFinalInInitial ()
 Put the internalNodeValuationFinal in internalNodeValuationInitial and then set internalNodeValuationFinal = 0.
 
void setValuationsToZero ()
 
void removeMSTEdgesDendrogram (Graph< NodeT, ValGraphT > &associated_mst, double lbd)
 Given an internal node index lambda of the dendrogram, remove corresponding edge in the associated MST.
 
void HierarchicalConstruction (const std::string typeOfHierarchy, const int nParam=50, const smil::Image< MarkerLabelT > &imMosa=smil::Image< MarkerLabelT >(), const std::string typeOfTransform="erode", const StrElt &se=DEFAULT_SE)
 Computes a new hierarchy from a given dendrogram hierarchy. More...
 
void EnergyConstruction (const std::string typeOfHierarchy)
 Computes a new hierarchy from a given dendrogram hierarchy.
 
std::vector< DendroNodeType * > & getDendroNodes ()
 Setters and Getters.
 
void setNbrNodes (size_t nNbrNodes)
 
size_t getNbrNodes ()
 
void setNbrMarkers (size_t nNbrMarkers)
 
size_t getNbrMarkers ()
 
double getNodeValue (size_t nodeIndex, string nameOfValueWanted)
 Access a value of a node in the dendrogram. More...
 
void setNodeValue (size_t nodeIndex, string nameOfValueWanted, double value)
 Manually modify a value of a node in the dendrogram. More...
 
std::vector< MarkerLabelT > getLookupProgeny (size_t nodeIndex, string nameOfValueWanted)
 Get the lookup of the progeny of a node. More...
 
std::vector< MarkerLabelT > getThreshLookupProgeny (double thresh, string nameOfValueWanted)
 Get the lookup of the progeny below a certain ultrametric threshold. More...
 
std::vector< std::vector< double > > getPersistences (string typeOfMatrix="sparse", string momentOfLife="death")
 Compute persistences matrix (persistence measures only the order of fusion) More...
 
std::vector< std::vector< double > > getSaliences (string typeOfMatrix="sparse", string momentOfLife="death")
 Compute saliences matrix (salience expresses ultrametric values) More...
 
double computeDasguptaCF (Graph< NodeT, ValGraphT > completeGraph)
 Compute dasgupta score (paper "A cost function for similarity-based hierarchical clustering") More...
 
double computeScoreInteractiveSeg ()
 

Protected Attributes

size_t nbrNodes
 
size_t nbrMarkers
 
std::vector< DendroNode< MarkerLabelT > * > dendroNodes
 

Constructor & Destructor Documentation

◆ Dendrogram() [1/2]

Dendrogram ( Graph< NodeT, ValGraphT > &  mst)
inline

Dendrogram constructor from a MST graph.

Parameters
[in]mstInput mst (graph)

◆ Dendrogram() [2/2]

Dendrogram ( Graph< NodeT, ValGraphT > &  mst,
smil::Image< MarkerLabelT > &  imLabels,
smil::Image< MarkerLabelT > &  imIn,
const size_t  nbOfMoments = 5 
)
inline

Constructor from a MST graph and labels/image to compute the moments.

Parameters
[in]mstInput mst (graph)
[in]imLabelsLabels image
[in]imInOriginal image
[in]nbOfMoments(optional) Number of moments to compute (default = 5)

Member Function Documentation

◆ normalize()

void normalize ( const std::string  typeOfNormalization = "reg")
inline

Dendrogram ultrametric values normalization.

Parameters
[in]typeOfNormalizationDesired type of normalization: "reg" (according to the number of regions), "maxnorm" (according to the maximum value)

◆ HierarchicalConstruction()

void HierarchicalConstruction ( const std::string  typeOfHierarchy,
const int  nParam = 50,
const smil::Image< MarkerLabelT > &  imMosa = smil::Image<MarkerLabelT>(),
const std::string  typeOfTransform = "erode",
const StrElt se = DEFAULT_SE 
)
inline

Computes a new hierarchy from a given dendrogram hierarchy.

Parameters
[in]typeOfHierarchyDesired type of hierarchy: "none", "surfacic", "volumic", "stochasticSurfacic", "stochasticVolumic" etc.
[in]nParam:
[in]imMosa(optional) Mosaic image - necessary for hierarchies implying labels image deformations
[in]typeOfTransform(optional) Type of transform (deformation) applied to each mosaic image region
[in]se(optional) Structuring element

◆ getNodeValue()

double getNodeValue ( size_t  nodeIndex,
string  nameOfValueWanted 
)
inline

Access a value of a node in the dendrogram.

Parameters
[in]nodeIndexIndex of the node to access
[in]nameOfValueWantedName of the value to access ("valuation", "internalNodeValuationInitial", "label" etc.)

◆ setNodeValue()

void setNodeValue ( size_t  nodeIndex,
string  nameOfValueWanted,
double  value 
)
inline

Manually modify a value of a node in the dendrogram.

Parameters
[in]nodeIndexIndex of the node to modify
[in]nameOfValueWantedName of the value to modify ("valuation", "internalNodeValuationInitial", "label" etc.)
[in]valueNew value

◆ getLookupProgeny()

std::vector<MarkerLabelT> getLookupProgeny ( size_t  nodeIndex,
string  nameOfValueWanted 
)
inline

Get the lookup of the progeny of a node.

Parameters
[in]nodeIndexIndex of the node to access
[in]nameOfValueWantedName of the exact node ("current", "childLeft", "childRight")

◆ getThreshLookupProgeny()

std::vector<MarkerLabelT> getThreshLookupProgeny ( double  thresh,
string  nameOfValueWanted 
)
inline

Get the lookup of the progeny below a certain ultrametric threshold.

Parameters
[in]threshUltrametric value threshold
[in]nameOfValueWantedName of the exact node ("current", "childLeft", "childRight")

◆ getPersistences()

std::vector<std::vector<double> > getPersistences ( string  typeOfMatrix = "sparse",
string  momentOfLife = "death" 
)
inline

Compute persistences matrix (persistence measures only the order of fusion)

Parameters
[in]typeOfMatrix"sparse" (only between adjacent regions) or "full"
[in]momentOfLife"death" (when regions fuse) or "life" (when regions appear)

◆ getSaliences()

std::vector<std::vector<double> > getSaliences ( string  typeOfMatrix = "sparse",
string  momentOfLife = "death" 
)
inline

Compute saliences matrix (salience expresses ultrametric values)

Parameters
[in]typeOfMatrix"sparse" (only between adjacent regions) or "full"
[in]momentOfLife"death" (when regions fuse) or "life" (when regions appear)

◆ computeDasguptaCF()

double computeDasguptaCF ( Graph< NodeT, ValGraphT >  completeGraph)
inline

Compute dasgupta score (paper "A cost function for similarity-based hierarchical clustering")

Parameters
[in]completeGraphcomplete graph (with all adjacent regions connected)

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