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 86 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
86 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
da70930
[BranchMappingDistance] fixed type of cost array
floWetzels Dec 19, 2024
ebc62ec
[BranchMappingDistance] fixed missing entries in cost array
floWetzels Dec 19, 2024
053a545
Merge branch 'dev' of https://github.com/topology-tool-kit/ttk into p…
floWetzels Dec 19, 2024
807dc36
[BranchMappingDistance] removed outcommented code
floWetzels Dec 19, 2024
8f414bb
Merge https://github.com/topology-tool-kit/ttk into path-mapping-prep…
MatPont Dec 25, 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
3 changes: 3 additions & 0 deletions core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ int ttkMergeTreeClustering::runOutput(
visuMaker.setOutputSegmentation(OutputSegmentation);
visuMaker.setDimensionSpacing(DimensionSpacing);
visuMaker.setDimensionToShift(DimensionToShift);
visuMaker.setDimensionsShift(XShift, YShift, ZShift);
visuMaker.setImportantPairs(ImportantPairs);
visuMaker.setMaximumImportantPairs(MaximumImportantPairs);
visuMaker.setMinimumImportantPairs(MinimumImportantPairs);
Expand Down Expand Up @@ -763,6 +764,7 @@ int ttkMergeTreeClustering::runOutput(
visuMaker.setOutputSegmentation(OutputSegmentation);
visuMaker.setDimensionSpacing(DimensionSpacing);
visuMaker.setDimensionToShift(DimensionToShift);
visuMaker.setDimensionsShift(XShift, YShift, ZShift);
visuMaker.setImportantPairs(ImportantPairs);
visuMaker.setMaximumImportantPairs(MaximumImportantPairs);
visuMaker.setMinimumImportantPairs(MinimumImportantPairs);
Expand Down Expand Up @@ -874,6 +876,7 @@ int ttkMergeTreeClustering::runOutput(
visuMakerBary.setOutputSegmentation(false);
visuMakerBary.setDimensionSpacing(DimensionSpacing);
visuMakerBary.setDimensionToShift(DimensionToShift);
visuMakerBary.setDimensionsShift(XShift, YShift, ZShift);
visuMakerBary.setImportantPairs(ImportantPairs);
visuMakerBary.setMaximumImportantPairs(MaximumImportantPairs);
visuMakerBary.setMinimumImportantPairs(MinimumImportantPairs);
Expand Down
12 changes: 12 additions & 0 deletions core/vtk/ttkMergeTreeClustering/ttkMergeTreeClustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class TTKMERGETREECLUSTERING_EXPORT ttkMergeTreeClustering
bool RescaleTreesIndividually = false;
double DimensionSpacing = 1.;
int DimensionToShift = 0;
double XShift = 1.0;
double YShift = 0.0;
double ZShift = 0.0;
double ImportantPairs = 50.;
int MaximumImportantPairs = 0;
int MinimumImportantPairs = 0;
Expand Down Expand Up @@ -365,6 +368,15 @@ class TTKMERGETREECLUSTERING_EXPORT ttkMergeTreeClustering
vtkSetMacro(DimensionToShift, int);
vtkGetMacro(DimensionToShift, int);

vtkSetMacro(XShift, double);
vtkGetMacro(XShift, double);

vtkSetMacro(YShift, double);
vtkGetMacro(YShift, double);

vtkSetMacro(ZShift, double);
vtkGetMacro(ZShift, double);

vtkSetMacro(ImportantPairs, double);
vtkGetMacro(ImportantPairs, double);

Expand Down
57 changes: 44 additions & 13 deletions core/vtk/ttkPlanarGraphLayout/ttkMergeTreeVisualization.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class ttkMergeTreeVisualization : public ttk::MergeTreeVisualization {
bool PlanarLayout = false;
double DimensionSpacing = 1.;
int DimensionToShift = 0;
double XShift = 1.0;
double YShift = 0.0;
double ZShift = 0.0;
bool OutputSegmentation = false;
int MaximumImportantPairs = 0;
int MinimumImportantPairs = 0;
Expand Down Expand Up @@ -118,6 +121,20 @@ class ttkMergeTreeVisualization : public ttk::MergeTreeVisualization {
void setDimensionToShift(int i) {
DimensionToShift = i;
}
void setXshift(double shift) {
XShift = shift;
}
void setYshift(double shift) {
YShift = shift;
}
void setZshift(double shift) {
ZShift = shift;
}
void setDimensionsShift(double xShift, double yShift, double zShift) {
setXshift(xShift);
setYshift(yShift);
setZshift(zShift);
}
void setOutputSegmentation(bool b) {
OutputSegmentation = b;
}
Expand Down Expand Up @@ -903,19 +920,6 @@ class ttkMergeTreeVisualization : public ttk::MergeTreeVisualization {
break;
}

// Get dimension shift
printMsg("// Get dimension shift", ttk::debug::Priority::VERBOSE);
double diff_z = PlanarLayout ? 0 : -std::get<4>(allBounds[i]);
// TODO DimensionToShift for Planar Layout
if(not PlanarLayout)
if(DimensionToShift != 0) { // is not X
if(DimensionToShift == 2) // is Z
diff_z = diff_x;
else if(DimensionToShift == 1) // is Y
diff_y = diff_x;
diff_x = -std::get<0>(allBounds[i]);
}

// Planar layout
printMsg("// Planar Layout", ttk::debug::Priority::VERBOSE);
std::vector<float> layout;
Expand All @@ -935,6 +939,33 @@ class ttkMergeTreeVisualization : public ttk::MergeTreeVisualization {
}
}

// Get dimension shift
printMsg("// Get dimension shift", ttk::debug::Priority::VERBOSE);
double diff_z = PlanarLayout ? 0 : -std::get<4>(allBounds[i]);
if(DimensionToShift != 0) { // is not X
float minX = 0;
if(PlanarLayout) {
minX = layout[0];
for(unsigned int l = 0; l < layout.size(); ++l) {
if(l % 2 == 0)
minX = std::min(minX, layout[l]);
}
}
double new_diff_x = PlanarLayout ? -minX : -std::get<0>(allBounds[i]);
if(DimensionToShift == 2) { // is Z
diff_z = -diff_x;
diff_x = new_diff_x;
} else if(not clusteringOutput and DimensionToShift == 1) { // is Y
diff_y = diff_x;
diff_x = new_diff_x;
} else if(DimensionToShift == 3) { // Custom
if(not clusteringOutput)
diff_y = YShift * diff_x + (1 - YShift) * diff_y;
diff_z = ZShift * -diff_x + (1 - ZShift) * diff_z;
diff_x = XShift * diff_x + (1 - XShift) * new_diff_x;
}
}

// Internal arrays
printMsg("// Internal arrays", ttk::debug::Priority::VERBOSE);
int cptNode = 0;
Expand Down
65 changes: 61 additions & 4 deletions paraview/xmls/MergeTreeClustering.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,20 +362,74 @@ Online examples:
mode="visibility"
property="OutputTrees"
value="1" />
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="MergeTreePlanarLayout"
value="0" />
</Hints>
<EnumerationDomain name="enum">
<Entry value="0" text="X"/>
<Entry value="1" text="Y"/>
<Entry value="2" text="Z"/>
<Entry value="3" text="Custom"/>
</EnumerationDomain>
<Documentation>
</Documentation>
</IntVectorProperty>

<DoubleVectorProperty
name="XShift"
command="SetXShift"
label="X Shift"
number_of_elements="1"
default_values="1"
panel_visibility="advanced">
<Hints>
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="DimensionToShift"
value="3" />
</Hints>
<Documentation>

</Documentation>
<DoubleRangeDomain name="range" min="0" max="1" />
</DoubleVectorProperty>

<DoubleVectorProperty
name="YShift"
command="SetYShift"
label="Y Shift"
number_of_elements="1"
default_values="0"
panel_visibility="advanced">
<Hints>
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="DimensionToShift"
value="3" />
</Hints>
<Documentation>

</Documentation>
<DoubleRangeDomain name="range" min="0" max="1" />
</DoubleVectorProperty>

<DoubleVectorProperty
name="ZShift"
command="SetZShift"
label="Z Shift"
number_of_elements="1"
default_values="0"
panel_visibility="advanced">
<Hints>
<PropertyWidgetDecorator type="GenericDecorator"
mode="visibility"
property="DimensionToShift"
value="3" />
</Hints>
<Documentation>

</Documentation>
<DoubleRangeDomain name="range" min="0" max="1" />
</DoubleVectorProperty>

<IntVectorProperty
name="BarycenterPositionAlpha"
command="SetBarycenterPositionAlpha"
Expand Down Expand Up @@ -469,6 +523,9 @@ Online examples:
<Property name="OutputTrees"/>
<Property name="DimensionSpacing"/>
<Property name="DimensionToShift"/>
<Property name="XShift"/>
<Property name="YShift"/>
<Property name="ZShift"/>
<Property name="BarycenterPositionAlpha"/>
<Property name="MergeTreePlanarLayout"/>
</PropertyGroup>
Expand Down