We provide a number of options to produce synthetic data for tutorial and testing purposes. These synthetic data are generated on-the-fly and consumed by feature tracking algorithms.
One can use synthetic data sources (--synthetic
) in lieu of real data (--input
) when executing ftk
. The following example tracks critical points (-f cp
) in a 32-timestep 3D scalar field dataset, which contains one single minimum in a
$ ftk -f cp --synthetic moving_extremum_3d --width 32 --height 32 --depth 32 --timesteps 32 --output out.txt
To configure parameters including moving_extremum_3d.json
description file in the JSON format:
{
"type": "synthetic",
"name": "moving_extremum_3d",
"dimensions": [32, 32, 32],
"x0": [10,10,10],
"dir": [0.1, 0.11, 0.1],
"n_timesteps": 32
}
and then execute
$ ftk -f cp --input moving_extremum_3d.json --output out.txt
A complete list of synthetic data sources including parameters are introduced in the rest of this document.
One can find the list of FTK synthetic data sources in the "Sources --> FTK" menu. These data sources can be combined with filters under the "Filters --> FTK" menu. For many of the following examples, we provide .pvsm
(ParaView state file format) for one to reproduce the results. FTK/ParaView plug-ins need to be correctly built and loaded before loading the .pvsm
files we provide.
Here's an example of using pyft.synthesizers
:
import pyftk
data = pyftk.synthesizers.moving_extremum(11, 13, 20, 5, 5, 0.1, 0.2)
result = pyftk.trackers.track_critical_points_2d_scalar(data)
C++ functions are available to generate synthetic data in ndarray
data structures. See more details in ftk/ndarray/synthetic.hh
The spiral woven function is defined as scalaing_factor
, and the rotation center sits on the center of the image. This dataset is used to test critical point tracking in 2D regular-grid scalar field data.
-
scalaring_factor
(by default 15.0) scales$x$ and$y$ coordinates in the 2D regular grid and controls the density of woven -
dimensions
(by default[32, 32]
)
In the right figure, we demonstrate critical point tracking results with/without the presence of noise injection. For example, the following command injects Gaussian noise (
$ ftk -f cp --synthetic woven --perturbation 0.02 --output woven-0.02.vtp
- woven.pvsm: Critical point tracking in woven data without perturbation
-
woven-0.04.pvsm: Critical point tracking in woven data with perturbation (
$\sigma=0.04$ ) - woven-contour-0.2.pvsm: Contour tracking in woven data with the isovalue of 0.2
The merger function is defined as
dimensions
(by default[32, 32]
)n_timesteps
(by default 100)
To reproduce the results in the right figure, use the following command line:
$ ftk -f cp --synthetic merger_2d --output merger_2d.vtp --no-post-processing
Note that the --no-post-processing
option prevents trajectories being split into sub-trajectories with consistent types.
The double-gyre function is proposed by Shadden et al. and is used to study Lagrangian coherent structures in time-dependent dynamical systems. See the above link for more details. We use this dataset to test critical point tracking in 2D regular- and unstructured-grid vector field data.
dimensions
(by default[64, 32]
)n_timesteps
(by default 50)time_scale
(by default 0.1) defines how discrete timestep is mapped to time: t = time_scale * timestep
To reproduce the results in the right figure, use the following command line:
$ ftk -f cp --input double_gyre.json --output double_gyre.vtp
The contents of double_gyre.json
are
{
"type": "synthetic",
"name": "double_gyre",
"dimensions": [64,32],
"n_timesteps": 50,
"time_scale": 2.0
}
- double-gyre.pvsm (SurfaceLIC plug-in may be needed to visualize the vector field)
The moving extremum 2D function is defined as
x0
(by default[10, 10]
)dir
(by default[0.1, 0.1]
)dimensions
(by default[64, 32]
)n_timesteps
(by default 50)
- moving-extremum-2d.pvsm combines four visualizations
- MovingExtremum2DSource with 100 timesteps
- CriticalPointTracker2D visualized as the tube in the center)
- LevelsetTracker2D ("traced" output) visualized as spacetime isosurface with the threshold of 10
- LevelsetTracker2D ("sliced" output) visualized as contour lines with the threshold of 10
Similar to the moving extremum 2D data, the 3D version is defined as
x0
(by default[10, 10, 10]
)dir
(by default[0.1, 0.11, 0.1]
)dimensions
(by default[21, 21, 21]
)n_timesteps
(by default 32)
- moving-extremum-3d-6.pvsm Critical point trajectories of six (6) different moving extremum data. It may take a while to load because 4D isovolumes are reconstructed.
The 3D moving ramp function is defined as
-
x0
(by default 10) -
rate
(by default 0.1) defines the the changing rate of$x_0$ . -
dimensions
(by default[21, 21, 21]
) -
n_timesteps
(by default 32)
- ramp.pvsm (May take a while because 4D isovolumes are reconstructed)
The dual ramp is defined as
-
x0
(by default 10) -
rate
(by default 0.1) defines the the changing rate of$x_0$ . -
offset
(by default 2.0) -
dimensions
(by default[21, 21, 21]
) -
n_timesteps
(by default 32)
- dual-ramp.pvsm: Tracking of two isosurfaces in the dual ramp data. Color encodes the unique ID of each surface. It may take a while because 4D isovolumes are reconstructed