TTK
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ttk::cta::ContourTree Class Reference

Contour Tree Data Structure for an unrooted contour tree of unbounded degree for internal use from the ttk:ContourTreeAlignment module. More...

#include <CTA_contourtree.h>

Public Member Functions

 ContourTree (float *scalars, int *regionSizes, int *segmentationIds, long long *topology, size_t nVertices, size_t nEdges, std::vector< std::vector< int > > regions={})
 
 ~ContourTree ()
 Destructor of internal contour tree class.
 
std::shared_ptr< BinaryTreerootAtMax ()
 
std::shared_ptr< BinaryTreerootAtNode (const std::shared_ptr< CTNode > &root)
 
bool isBinary ()
 
void computeBranches ()
 
std::pair< std::vector< std::shared_ptr< CTNode > >, std::vector< std::shared_ptr< CTEdge > > > getGraph ()
 

Detailed Description

Contour Tree Data Structure for an unrooted contour tree of unbounded degree for internal use from the ttk:ContourTreeAlignment module.

Author
Florian Wetzels f_wet.nosp@m.zels.nosp@m.13@cs.nosp@m..uni.nosp@m.-kl.d.nosp@m.e
Date
26.11.2021

ToDo

See also
ttk::ContourTreeAlignment
ttk::cta::CTNode
ttk::cta::CTEdge
ttk::cta::BinaryTree
ttk::cta::Tree

Definition at line 196 of file CTA_contourtree.h.

Constructor & Destructor Documentation

◆ ContourTree()

ContourTree::ContourTree ( float *  scalars,
int *  regionSizes,
int *  segmentationIds,
long long *  topology,
size_t  nVertices,
size_t  nEdges,
std::vector< std::vector< int > >  regions = {} 
)

Constructor for internal contour tree class. Constructs graph from vtk style array input.

Parameters
scalarsScalar values of the contour tree nodes. scalars[i] is scalar values of the node of index i.
regionSizesRegion size values of the contour tree edges. regionSizes[i] is the number of vertices in the segment associated with the edge of index i.
segmentationIdsSegmentation ids of the contour tree edges. segmentationIds[i] is an identifier of the segment associated with the edge of index i.
topologyConnectivity information describing the graph structure. topology[i][0] and topology[i][1] are the indices of the two nodes incident to the edge of index i.
nVerticesThe number of vertices in the graph and the length of scalar array.
nEdgesThe number of edges in the graph and the length of regionSizes, segmentationIds and topology arrays.
regionsSegments/Regions associated with the edges of the contour tree. regions[i] is a vector of vertex identifiers that belong to the edge of index i.

Definition at line 8 of file CTA_contourtree.cpp.

◆ ~ContourTree()

ContourTree::~ContourTree ( )
default

Destructor of internal contour tree class.

Member Function Documentation

◆ computeBranches()

void ContourTree::computeBranches ( )

Computes a branch decomposition of the contour tree and attaches the branch information to the node objects.

Definition at line 258 of file CTA_contourtree.cpp.

◆ getGraph()

std::pair< std::vector< std::shared_ptr< ttk::cta::CTNode > >, std::vector< std::shared_ptr< ttk::cta::CTEdge > > > ContourTree::getGraph ( )

Returns a graph representation of the contour tree as node list and edge list.

Returns
Pair consisting of the node list and the edge list.

Definition at line 393 of file CTA_contourtree.cpp.

◆ isBinary()

bool ContourTree::isBinary ( )

Checks if the maximum node degree is at most 3.

Returns
True if the contour tree is binary, False otherwise.

Definition at line 254 of file CTA_contourtree.cpp.

◆ rootAtMax()

std::shared_ptr< ttk::cta::BinaryTree > ContourTree::rootAtMax ( )

Get a rooted binary representation of the contour tree. The root is the vertex of highest scalar value.

Precondition
The contour tree should be binary. If it is not, the rooted tree will not be complete.
Returns
Smartpointer to the binary tree object.

Definition at line 227 of file CTA_contourtree.cpp.

◆ rootAtNode()

std::shared_ptr< ttk::cta::BinaryTree > ContourTree::rootAtNode ( const std::shared_ptr< CTNode > &  root)

Get a rooted binary representation of the contour tree. The root is the vertex passed as first argument.

Precondition
The contour tree should be binary. If it is not, the rooted tree will not be complete.
Parameters
rootThe contour tree node that will be the root of the rooted tree.
Returns
Smartpointer to the binary tree object.

Definition at line 246 of file CTA_contourtree.cpp.


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