Skip to content

Time Tracking

Time tracking screenshot

Pipeline description

This example loads a 2D time-dependent scalar field, where time steps are stored as a sequence of data arrays.

Using TrackingFromFields, a tracking mesh for the temporal evolution of critical points is computed. This filter computes an optimal matching between persistence diagrams (with respect to Wasserstein metric), and discards critical point pairs below a persistence of 1% by default (parameter Tolerance).

The state file further contains an animation of the critical points over time.

ParaView

To reproduce the above screenshot, go to your ttk-data directory and enter the following command:

$ paraview --state=states/timeTracking.pvsm

Python code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
from paraview.simple import *

# create a new 'XML Image Data Reader'
timeTrackingvti = XMLImageDataReader(FileName=['timeTracking.vti'])
timeTrackingvti.CellArrayStatus = []
# select data arrays 000, 002, 004, ..., 118
timeTrackingvti.PointArrayStatus = ['{:0>3}'.format(i) for i in range(0, 120, 2)] 

# create a new 'TTK TrackingFromFields'
tTKTrackingFromFields1 = TTKTrackingFromFields(Input=timeTrackingvti)
tTKTrackingFromFields1.ForceZtranslation = 1
tTKTrackingFromFields1.ZTranslation = 0.125

# create a new 'Extract Surface'
extractSurface1 = ExtractSurface(Input=tTKTrackingFromFields1)

# save the output
SaveData('timeTracking.vtp', extractSurface1)

Inputs

  • timeTracking.vti: time-dependent vorticity of a 2D vortex street, with time steps represented by data arrays '000', '002', ..., '118'

Outputs

  • timeTracking.vtp: tracking mesh of critical points

C++/Python API

TrackingFromFields