reeb.get_merge_tree
*, mode=State.SUB_LEVEL, threshold=0.0) reeb.get_merge_tree(geometry,
Compute the merge tree of a given geometry using the Union-Find algorithm.
This function constructs a merge tree from the provided geometry data by initializing a UnionFindByLevel
object and converting it into a leveled graph. The merge tree represents the hierarchical merging of components based on a specified filtration mode (sublevel or superlevel sets), with edges below a given threshold omitted.
Parameters
Name | Type | Description | Default |
---|---|---|---|
geometry | psiclone.data.Geometry |
A geometry object containing nodes and edges to be processed into a merge tree. | required |
mode | State , optional (default: State.SUB_LEVEL ) |
The filtration mode for constructing the merge tree. Must be either State.SUB_LEVEL (for sublevel sets, ascending order) or State.SUPER_LEVEL (for superlevel sets, descending order). |
State.SUB_LEVEL |
threshold | float, optional (default: 0.0) | The minimum lifetime threshold for edges in the resulting merge tree. Edges with a lifetime (difference between death and birth levels) less than or equal to this value are excluded. | 0.0 |
Returns
Name | Type | Description |
---|---|---|
graph | psiclone.data.LeveledGraph |
A leveled graph object representing the merge tree, where nodes are marked as birth or death points, and edges connect these points based on the Union-Find merging process. |
Examples
>>> from psiclone.data import Geometry, State
>>> geom = Geometry(...) # Assume a valid geometry object
>>> merge_tree = get_merge_tree(geom, mode=State.SUB_LEVEL, threshold=0.1)
>>> print(merge_tree)