Skip to content

Merge Trees via ExTreeM

Merge Tree via ExTreeM example Image

Pipeline description

This example computes the merge tree and the join tree from an electronic density of the Adenine-Thymine molecular complex.

The ascending and descending segmentations needed for the computation are computed using PathCompression. They are computed by their own filter in this example, but generally, they will be computed by the MergeTree if they don't exist already.

The python script simply computes the segmentation and saves the geometry of the join and split trees .vtu files.

ParaView

To reproduce the example in Paraview, go to your ttk-data directory and enter the following command:

paraview states/mergeTreeExTreeM.pvsm

Python code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# state file generated using paraview version 5.10.1

# uncomment the following three lines to ensure this script works in future versions
# import paraview
# paraview.compatibility.major = 5
# paraview.compatibility.minor = 10

#### import the simple module from the paraview
from paraview.simple import *

#### disable automatic camera reset on 'Show'

# create a new 'XML Image Data Reader'
atvti = XMLImageDataReader(FileName=["at.vti"])
atvti.PointArrayStatus = ["density"]

# create a new 'TTK PathCompression'
tTKPathCompression1 = TTKPathCompression(Input=atvti)
tTKPathCompression1.ScalarField = ["POINTS", "density"]

# create a new 'TTK MergeTree'
tTKMergeTree1 = TTKMergeTree(Input=tTKPathCompression1)
tTKMergeTree1.ScalarField = ["POINTS", "density"]
tTKMergeTree1.TreeType = "Split Tree"
tTKMergeTree1.Backend = "ExTreeM (IEEE TVCG 2023)"

# create a new 'TTK MergeTree'
tTKMergeTree2 = TTKMergeTree(Input=tTKPathCompression1)
tTKMergeTree2.ScalarField = ["POINTS", "density"]
tTKMergeTree2.TreeType = "Join Tree"
tTKMergeTree2.Backend = "ExTreeM (IEEE TVCG 2023)"

SaveData("splitTree.vtu", proxy=OutputPort(tTKMergeTree1, 1))
SaveData("joinTree.vtu", proxy=OutputPort(tTKMergeTree2, 1))

To run the above Python script, go to your ttk-data directory and enter the following command:

pvpython python/mergeTreeExTreeM.py

Inputs

  • at.vti: A molecular dataset: a three-dimensional regular grid with 1 scalar field, the electronic density in the Adenine Thymine complex.

Outputs

  • joinTree.vtu: the join tree.
  • splitTree.vtu: the split tree.

C++/Python API

PathCompression

MergeTree