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.3.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.3-cp313-cp313-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.13Windows x86-64

openlpt-2.2.3-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.3-cp313-cp313-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

openlpt-2.2.3-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.3-cp312-cp312-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

openlpt-2.2.3-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.3-cp311-cp311-macosx_15_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.10Windows x86-64

openlpt-2.2.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: openlpt-2.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 7daaa6b715d8ff6dd62873717918a4517eeededfd0ccef4d41f200d168737e4c
MD5 5be0232a738eabf042bf7885229d3df2
BLAKE2b-256 8aa73b0ba5d3f33479dda15c57eb17dd8b65aa3248828ed55369dafe95a222f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openlpt-2.2.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a52fa588bc5d48aae8bb607c8137b73bb1dc09eab33ddeeb3fea62499a213f44
MD5 d55d66514bd15e423d2aa52209c19ba3
BLAKE2b-256 c0674050214008ac6e4e8eb22e9465d90785a4bf8f55424f217d06e90869a7ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8d79e3b2480dc90cdda21f5838f24f4569088057b87c67d26a7d5df318b352ce
MD5 31d871ed3925ae4a11aa717b0aee0ec2
BLAKE2b-256 97d8af1e7d5e008438991bed4bc1f07e085e787ffcde408298d9c0ba2dc4233f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 121c1f3df637376b850b574aee3d0a9f41100ce7bd2060f01d0630b3a1947c08
MD5 a2643aad1d3f289563ffc470c8a58f14
BLAKE2b-256 9b4c64c19c99c96273e18071717c4d97e7d1976dea18e71ca3b97ee2924069c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openlpt-2.2.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f16ee3a729e9371160f10594bcceb3a835373182b19cde56099a937939eb2afc
MD5 d9e4bc5a9a4f3de556a7899ebc91d73f
BLAKE2b-256 94fab4802b9f4546d91649c799077fa57dc9e0b2c694c148a190b17a1b56c911

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2614b10d39787fef0eb84062bf42662fe32dd241a9104d0023493826f8a87030
MD5 42449d7611613ba89f3d9e646b3471d0
BLAKE2b-256 ac7ba8c564459a5d6baf3653111e963f7b4272ad5a0f3a823d70f206ac2d19fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8df0f4c19850017236a178cb755fcfa0ba4f535cb6c30ddd8b7a9b6afd8a0085
MD5 7acfca6a5be3be4506b0fe9c66b8df04
BLAKE2b-256 37b1b5528da33180837b8a7cede1182c90b7d8876e53eec645e03cdd41742fb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openlpt-2.2.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 11b6a3df33ddfa9a810f05dcb9096dd951880ab29d1c5ce82c92715785590092
MD5 df6845fce23bdbb5612f5476c0d754b4
BLAKE2b-256 b5aabf403f19230abe56f2ddac405b52b9c336e946771c9189041494e9bafcff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8f55b039637f9cb1e4518cb59b7b4c50804021895ee9addbec87bdb60665e47d
MD5 b02ee9dc6c824cd3bc257236ef84af73
BLAKE2b-256 84fceb791c4d9228188f3519b733fd194ddc9f2a28343fa8f252f5294fbb7b04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 78b86db3b729bbfd5bf7219d5e5e378e28ba837009eeaa5280c695aafa4cf7da
MD5 17c49b67477250b4fd6afcd6b1df7659
BLAKE2b-256 490c83391401e2bde4d6f4abdb026b74aed3ab47cc0d57e823afb39bcedf3f75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openlpt-2.2.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 36c5fafd716504d6131f713786f4017af1fdca12cca570ac8f82027b4199ab58
MD5 a29a76527409bfd4b6d50d52241cba7a
BLAKE2b-256 fe46148159dc2eb49924e82c6a9d07398a279a072e366ac219fc689cfcd71a18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 55b250038e0b662b08d6048576149d7ac83062ef55b8e46d702128c08a0c5cac
MD5 9c7ddc0f279ff1ea9aabfcf7c7deef21
BLAKE2b-256 ccf538f9bcf96d752a213dc34ab27fbaa0be02e792235c67f479632bd1c6ece3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openlpt-2.2.3-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d042875f88a4e566d786371b74d4277d608ca784a266cfca957de4361b98dbf6
MD5 b5e983effcc78b50b6c03277c2f4e31c
BLAKE2b-256 4d91730b6ef5f4bf623a13737137f08d9a06b32266178781244c3e9b5db984b2

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