TTK
|
TTK contourTreeAlignment processing package. More...
#include <ContourTreeAlignment.h>
Public Types | |
using | ContourTree = cta::ContourTree |
Public Member Functions | |
ContourTreeAlignment () | |
Constructor of the Alignment Object. | |
~ContourTreeAlignment () override | |
Destructor of the Alignment Object. | |
void | setArcMatchMode (int mode) |
void | setWeightCombinatorialMatch (float weight) |
void | setWeightArcMatch (float weight) |
void | setWeightScalarValueMatch (float weight) |
void | setAlignmenttreeType (int type) |
template<class scalarType > | |
int | execute (const std::vector< void * > &scalarsVP, const std::vector< int * > ®ionSizes, const std::vector< int * > &segmentationIds, const std::vector< long long * > &topologies, const std::vector< size_t > &nVertices, const std::vector< size_t > &nEdges, const std::vector< int * > &segmentations, const std::vector< size_t > &segsizes, std::vector< float > &outputVertices, std::vector< long long > &outputFrequencies, std::vector< long long > &outputVertexIds, std::vector< long long > &outputBranchIds, std::vector< long long > &outputSegmentationIds, std::vector< long long > &outputArcIds, std::vector< int > &outputEdges, int seed) |
bool | alignTree (const std::shared_ptr< ContourTree > &t) |
bool | initialize (const std::shared_ptr< ContourTree > &t) |
bool | alignTree_consistentRoot (const std::shared_ptr< ContourTree > &t) |
bool | initialize_consistentRoot (const std::shared_ptr< ContourTree > &t, int rootIdx) |
std::vector< std::pair< std::vector< std::shared_ptr< ttk::cta::CTNode > >, std::vector< std::shared_ptr< ttk::cta::CTEdge > > > > | getGraphs () |
std::vector< std::shared_ptr< ContourTree > > | getContourTrees () |
std::pair< std::vector< std::shared_ptr< ttk::cta::AlignmentNode > >, std::vector< std::shared_ptr< ttk::cta::AlignmentEdge > > > | getAlignmentGraph () |
std::shared_ptr< ttk::cta::BinaryTree > | getAlignmentGraphRooted () |
int | getAlignmentRootIdx () |
std::pair< float, std::shared_ptr< ttk::cta::AlignmentTree > > | getAlignmentBinary (const std::shared_ptr< ttk::cta::BinaryTree > &t1, const std::shared_ptr< ttk::cta::BinaryTree > &t2) |
void | computeBranches () |
Public Member Functions inherited from ttk::Debug | |
Debug () | |
~Debug () override | |
virtual int | setDebugLevel (const int &debugLevel) |
int | setWrapper (const Wrapper *wrapper) override |
int | printMsg (const std::string &msg, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const std::vector< std::string > &msgs, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printErr (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const |
int | printWrn (const std::string &msg, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cerr) const |
int | printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const double &memory, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const double &time, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const double &time, const int &threads, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::PERFORMANCE, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const double &progress, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const std::vector< std::vector< std::string > > &rows, const debug::Priority &priority=debug::Priority::INFO, const bool hasHeader=true, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const |
int | printMsg (const debug::Separator &separator, const debug::Priority &priority, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsg (const std::string &msg, const debug::Separator &separator, const debug::LineMode &lineMode=debug::LineMode::NEW, const debug::Priority &priority=debug::Priority::INFO, std::ostream &stream=std::cout) const |
void | setDebugMsgPrefix (const std::string &prefix) |
Public Member Functions inherited from ttk::BaseClass | |
BaseClass () | |
virtual | ~BaseClass ()=default |
int | getThreadNumber () const |
virtual int | setThreadNumber (const int threadNumber) |
Protected Member Functions | |
float | alignTreeBinary (const std::shared_ptr< ttk::cta::BinaryTree > &t1, const std::shared_ptr< ttk::cta::BinaryTree > &t2, std::vector< std::vector< float > > &memT, std::vector< std::vector< float > > &memF) |
float | alignForestBinary (const std::shared_ptr< ttk::cta::BinaryTree > &t1, const std::shared_ptr< ttk::cta::BinaryTree > &t2, std::vector< std::vector< float > > &memT, std::vector< std::vector< float > > &memF) |
std::shared_ptr< ttk::cta::AlignmentTree > | traceAlignmentTree (const std::shared_ptr< ttk::cta::BinaryTree > &t1, const std::shared_ptr< ttk::cta::BinaryTree > &t2, std::vector< std::vector< float > > &memT, std::vector< std::vector< float > > &memF) |
std::vector< std::shared_ptr< ttk::cta::AlignmentTree > > | traceAlignmentForest (const std::shared_ptr< ttk::cta::BinaryTree > &t1, const std::shared_ptr< ttk::cta::BinaryTree > &t2, std::vector< std::vector< float > > &memT, std::vector< std::vector< float > > &memF) |
std::shared_ptr< ttk::cta::AlignmentTree > | traceNullAlignment (const std::shared_ptr< ttk::cta::BinaryTree > &t, bool first) |
float | editCost (const std::shared_ptr< ttk::cta::BinaryTree > &t1, const std::shared_ptr< ttk::cta::BinaryTree > &t2) |
bool | isBinary (const std::shared_ptr< ttk::cta::Tree > &t) |
std::shared_ptr< ttk::cta::BinaryTree > | rootAtNode (const std::shared_ptr< ttk::cta::AlignmentNode > &root) |
std::shared_ptr< ttk::cta::BinaryTree > | computeRootedTree (const std::shared_ptr< ttk::cta::AlignmentNode > &node, const std::shared_ptr< ttk::cta::AlignmentEdge > &parent, int &id) |
std::shared_ptr< ttk::cta::BinaryTree > | computeRootedDualTree (const std::shared_ptr< ttk::cta::AlignmentEdge > &arc, bool parent1, int &id) |
void | computeNewAlignmenttree (const std::shared_ptr< ttk::cta::AlignmentTree > &res) |
std::pair< float, std::vector< std::shared_ptr< ttk::cta::AlignmentNode > > > | pathToMax (const std::shared_ptr< ttk::cta::AlignmentNode > &root, const std::shared_ptr< ttk::cta::AlignmentNode > &parent) |
std::pair< float, std::vector< std::shared_ptr< ttk::cta::AlignmentNode > > > | pathToMin (const std::shared_ptr< ttk::cta::AlignmentNode > &root, const std::shared_ptr< ttk::cta::AlignmentNode > &parent) |
Protected Member Functions inherited from ttk::Debug | |
int | printMsgInternal (const std::string &msg, const std::string &right, const std::string &filler, const debug::Priority &priority=debug::Priority::INFO, const debug::LineMode &lineMode=debug::LineMode::NEW, std::ostream &stream=std::cout) const |
int | printMsgInternal (const std::string &msg, const debug::Priority &priority, const debug::LineMode &lineMode, std::ostream &stream=std::cout) const |
int | welcomeMsg (std::ostream &stream) |
Protected Attributes | |
ttk::cta::Type_Alignmenttree | alignmenttreeType = ttk::cta::averageValues |
ttk::cta::Mode_ArcMatch | arcMatchMode = ttk::cta::persistence |
float | weightArcMatch = 1 |
float | weightCombinatorialMatch = 0 |
float | weightScalarValueMatch = 0 |
std::vector< std::shared_ptr< ttk::cta::AlignmentNode > > | nodes |
std::vector< std::shared_ptr< ttk::cta::AlignmentEdge > > | arcs |
std::vector< std::shared_ptr< ContourTree > > | contourtrees |
std::vector< size_t > | permutation |
std::shared_ptr< ttk::cta::AlignmentNode > | alignmentRoot |
int | alignmentRootIdx |
float | alignmentVal |
Protected Attributes inherited from ttk::Debug | |
int | debugLevel_ |
std::string | debugMsgPrefix_ |
std::string | debugMsgNamePrefix_ |
Protected Attributes inherited from ttk::BaseClass | |
bool | lastObject_ |
int | threadNumber_ |
Wrapper * | wrapper_ |
Additional Inherited Members | |
Static Protected Attributes inherited from ttk::Debug | |
static COMMON_EXPORTS debug::LineMode | lastLineMode = ttk::debug::LineMode::NEW |
TTK contourTreeAlignment processing package.
ContourTreeAlignment is a TTK processing package that computes an alignment for n contour trees. To compute the alignment, use the execute function. Each contour tree is represented by an integer array for the topology, an integer array for each of the edge scalars regionSize
and segmentationId
, a <scalarType>
array for the vertex scalars and two integers for the number of edges and vertices. These properties are passed as vectors of arrays, where the i-th array in a vector represents the corresponding array for the i-th tree. The alignment tree is written to the output vectors which are passed by reference.
Related publication:
'Fuzzy contour trees: Alignment and joint layout of multiple contour trees' Anna Pia Lohfink, Florian Wetzels, Jonas Lukasczyk, Gunther H. Weber, and Christoph Garth. Comput. Graph. Forum, 39(3):343-355, 2020.
Online examples:
Definition at line 162 of file ContourTreeAlignment.h.
Definition at line 273 of file ContourTreeAlignment.h.
|
inline |
Constructor of the Alignment Object.
Definition at line 166 of file ContourTreeAlignment.h.
|
inlineoverride |
Destructor of the Alignment Object.
Definition at line 171 of file ContourTreeAlignment.h.
|
protected |
Definition at line 1114 of file ContourTreeAlignment.cpp.
bool ttk::ContourTreeAlignment::alignTree | ( | const std::shared_ptr< ContourTree > & | t | ) |
This function aligns a new tree to the current alignment.
t | The input contour tree. |
Definition at line 389 of file ContourTreeAlignment.cpp.
bool ttk::ContourTreeAlignment::alignTree_consistentRoot | ( | const std::shared_ptr< ContourTree > & | t | ) |
This function aligns a new tree to the current alignment but keeps the old alignment's root.
t | The input contour tree. |
Definition at line 444 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1040 of file ContourTreeAlignment.cpp.
void ttk::ContourTreeAlignment::computeBranches | ( | ) |
Function that adds branch decomposition information to the alignment nodes.
Definition at line 9 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 500 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1762 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1703 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1193 of file ContourTreeAlignment.cpp.
int ttk::ContourTreeAlignment::execute | ( | const std::vector< void * > & | scalarsVP, |
const std::vector< int * > & | regionSizes, | ||
const std::vector< int * > & | segmentationIds, | ||
const std::vector< long long * > & | topologies, | ||
const std::vector< size_t > & | nVertices, | ||
const std::vector< size_t > & | nEdges, | ||
const std::vector< int * > & | segmentations, | ||
const std::vector< size_t > & | segsizes, | ||
std::vector< float > & | outputVertices, | ||
std::vector< long long > & | outputFrequencies, | ||
std::vector< long long > & | outputVertexIds, | ||
std::vector< long long > & | outputBranchIds, | ||
std::vector< long long > & | outputSegmentationIds, | ||
std::vector< long long > & | outputArcIds, | ||
std::vector< int > & | outputEdges, | ||
int | seed | ||
) |
The actual iterated n-tree-alignment algorithm. Computes the alignment of n input contour trees.
scalarsVP | Vector holding n arrays that represent the node scalars of the n input trees. scalarsVP[i][j] should be the scalar value of the jth node in the ith tree. |
regionSizes | Vector holding n arrays that represent the region sizes of edges of the n input trees. regionSizes[i][j] should be the size of the segment associated with the jth edge in the ith tree. |
segmentationIds | Vector holding n arrays that represent the segmentation ids of the edges the n input trees. segmentationIds[i][j] should be the segment identifier of the jth node in the ith tree. |
topologies | Vector holding n arrays that represent the connectivity of the the n input trees. |
nVertices | Vector holding n integers representing the number of nodes of the n input trees. |
nEdges | Vector holding n integers representing the number of edges of the n input trees. |
segmentations | Vector holding n arrays representing the segmentation arrays of the n input trees. |
segsizes | Vector holding the sizes of the corresponding segmentations array. segSizes[i] should be the size of the number of points in the ith scalar field. This should also be the size of segmentations[i]. |
outputVertices | Vector for the alignment node scalars that will be filled by this algorithm. outputVertices[i] should be the scalar value of the ith node in the alignment tree. |
outputFrequencies | Vector for the alignment node frequencies that will be filled by this algorithm. outputFrequencies[i] should be the number of original nodes matched the ith node in the alignment tree. |
outputVertexIds | Vector for the alignment node matching that will be filled by this algorithm. outputVertexIds[i*n+j] should be the id of the vertex from the jth input tree matched in the ith node of the alignment tree. |
outputBranchIds | Vector for the alignment node branch ids that will be filled by this algorithm. outputBranchIds[i] should be the branch id of the ith node in the alignment tree. |
outputSegmentationIds | Vector for the alignment edge segmentations that will be filled by this algorithm. outputSegmentationIds[i*n+j] should be the id of the segment from the jth input field associated the ith node of the alignment tree. |
outputArcIds | Vector for the alignment edge matching that will be filled by this algorithm. outputArcIds[i*n+j] should be the id of the arc from the jth input tree associated the ith node of the alignment tree. |
outputEdges | Vector for the alignment graph connectivity. The ith edge of the alignment connects the nodes of index outputEdges[2*i] and outputEdges[2*i+1]. |
seed | seed for randomization. |
Definition at line 410 of file ContourTreeAlignment.h.
std::pair< float, std::shared_ptr< ttk::cta::AlignmentTree > > ttk::ContourTreeAlignment::getAlignmentBinary | ( | const std::shared_ptr< ttk::cta::BinaryTree > & | t1, |
const std::shared_ptr< ttk::cta::BinaryTree > & | t2 | ||
) |
Function for aligning two arbitrary binary trees.
t1 | The first binary rooted tree to align. |
t2 | The second binary rooted tree to align. |
Definition at line 1020 of file ContourTreeAlignment.cpp.
std::pair< std::vector< std::shared_ptr< ttk::cta::AlignmentNode > >, std::vector< std::shared_ptr< ttk::cta::AlignmentEdge > > > ttk::ContourTreeAlignment::getAlignmentGraph | ( | ) |
Getter for the alignment tree in a graph representation
Definition at line 991 of file ContourTreeAlignment.cpp.
std::shared_ptr< ttk::cta::BinaryTree > ttk::ContourTreeAlignment::getAlignmentGraphRooted | ( | ) |
Getter for the alignment tree in a rooted tree representation
Definition at line 997 of file ContourTreeAlignment.cpp.
int ttk::ContourTreeAlignment::getAlignmentRootIdx | ( | ) |
Getter for the fixed root index.
Definition at line 958 of file ContourTreeAlignment.cpp.
std::vector< std::shared_ptr< ContourTree > > ttk::ContourTreeAlignment::getContourTrees | ( | ) |
Getter for aligned contour trees
Definition at line 969 of file ContourTreeAlignment.cpp.
std::vector< std::pair< std::vector< std::shared_ptr< ttk::cta::CTNode > >, std::vector< std::shared_ptr< ttk::cta::CTEdge > > > > ttk::ContourTreeAlignment::getGraphs | ( | ) |
Getter for aligned contour trees
Definition at line 976 of file ContourTreeAlignment.cpp.
bool ttk::ContourTreeAlignment::initialize | ( | const std::shared_ptr< ContourTree > & | t | ) |
This function initializes a new alignment graph from a given contour tree.
t | The input contour tree. |
Definition at line 182 of file ContourTreeAlignment.cpp.
bool ttk::ContourTreeAlignment::initialize_consistentRoot | ( | const std::shared_ptr< ContourTree > & | t, |
int | rootIdx | ||
) |
This function initializes a new alignment graph from a given contour tree and sets the fixed root of the alignment to the given input.
t | The input contour tree. |
rootIdx |
Definition at line 278 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1679 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 103 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 139 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1693 of file ContourTreeAlignment.cpp.
|
inline |
Setter for the type of alignment tree.
type | Determines how the labels of the alignment tree are computed from the matched labels. |
Definition at line 208 of file ContourTreeAlignment.h.
|
inline |
Setter for the matching mode based on arc properties.
mode | Determines what arc properties should be compared. |
Definition at line 180 of file ContourTreeAlignment.h.
|
inline |
Setter for the weight of arc property matching.
weight | Determines the factor with which the arc property based distance is weighted. |
Definition at line 194 of file ContourTreeAlignment.h.
|
inline |
Setter for the weight of combinatorial matching.
weight | Determines the factor with which the combinatorial distance is weighted. |
Definition at line 187 of file ContourTreeAlignment.h.
|
inline |
Setter for the weight of node matching.
weight | Determines the factor with which the scalar value distance is weighted. |
Definition at line 201 of file ContourTreeAlignment.h.
|
protected |
Definition at line 1431 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1280 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 1658 of file ContourTreeAlignment.cpp.
|
protected |
Definition at line 349 of file ContourTreeAlignment.h.
|
protected |
Definition at line 350 of file ContourTreeAlignment.h.
|
protected |
Definition at line 336 of file ContourTreeAlignment.h.
|
protected |
Definition at line 351 of file ContourTreeAlignment.h.
|
protected |
Definition at line 337 of file ContourTreeAlignment.h.
|
protected |
Definition at line 344 of file ContourTreeAlignment.h.
|
protected |
Definition at line 347 of file ContourTreeAlignment.h.
|
protected |
Definition at line 343 of file ContourTreeAlignment.h.
|
protected |
Definition at line 348 of file ContourTreeAlignment.h.
|
protected |
Definition at line 338 of file ContourTreeAlignment.h.
|
protected |
Definition at line 339 of file ContourTreeAlignment.h.
|
protected |
Definition at line 340 of file ContourTreeAlignment.h.