Skip to main content

Open-source Lagrangian Particle Tracking (LPT) with GUI and CLI

Project description

OpenLPT - Open-source Lagrangian Particle Tracking GUI

GitHub Stars Python Version License PyPI Downloads

OpenLPT is a powerful, user-friendly open-source software for 3D Lagrangian Particle Tracking (LPT), designed for experimental fluid dynamics and flow visualization. Developed by the Ni Research Lab at Johns Hopkins University (JHU), it provides a comprehensive GUI-based workflow for high-precision particle tracking and reconstruction.


🚀 Key Capabilities

  • 3D Particle Tracking: Robust Lagrangian tracking (LPT) and Shake-the-Box (STB) methods.
  • Multi-Camera Calibration: Easy-to-use tools for wand and plate calibration (intrinsic & extrinsic parameters).
    • Note: The current calibration implementation assumes no refraction. For experimental setups involving observation windows, it is critical that the cameras are oriented as close to the surface normal (orthogonal) as possible.
  • Cross-Platform: Full support for Windows, macOS, and Linux.
  • Performance: High-performance C++ core with Python Python bindings for flexibility and speed.

Keywords: Lagrangian Particle Tracking (LPT), Shake-the-Box (STB), 3D Flow Visualization, PIV, Particle Reconstruction, Multi-camera Calibration, Experimental Fluid Dynamics, JHU Ni Research Lab.


Quick Start

[!TIP] Ensure you have activated your environment before running these commands: conda activate OpenLPT (On Windows, we recommend using Command Prompt (CMD) as PowerShell may have execution policy restrictions).

1. Graphical User Interface (GUI)

# Launch the interactive GUI
openlpt-gui

2. Command Line Interface (CLI)

# Run STB tracking directly with a config file
openlpt path/to/config.txt

# Show image preprocessing CLI help
openlpt preprocess --help

3. Python API

import openlpt as lpt

# Run tracking programmatically
lpt.run('path/to/config.txt')

# Or launch GUI from within a script
lpt.launch_gui()

Demo

https://github.com/user-attachments/assets/60579007-4f24-4989-8b36-3de2224c9797


Features

  • User-friendly interface in python
  • Lagrangian particle tracking for multiple objects (point-like particles, spherical particles, etc.)
  • Support stereomatching with multiple cameras (at least 2)
  • Include multiple test cases for users to test and understand the code
  • Better structure for adding new functions

Installation

Method 1: One-Click Installation (Recommended for developers)

We provide automated scripts that set up everything for you (including Conda, environment, and dependencies).

  1. Download the code:

    git clone https://github.com/JHU-NI-LAB/OpenLPT_GUI.git
    cd OpenLPT_GUI
    
  2. Run the Installer:

    • Windows: Double-click install_windows.bat (Or run in terminal: install_windows.bat)

    • macOS: Run in terminal:

      bash install_mac.command
      
    • Linux: Run in terminal:

      bash install_linux.sh
      
  3. Launch the GUI: After installation, simply run:

    openlpt-gui
    

Method 2: Direct Pip Installation (Easiest)

You can install OpenLPT directly from PyPI:

  • For GUI Support (Recommended):
    pip install "openlpt[gui]"
    
  • For CLI-only:
    pip install "openlpt"
    

Method 3: Manual Installation (Click to expand)

If you prefer to set up the environment manually:

  1. Prerequisites:

    • Miniforge or Anaconda
    • C++ Compiler (Visual Studio 2022 for Windows, Clang for macOS/Linux)
  2. Create Environment and Install:

    # Create environment
    conda create -n OpenLPT python=3.10
    conda activate OpenLPT
    
    # Build and install the package
    pip install .
    

Troubleshooting

Problem Solution
Windows: Build fails Install VS Build Tools and Win11 SDK
macOS: omp.h not found See macOS OpenMP Fix section below
macOS: Architecture python -c "import platform; print(platform.machine())"
Linux: Permissions Use chmod +x or sudo
All: Stale cache Delete build/ folder and retry
Installation: Build isolation If compilation fails due to network, try pip install . --no-build-isolation

macOS OpenMP Fix

If you get fatal error: 'omp.h' file not found:

export CC="$CONDA_PREFIX/bin/clang"
export CXX="$CONDA_PREFIX/bin/clang++"
export CPPFLAGS="-I$CONDA_PREFIX/include"
export LDFLAGS="-L$CONDA_PREFIX/lib -lomp"
pip install -e .

Samples and Tests

Please see the sample format of configuration files, camera files and image files in /test/test_STB or /test/test_STB_Bubble.

To run the sample:

  1. Open OpenLPT GUI.
  2. Load the project configuration from the sample folders.
  3. Click 'Run tracking'.

CLI Image Preprocessing

Use openlpt preprocess to convert TIFF image lists, direct TIFF files, or Phantom CINE files into processed TIFF outputs plus OpenLPT image lists.

Auto-detect cameras from a data root

openlpt preprocess \
  --input-root I:/VONSET/Data/20230123/T2 \
  --frames 0 999

--input-root auto-detects cameras in natural order. It first looks for CINE files in ROOT/Cam1/*.cine, ROOT/Cam2/*.cine, ... (case-insensitive directory names are fine), and also supports flat roots such as ROOT/cam1.cine, ROOT/cam2.cine. If --output-dir is omitted in this mode, output defaults to ROOT/imgFile.

TIFF list preprocessing

openlpt preprocess \
  --input-list cam1_images.txt \
  --input-list cam2_images.txt \
  --output-dir processed_tiffs

CINE preprocessing on a cluster

openlpt preprocess \
  --input-root /scratch/run01 \
  --frames 0 999 \
  --background mean

You can still use direct --cine paths when needed:

openlpt preprocess \
  --cine /scratch/cam1.cine \
  --cine /scratch/cam2.cine \
  --frames 0 999 \
  --output-dir /scratch/preprocessed \
  --background mean

Mean background, invert, and output image lists

openlpt preprocess \
  --input-list cam1_images.txt \
  --output-dir processed_tiffs \
  --background mean \
  --bg-count 50 \
  --bg-stride 5 \
  --invert

Parallel processing with multiple workers

openlpt preprocess \
  --input-list cam1_images.txt \
  --input-list cam2_images.txt \
  --output-dir processed_tiffs \
  --workers 4

Use --workers 0 to use all available CPU cores, which is convenient for cluster jobs:

openlpt preprocess \
  --cine /scratch/cam1.cine \
  --frames 0 999 \
  --output-dir /scratch/preprocessed \
  --workers 0

Processed TIFFs are written under OUTPUT_DIR/camN/, and per-camera image lists are written as OUTPUT_DIR/camN_image_list.txt.

For --input-root, TIFF camera folders under the root are also auto-detected and processed in natural camera order. TIFF root mode currently expects per-camera subdirectories; flat TIFF roots are not auto-grouped.

In the GUI preprocessing panel, use Generate CLI below Process Image (Batch Export) to create a command from the current GUI settings. When all loaded CINE files share a common ROOT/CamN/ layout, the generated command prefers --input-root ROOT and uses ROOT/imgFile rather than imgFile_processed.

[!NOTE] CINE preprocessing requires pycine, which is listed in this repository's requirements.txt and pyproject.toml. The preprocessing CLI modules are headless/Qt-free, but some full-repository install routes also include GUI dependencies such as PySide6.


Citation

If you use OpenLPT in your research, please cite our publications:

  • Tan, S., Salibindla, A., Masuk, A.U.M. and Ni, R., 2020. Introducing OpenLPT: new method of removing ghost particles and high-concentration particle shadow tracking. Experiments in Fluids, 61(2), p.47.
  • Tan, S., Zhong, S. and Ni, R., 2023. 3D Lagrangian tracking of polydispersed bubbles at high image densities. Experiments in Fluids, 64(4), p.85.

License

This repository contains a mix of original code and MATLAB Coder-generated files under a MathWorks Academic License.

⚠️ Restricted Paths (MATLAB Coder-generated)

The following paths contain code generated by MATLAB Coder and are NOT covered by the general MIT/Open-source license of this repository:

  • /src/srcObject/BubbleCenterAndSizeByCircle
  • /src/srcObject/BubbleCenterAndSizeByCircle/CircleIdentifier.cpp
  • /src/srcObject/BubbleResize
  • /inc/libObject/BubbleCenterAndSizeByCircle
  • /inc/libObject/CircleIdentifier.h
  • /inc/libObject/BubbleResize

📜 Terms and Conditions

For the paths listed above:

  • ACADEMIC INTERNAL OPERATIONS ONLY: Usage is restricted to teaching, academic research, and course requirements.
  • NO Commercial Use: Government, commercial, or other organizational use is NOT permitted.
  • Header Preservation: Do not modify or remove the "Academic License" header comments in these files.
  • No Sublicensing: These files are not sublicensed under this repository's open-source license.
  • Redistribution: If you redistribute this repository, you must keep the original Academic License headers in the generated files.
  • Modification: If you need to modify the generated code, you must hold a valid MathWorks MATLAB Coder license.

All other files in this repository are original work and are distributed under the MIT License (see LICENSE).


Contact & Contribution

  • Issues: Please report bugs or request features via GitHub Issues.
  • Contact: For questions, please contact szhong12@jhu.edu or tanshiyong84@gmail.com.
  • Organization: Ni Research Lab, Johns Hopkins University.
  • Support: If you find this tool helpful, please give us a ⭐ on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openlpt-2.2.2.tar.gz (5.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openlpt-2.2.2-cp313-cp313-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.13Windows x86-64

openlpt-2.2.2-cp313-cp313-manylinux_2_28_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

openlpt-2.2.2-cp313-cp313-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

openlpt-2.2.2-cp312-cp312-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.12Windows x86-64

openlpt-2.2.2-cp312-cp312-manylinux_2_28_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

openlpt-2.2.2-cp312-cp312-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

openlpt-2.2.2-cp311-cp311-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.11Windows x86-64

openlpt-2.2.2-cp311-cp311-manylinux_2_28_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

openlpt-2.2.2-cp311-cp311-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

openlpt-2.2.2-cp310-cp310-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.10Windows x86-64

openlpt-2.2.2-cp310-cp310-manylinux_2_28_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

openlpt-2.2.2-cp310-cp310-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file openlpt-2.2.2.tar.gz.

File metadata

  • Download URL: openlpt-2.2.2.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openlpt-2.2.2.tar.gz
Algorithm Hash digest
SHA256 6bd7cb84018f466cae18ea3ed43b492c80b805c5ecac6d1c1efc376befadcdd2
MD5 bc70cbfcd319da9791c77113faec77a6
BLAKE2b-256 ec207527a6f366afa6783510c6ed5290487f98e7f3e4df864c18251dcabd870c

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: openlpt-2.2.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openlpt-2.2.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 619312bf66c11880beeea891149d921ec1269f1239ae37c5c790695afbcd6709
MD5 22741a299f9a0c8df1a9921057487287
BLAKE2b-256 27f98aa3658268335ad22e2d90584d5fe6bbabcacde43d1f31e1171e0e436b56

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ada3ad578ec410f285ff4000ec2de8840b25fe3ec56111d1def29cb25b5e89f8
MD5 c9ccfa080c3989abb149d756c06f27ea
BLAKE2b-256 cbfe50c914ad0ece344f1d6d41966f5556f166a98063a607ff7de8b4cdd18db3

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d2da36ce93dae046b00c524876cde64888848982de56eeb8732fe7eba68f6588
MD5 88126cb9434fab87114f1cc7ac93b78e
BLAKE2b-256 47b13747fc22f3f63b8432fbe254fa7ca6137cd022a95133f8a83e8de7debb23

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: openlpt-2.2.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openlpt-2.2.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7b7c9a281c782cac3b9dae8d2b698f3d4f11ad1d8c9b8b716415b9f966faf474
MD5 d3e4efb5cf606b0799e57b0887fcc42e
BLAKE2b-256 88698a655b40b380bba78fd607d69d761258c82080d2f6d9c9cc529aa0674acd

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08342c0cc07e38f21ad7b9b83d1f5051f4318919a68ef4efa7c4f5d8dff918da
MD5 113304b7898a0673410046e06cd03d0d
BLAKE2b-256 75e459093d57c4e907784d7e9464eb0edfcb675cd5c420c929d83994e7296669

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6c39f90e3193e5d127afa7019a1f01d6cdf1bb0736d1bcaba143a7d0bea92694
MD5 98661994fe0f1146dfe5601ee4d4a188
BLAKE2b-256 e247b363a016893338dfc222e6612c3f9f8b5ed30a68fd8957aa1dc0154d7375

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: openlpt-2.2.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openlpt-2.2.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2eef9c03153886150a02bc97654bbd4485edd4699a627147287438b61603b7a3
MD5 200899474f41502fa008c5604648c1dd
BLAKE2b-256 7b4e0c6d610d97a24b78dcb5b57331a7e2f6022864b90cf8d8132235db9166c0

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 588104335da318e51b1bb9802027faee17b6c569d2e6bf70f1c1c8ea1253e7f9
MD5 668db6724b984230f77b550322fbfceb
BLAKE2b-256 db639a27b1d321079f1f80c181f6e0fb3dcead126e671529e77e07a9fa20164b

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4c48335fdfc37ff060bae1a904be05c3c5e226399079528673bbb4c9f669fad1
MD5 6c094dae3edce679d7068fb94f8300c2
BLAKE2b-256 e8e567d0512a18edc5fd3cda0b703b0ddb27fe87b7367f4ba141e961c840fd51

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: openlpt-2.2.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openlpt-2.2.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cfc89553caadea50200441368e10561f49091dbcee489efe5ccdf76374adb93f
MD5 60e44bdeb087f170bf47f5fad6d1fda9
BLAKE2b-256 4b7ebc4e0679e93809fa56a08d19b67cf4053e5b09b25342ced02396b7f0ae64

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 439364f62cf4d27c0fbeb082b5c6de0d0454edca7047e13461c731c83798917d
MD5 b80932cf903e5206ef19cbdb544ba004
BLAKE2b-256 8f44b8887a5029b02f72fd8f1b5ea849503f22fee0a6096be230d80b8161faaa

See more details on using hashes here.

File details

Details for the file openlpt-2.2.2-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for openlpt-2.2.2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 08fad9ab03f8ce77342c68ae8384401dba70e24379d36209449f2b995ef84d23
MD5 ce1e703731c856dce31dc402899c4c87
BLAKE2b-256 b6c7282c01a70014a923d59c90131614008ab8c9849dc35a1d89a5e9ae32d04b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page