Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Path Mapping Barycenters #1025

Draft
wants to merge 81 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
60e52a8
Started working on Clustering integration of bdi-ed. Not working yet.
floWetzels Nov 2, 2022
5719031
some work on bdi-ed clustering. (experimental state)
floWetzels Nov 9, 2022
909049d
MergeTreeClustering: Mapping visualizations working for Path Mapping …
floWetzels Nov 14, 2022
2012fdb
Some testing code for branch mapping distance.
floWetzels Nov 16, 2022
7fbe0b7
merged dev branch and fixed conflicts
floWetzels Nov 17, 2022
da9aee8
[MergeTreeVisu] dimension shift for planar layout
MatPont Nov 18, 2022
b2275cb
[MergeTreeVisu] custom shift and fix planar layout z shift
MatPont Nov 18, 2022
3384a39
Some debugging/testing output in Branch Mapping Distance
floWetzels Nov 18, 2022
6a10932
Merge branch 'mt_layout_dimension_shift' of https://github.com/MatPon…
floWetzels Nov 18, 2022
1362fc2
Branch Mapping Distance fixed.
floWetzels Nov 21, 2022
29be198
Some work on barycenters with path mapping distance.
floWetzels Nov 24, 2022
5c9fb8b
Some work on barycenters with path mapping distance.
floWetzels Nov 24, 2022
63e81ef
enable custom bd for branch mapping
MatPont Dec 2, 2022
4c0c8f9
[PathMapping] change dummy node matching
MatPont Dec 2, 2022
14c75fe
[PlanarLayout] fix diff and offset for general branch decomposition
MatPont Dec 2, 2022
b443073
Merge branch 'branchMapping_layout_fix' into mapping_planar_layout
MatPont Dec 2, 2022
f2aa0f0
first working version of path mapping barycenter
floWetzels Dec 2, 2022
100ac0c
Merge branch 'mapping_planar_layout' of https://github.com/MatPont/tt…
floWetzels Dec 2, 2022
01cc9b2
implemented alphas for path mapping clustering and fixed some warnings
floWetzels Dec 2, 2022
ecd72dd
Bugfixes for MergeTreeBarycenter with Path Mapping Distance. Still no…
floWetzels Dec 5, 2022
37230ab
Fixed bugs for barycenter computation with bdi-ed
floWetzels Dec 7, 2022
10652d9
some cleanup in MergeTreeClustering
floWetzels Dec 7, 2022
84f3760
[MergeTreeVisu] Branch Mapping planar layout
MatPont Dec 9, 2022
94c831c
MergeTreeClustering working with Path Mapping Distance
floWetzels Dec 12, 2022
4cf2d22
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into b…
floWetzels Dec 12, 2022
d4e524f
[MergeTreeVisu] fix isImportantPair for general branch decomposition
MatPont Dec 15, 2022
238524d
Merge branch 'mapping_planar_layout' of https://github.com/MatPont/tt…
floWetzels Dec 16, 2022
7c3d4a0
Merge branch 'bdi-ed_clustering' into mapping_planar_layout
MatPont Jan 13, 2023
4a1fdde
[PathLayout] add path layout filter parameter and remove some old code
MatPont Jan 13, 2023
cd5bc07
[PathLayout] work on layout
MatPont Jan 13, 2023
e079a63
[MergeTreeVisu] fix is important pair for general BD and put back per…
MatPont Jan 13, 2023
0847068
Merge branch 'mapping_planar_layout' of https://github.com/MatPont/tt…
MatPont Jan 13, 2023
0f0c940
[MergeTreeVisu] fix is important pair for general BD
MatPont Jan 13, 2023
bf61533
[MergeTreeVisu] work on path planar layout
MatPont Jan 13, 2023
c962b63
[MergeTreeClustering] path planar layout option in vtk layer
MatPont Jan 18, 2023
028d6be
[MergeTreeVisu] path layout dummy node
MatPont Jan 18, 2023
df0b6b6
[MergeTreeVisu] path planar layout shift according lowest node
MatPont Jan 18, 2023
8b35190
[MergeTreeVisu] fix y dimension shift for 1 barycenter and 2 trees
MatPont Feb 3, 2023
9e9bb56
[MergeTreeBarycenter] remove unused variable
MatPont Feb 3, 2023
22c300a
[MergeTreeVisu] work on trees layout alignment given barycenter
MatPont Feb 3, 2023
e6f5648
[MergeTreeVisu] work on special cases of tree planar layout alignment…
MatPont Feb 3, 2023
f0d4902
temporal reduction working for path mappings
floWetzels Feb 15, 2023
ea2fd47
Merge branch 'mapping_planar_layout' of https://github.com/MatPont/tt…
floWetzels Feb 17, 2023
ef248d6
added some debugging and testing options to MergeTreeClustering
floWetzels Mar 1, 2023
147ab25
[MergeTreeVisu] fix dummy nodes and cells
MatPont Mar 2, 2023
52de908
[MT-AE] work on path layout points and cells data
MatPont Mar 2, 2023
1381082
Added path mapping output to vtk layer of MergeTreeClustering
floWetzels Mar 2, 2023
d05943d
[MergeTreeVisu] path ids first version
MatPont Mar 2, 2023
0ca7d80
[MergeTreeVisu] fix path layout seg fault for Wasserstein distance
MatPont Mar 8, 2023
aedc5cf
[MergeTreeVisu] disable barycenter alignment for Wasserstein distance
MatPont Mar 8, 2023
51e4d6a
[MergeTreeVisu] true node ids in matching
MatPont Mar 13, 2023
d60777b
lots of changes on merge tree barycenter (mostly outputs for testing)
floWetzels Mar 31, 2023
b9f71cf
fixed merge conflicts
floWetzels Feb 23, 2024
f3fc3b0
started work on preprecessing for path mappings
floWetzels Feb 29, 2024
e0c4ad8
preprocessing working for path mapping distance in clustering module
floWetzels Mar 1, 2024
177451b
started work on path mapping preprocessing for remaing modules
floWetzels Mar 1, 2024
837f881
path mapping preprocessing working for clustering with multiple clusters
floWetzels Mar 1, 2024
66622a3
preprocessing working for single path/branch mapping distance
floWetzels Apr 11, 2024
4ae6cf9
renaming of path/branch mapping API
floWetzels Apr 11, 2024
e2d0a6b
preprocessing for path/branch mappings working in MergeTreeDistanceMa…
floWetzels Apr 12, 2024
c32a75e
parallel computation for path/branch mapping distance in MergeTreeist…
floWetzels Apr 12, 2024
ff08b2d
Parallel assignment for path mapping distance in MergeTreeBarycenter
floWetzels Apr 15, 2024
8a8507b
added iteration limit for merge tree barycenter again
floWetzels Apr 16, 2024
dcd0798
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into p…
floWetzels Apr 16, 2024
4205c37
removed convergence flag in MergeTreeBarycenter and allowed unlimited…
floWetzels Apr 18, 2024
0783878
improved preprocessing in MergeTreeDistanceMatrix
floWetzels Apr 18, 2024
0875770
updated authors and publications in all edit distance related modules
floWetzels Apr 25, 2024
27de87e
clang-format
floWetzels Apr 25, 2024
630cca2
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into p…
floWetzels Apr 25, 2024
1abf1e1
compiler warnings
floWetzels Apr 29, 2024
9cccc23
[MergeTreeClustering] filter backends and options
MatPont May 2, 2024
70547be
[MergeTreeClustering] fix compute barycenter option caching with edit…
MatPont May 2, 2024
2c63c97
[MergeTreeClustering] fix barycenter dbug level when called in cluste…
MatPont May 2, 2024
a3c1515
[MergeTreeClustering] fix xml conditions for barycenter options
MatPont May 2, 2024
ccfe1f3
fixed inverted squared-parameter in MergeTreeDistanceMatrix
floWetzels Jul 23, 2024
85142bc
fixed cost array in matching output of MergeTreeClustering when using…
floWetzels Jul 24, 2024
18d6307
fixed cost array in mapping output for branch mapping distance
floWetzels Jul 24, 2024
225e6e9
clang format
floWetzels Jul 24, 2024
b83a149
removed old code and fixed some warnings
floWetzels Jul 24, 2024
13ee09f
[MergeTreeClustering] compute barycenter option caching
MatPont Aug 26, 2024
74764b1
[MergeTree] xml doc
MatPont Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CMake/merge_tree_planar_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ panel_visibility="advanced">
<BooleanDomain name="bool"/>
</IntVectorProperty>

<IntVectorProperty
name="PathPlanarLayout"
command="SetPathPlanarLayout"
label="Path Planar Layout"
number_of_elements="1"
default_values="0"
panel_visibility="advanced">
<Hints>
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="MergeTreePlanarLayout"
value="1" />
</Hints>
<Documentation>

</Documentation>
<BooleanDomain name="bool"/>
</IntVectorProperty>

<DoubleVectorProperty
name="BranchSpacing"
command="SetBranchSpacing"
Expand Down Expand Up @@ -184,6 +203,7 @@ default_values="0.05">

<PropertyGroup panel_widget="Line" label="Output options">
<Property name="BranchDecompositionPlanarLayout"/>
<Property name="PathPlanarLayout"/>
<Property name="BranchSpacing"/>
<Property name="ImportantPairs"/>
<Property name="MaximumImportantPairs"/>
Expand Down
24 changes: 24 additions & 0 deletions CMake/merge_tree_preprocess.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ panel_visibility="advanced">
mode="visibility"
property="Backend"
value="2" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="Backend"
value="3" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="Backend"
value="4" />
</Expression>
</PropertyWidgetDecorator>
</Hints>
Expand Down Expand Up @@ -81,6 +89,14 @@ default_values="5">
mode="visibility"
property="Backend"
value="2" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="Backend"
value="3" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="Backend"
value="4" />
</Expression>
</PropertyWidgetDecorator>
</Hints>
Expand Down Expand Up @@ -177,6 +193,14 @@ default_values="0">
mode="visibility"
property="Backend"
value="2" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="Backend"
value="3" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="Backend"
value="4" />
</Expression>
</PropertyWidgetDecorator>
</Hints>
Expand Down
100 changes: 60 additions & 40 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,61 @@
{
"version": 2,
"configurePresets": [
{
"name": "TTK-Default",
"hidden": true,
"binaryDir": "build",
"generator": "Ninja",
"cacheVariables": {
"TTK_ENABLE_DOUBLE_TEMPLATING": "ON"
}
},
{
"name": "TTK-Release",
"inherits": "TTK-Default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TTK_ENABLE_CPU_OPTIMIZATION": "OFF",
"TTK_ENABLE_MPI": "OFF",
"TTK_ENABLE_KAMIKAZE": "ON"
}
},
{
"name": "TTK-PerformanceBenchmark",
"inherits": "TTK-Default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TTK_ENABLE_CPU_OPTIMIZATION": "ON",
"TTK_ENABLE_KAMIKAZE": "ON"
}
},
{
"name": "TTK-Debug",
"inherits": "TTK-Default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"TTK_ENABLE_KAMIKAZE": "OFF"
}
}
]
}
"version": 6,
"configurePresets": [
{
"name": "TTK-Default",
"hidden": true,
"binaryDir": "build",
"generator": "Unix Makefiles",
"cacheVariables": {
"TTK_ENABLE_DOUBLE_TEMPLATING": "OFF"
}
},
{
"name": "TTK-Release",
"inherits": "TTK-Default",
"binaryDir": "build/release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TTK_ENABLE_CPU_OPTIMIZATION": "OFF",
"TTK_ENABLE_MPI": "OFF",
"TTK_ENABLE_KAMIKAZE": "ON",
"TTK_ENABLE_WEBSOCKETPP": "OFF",
"WEBSOCKETPP_DIR": "/home/wetzels/ttk/ttk-jonas/websocketpp/install/lib/cmake/websocketpp"
}
},
{
"name": "TTK-PerformanceBenchmark",
"inherits": "TTK-Default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TTK_ENABLE_CPU_OPTIMIZATION": "ON",
"TTK_ENABLE_KAMIKAZE": "ON"
}
},
{
"name": "TTK-Debug",
"inherits": "TTK-Default",
"binaryDir": "build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"TTK_ENABLE_KAMIKAZE": "OFF"
}
}
],
"buildPresets": [
{
"name": "TTK-Release",
"description": "",
"displayName": "",
"configurePreset": "TTK-Release",
"jobs": 4
},
{
"name": "TTK-Debug",
"description": "",
"displayName": "",
"configurePreset": "TTK-Debug",
"jobs": 4
}
]
}
68 changes: 55 additions & 13 deletions core/base/ftmTree/FTMTreeUtils_Template.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,63 @@ namespace ttk {
double threshold,
std::vector<double> &excludeLower,
std::vector<double> &excludeHigher) {
dataType rootPers = this->getNodePersistence<dataType>(this->getRoot());
if(threshold > 1)
threshold /= 100.0;
idNode treeRoot = this->getRoot();
dataType rootValue = this->getValue<dataType>(treeRoot);
dataType lowestNodeValue
= this->getValue<dataType>(this->getLowestNode<dataType>(treeRoot));
dataType rootPers
= (rootValue > lowestNodeValue ? rootValue - lowestNodeValue
: lowestNodeValue - rootValue);
threshold /= 100.0;
threshold = rootPers * threshold;
auto pers = this->getNodePersistence<dataType>(nodeId);

// Excluded pairs
bool isExcluded = false;
if(excludeLower.size() == excludeHigher.size())
for(unsigned i = 0; i < excludeLower.size(); ++i) {
isExcluded |= (pers > rootPers * excludeLower[i] / 100.0
and pers < rootPers * excludeHigher[i] / 100.0);
}

return pers > threshold and not isExcluded;
auto isImportantPairOneNode = [&](idNode node) {
auto pers = this->getNodePersistence<dataType>(node);

// Excluded pairs
bool isExcluded = false;
if(excludeLower.size() == excludeHigher.size())
for(unsigned i = 0; i < excludeLower.size(); ++i) {
isExcluded |= (pers > rootPers * excludeLower[i] / 100.0
and pers < rootPers * excludeHigher[i] / 100.0);
}
return (pers > threshold and not isExcluded);
};

if(isImportantPairOneNode(nodeId))
return true;

// Test if it is a parent of an important pair (for not persistence based
// branch decomposition)
idNode saddleNode
= (this->isLeaf(nodeId) ? this->getNode(nodeId)->getOrigin() : nodeId);
idNode leafNode
= (this->isLeaf(nodeId) ? nodeId : this->getNode(nodeId)->getOrigin());
std::queue<idNode> queue;
std::vector<bool> nodeDone(this->getNumberOfNodes(), false);
queue.emplace(leafNode);
while(!queue.empty()) {
idNode node = queue.front();
queue.pop();

if(isImportantPairOneNode(node))
return true;

nodeDone[node] = true;

idNode parent = this->getParentSafe(node);
if(parent != saddleNode)
if(not nodeDone[parent])
queue.emplace(parent);

std::vector<idNode> children;
this->getChildren(node, children);
for(auto child : children)
if(not nodeDone[child])
queue.emplace(child);
}

return false;
}

template <class dataType>
Expand Down
Loading
Loading