Learn how to use the PyPTV graphical user interface for particle tracking analysis.
# Activate environment
conda activate pyptv
# Launch GUI from any directory
python -m pyptv.pyptv_gui
## GUI Requirements and Testing
The PyPTV GUI requires a display (X11 on Linux/macOS, or native on Windows). GUI-dependent tests are located in `tests_gui/` and are not run in CI or Docker. Run these tests locally or with Xvfb if needed.
For headless testing, see the main README and installation guide.
# Or from PyPTV source directory
cd pyptv
python -m pyptv.pyptv_gui
from pyptv.pyptv_gui import MainGUI
from pathlib import Path
# Launch with specific experiment
experiment_path = Path("path/to/your/experiment")
gui = MainGUI(experiment_path, Path.cwd())
gui.configure_traits()
The PyPTV interface consists of several main areas:
Option A: Load Existing YAML
File → Load Experiment → Select parameters.yaml
Option B: Load Legacy Parameters
File → Load Legacy → Select parameters/ folder
# Automatically converts to YAML format
Option C: Create New Experiment
File → New Experiment → Choose directory
# Creates basic parameter structure
After loading an experiment:
Process one frame to test setup:
Click "Detection" button
→ Blue crosses mark detected particles
Click "Correspondences" button
→ Colored lines connect matching particles
Click "Determination" button
→ Calculates 3D positions
Process multiple frames:
Method 1: Right-click in Parameter Tree
Right-click parameter set → "Edit Parameters"
→ Opens parameter editing dialog
Method 2: Direct File Editing
Edit parameters.yaml in text editor
→ Reload experiment in GUI
Method 3: Calibration-specific
Calibration → Open Calibration
→ Specialized calibration interface
Create multiple parameter configurations:
Right-click in parameter tree → "Add Parameter Set"
→ Enter name (e.g., "HighSpeed", "LowLight")
Right-click parameter set → "Set as Active"
Right-click → "Duplicate Parameter Set"
Key parameter groups:
Section | Purpose | Key Settings |
---|---|---|
ptv | General PTV settings | Image names, camera count, preprocessing |
detect_plate | Particle detection | Gray thresholds, size limits |
criteria | Correspondence matching | Search tolerances, minimum matches |
track | Particle tracking | Velocity limits, trajectory linking |
cal_ori | Calibration | Camera files, calibration images |
detect_plate:
gvth_1: 80 # Primary detection threshold
gvth_2: 40 # Secondary threshold
min_npix: 5 # Minimum particle size
max_npix: 100 # Maximum particle size
criteria:
eps0: 0.2 # Search radius (mm)
corrmin: 2 # Minimum cameras for correspondence
cn: 0.02 # Additional tolerance
track:
dvxmin: -50.0 # Velocity limits (mm/frame)
dvxmax: 50.0
dvymin: -50.0
dvymax: 50.0
img/cam1.XXXXX
, img/cam2.XXXXX
, etc.cal/cam1.tif
, cal/cam2.tif
, etc.parameters.yaml
cam1_targets
, cam2_targets
, etc.rt_is.XXXXX
filesptv_is.XXXXX
files.ori
and .addpar
filesRight-click parameter tree → "Configure Plugins"
→ Select tracking and sequence plugins
# Script for multiple experiments
for experiment in experiment_list:
gui.load_experiment(experiment)
gui.process_sequence()
gui.export_results()
# Add custom overlays
def custom_overlay(camera_view, data):
camera_view.plot_custom_data(data)
“Images not found”
“Calibration errors”
“No particles detected”
“Poor correspondences”
Enable verbose output:
python -m pyptv.pyptv_gui --debug
Check log files:
tail -f pyptv.log
Key | Action |
---|---|
Ctrl+O |
Open experiment |
Ctrl+S |
Save parameters |
F5 |
Refresh/reload |
Space |
Process next frame |
Esc |
Cancel current operation |
Next: Learn about Camera Calibration or Parameter Migration