Skip to main content

pyALDIC-3D

Stereo / 3D Digital Image Correlation desktop application — full-field 3D shape, displacement, and surface strain from a synchronized two-camera setup.

CI Tests Python PySide6 PyVista License

pyALDIC-3D main window — three-column layout: dual-camera import + calibration + ROI + parameters on the left, interactive canvas in the center, run controls + fields + 3D view + log on the right


What it is

pyALDIC-3D is an independent, self-contained application for stereo (two-camera) Digital Image Correlation. Point it at two synchronized image sequences and a stereo calibration, and it reconstructs the specimen surface in 3D and tracks its displacement and Green–Lagrange surface strain through the sequence — all in millimetre-native world coordinates (the left camera is the world origin).

It is built on top of the pyALDIC-2D platform (arXiv:2607.22755, preprint under review), which it consumes as a pinned, read-only library (al-dic==0.7.*) for the underlying 2D correlation engine (Augmented-Lagrangian DIC: local IC-GN subproblems coupled to a global FEM regularizer). Everything above the 2D solver — stereo calibration, correspondence strategies, triangulation, 3D surface strain, the 3D visualization layer, the project format, and the workflow — is pyALDIC-3D's own.

The algorithm follows the MATLAB 3D-Stereo-ALDIC reference (Tong et al., Experimental Mechanics, 2025) as a mathematical model, ported into idiomatic, tested Python — not a literal translation.

Scope (honest): v1 supports a two-camera stereo rig. The data model is N-camera-ready, but N-camera (>2) support is planned for post-v1.


Key features

Area Highlights
Calibration Built-in OpenCV stereo calibration (chessboard, ChArUco, circle-grid, and a self-developed coded circular-target detector) with per-image QC, worst-pair rejection, epipolar validation, and optional bundle adjustment — or import from 6 external formats.
Correspondence & tracking Three pluggable strategies (track_both, stereo_each_frame, ref_direct); accumulative & incremental reference modes with Every-Frame / Every-N / Custom reference update; AL-DIC global step + local IC-GN; FFT, multi-seed Starting-Points propagation, or previous-frame initial guess; quadtree mesh refinement; ROI toolbox; quality + honesty gates.
3D reconstruction & strain DLT triangulation to a metric surface; surface strain via plane-fit + Green–Lagrange, with 3 strain types (Green–Lagrange / infinitesimal / Euler–Almansi), 3 coordinate systems (fitted-plane / left-camera / custom 3-point), edge-trim, and a Numba-accelerated kernel.
Crack-aware DIC Detects a thin masked barrier in the ROI, cuts the mesh so the FEM/global step never bridges the crack, and applies crack-aware strain neighbour exclusion + trimming.
Visualization & export Interactive PyVista 3D view with camera frusta; dense continuous field rendering; display units (µm / mm / cm / m) and a velocity field; export to NPZ / MAT / CSV / PLY / VTU+PVD, per-frame field images, MP4/GIF animation, 3D-render sequences + 360° turntable, with a WYSIWYG Preview & Colorbar tab.
Workflow & sessions Single-window three-column GUI; .aldic3d project sessions (config, view, and computed results) with source-image relocation and Windows file association; a headless TOML-driven CLI for batch/scripted runs.
i18n & robustness GUI translated into 8 languages (en, zh_CN, zh_TW, ja, ko, de, fr, es); pre-run RAM check with fail-fast projection; partial-results-kept-on-cancel; per-frame validity diagnostics surfaced in the log.

Surface strain window — colormapped strain field with colorbar, coordinate-system and strain-type selectors, and frame navigation   Export dialog — data, images, animation, and 3D-view export pages with field and format selection


Install

pyALDIC-3D targets Python ≥ 3.10. The al-dic==0.7.* 2D engine resolves automatically from PyPI.

From PyPI — available from v1.0.0

Releases from v1.0.0 onward are published on PyPI as al-dic-3d (see docs/RELEASING.md for the release process):

# 1. Create an environment (conda shown; a venv works too)
conda create -n pyaldic3d python=3.12
conda activate pyaldic3d

# 2. Install (GUI and 3D view included)
pip install al-dic-3d

From source (development)

git clone https://github.com/zachtong/pyALDIC-3D.git
cd pyALDIC-3D
pip install -e ".[dev]"

A bare pip install al-dic-3d is full-featured: it ships the desktop GUI (PySide6) and the interactive 3D view (pyvista/VTK) alongside the headless compute stack (numpy, scipy, OpenCV, al-dic). GUI and 3D imports are lazy, so al-dic-3d run / calibrate still work on headless servers where Qt or OpenGL cannot initialize. The historical [gui] / [viz3d] extras remain as no-op compatibility aliases; [dev] adds pytest, ruff, pre-commit, and matplotlib for the test suite and report tooling.

Developing against the sibling 2D repo

The 2D platform is consumed as a pinned, read-only dependency. To develop against a local checkout instead of the PyPI wheel, install the sibling repo editable first — it satisfies the same al-dic==0.7.* pin:

pip install -e ../pyALDIC     # 2D engine, editable (reports 0.7.x)
pip install -e ".[dev]"
pre-commit install            # optional hooks

pyALDIC-3D never modifies the 2D repo; docs/DEPENDS_ON_2D.md is the ledger of exactly which al_dic symbols it uses.


Quickstart

The repo ships a tiny sample dataset under examples/Images_Stereo_Sample3_images/ — three synchronized left/right stereo pairs of a speckled D-specimen (Stereo-DIC Challenge 1.0 "Sample 3") plus a DICe-format calibration. It is small (3 frames), but enough to run the full pipeline end to end.

GUI

al-dic-3d gui

Then follow examples/quickstart/README.md: load the L/ and R/ folders as the left/right cameras, import cal.xml as the calibration, draw an ROI, click Run 3D Analysis, and inspect the displacement/strain fields and the 3D view.

CLI (headless)

A ready-to-run config lives at examples/quickstart/config.toml:

al-dic-3d run examples/quickstart/config.toml -o examples/quickstart/out

This reconstructs the surface and computes surface strain for all three frames and writes, under -o:

  • quickstart.npz / quickstart.mat — the unified result archive: points3D (n_frames, n_pts, 3), per-frame displacement stacks U / V / W / mag, strain stacks exx / eyy / exy / e1 / e2 / max_shear / von_mises, plus the raw correspondence (xL / xR / quality / reproj_error).
  • quickstart_parameters_<timestamp>.json — the full run configuration (always written).

Verified run: 3 frames, ~1,300 nodes, median per-frame validity 100 %, completing in seconds on a laptop. The reconstructed surface sits ~377–390 mm from the left camera (world origin), consistent with the calibration.


CLI reference

al-dic-3d (equivalently python -m al_dic_3d) has three subcommands:

run — headless pipeline

al-dic-3d run CONFIG [-o DIR] [-q] [--formats LIST]
Flag Meaning
CONFIG path to the run configuration (TOML)
-o, --output DIR override [output].dir from the config
-q, --quiet suppress per-frame progress output
--formats LIST comma-separated: npz,mat,csv,ply,vtu (default npz,mat; a parameters JSON is always written)

Config sections: [calibration] (file, format), [sequence] (left, right, optional masks), [roi] (xmin/xmax/ymin/ymax, or an arbitrary-shape mask image), [matching] (strategy, reference mode, subset/step, search ranges, initial guess, …), [strain], [quality], [output], [advanced]. See the shipped config.toml for a minimal example.

gui — desktop application

al-dic-3d gui [SESSION]

Launches the workflow GUI (included in every install). An optional .aldic3d project path opens straight into that session.

calibrate — built-in stereo calibration

al-dic-3d calibrate --left GLOB --right GLOB --board {chessboard,charuco,circles,coded} \
                    --cols COLS --rows ROWS [--square MM | --spacing MM] [-o OUT.yaml] ...

Detects the board in synchronized L/R image sets, solves per-camera intrinsics + stereo extrinsics with QC (worst-pair rejection, epipolar validation), and writes an OpenCV YAML that run consumes as [calibration] file=... format=opencv_yaml. Options include --marker/--dict (ChArUco), --spacing/--dot/--asymmetric (circle/coded boards), --joint, --tangential, --fix-k3, --release-object, --bundle, and --verify-left/--verify-right for independent known-distance verification. Run al-dic-3d calibrate --help for the full list.


Calibration

Calibration is the accuracy-critical step in stereo-DIC. pyALDIC-3D gives you three paths, all converging on one internal stereo rig:

  1. Built-in calibration (recommended) — OpenCV-based, from board image pairs, with QC the MATLAB reference does not have (per-image error bars, threshold-based rejection + re-solve, coverage/pose diagnostics). Supports chessboard, ChArUco, circle grids, and a custom coded circular target (three concentric locator rings).
  2. Import an existing calibration from one of 6 formats — MATLAB/OpenCV (matlabcv), MatchID (matchid), MMC (mmc), DICe (dice), OpenCorr (opencorr), or OpenCV-YAML (opencv_yaml).
  3. Manual entry of intrinsics/extrinsics as a fallback.

Correspondence is computed on raw (unrectified) images; distortion is removed on point coordinates only, immediately before triangulation, so the speckle is never resampled.


Positioning

pyALDIC-3D is the Python successor to the MATLAB 3D-Stereo-ALDIC code — the same AL-DIC stereo-DIC method, re-implemented as a tested, GUI-driven, self-contained application with a built-in calibration front end and a modern 3D visualization/export layer.

Relative to other open stereo-DIC tools: MATLAB-based MultiDIC offers N-camera (>2) support that pyALDIC-3D does not yet have (N-camera is planned post-v1); pyALDIC-3D's differentiators are the Augmented-Lagrangian global–local solver, adaptive quadtree refinement, built-in QC-instrumented calibration, and a Python/Qt stack with no MATLAB license requirement. No head-to-head accuracy benchmark is claimed here — see the validation reports in the architecture docs for measured results.


Documentation


Citation

pyALDIC-3D has its own scholarly identity, independent of the 2D project. Citation metadata ships in CITATION.cff — GitHub renders a "Cite this repository" button from it. A dedicated Zenodo concept DOI is pending the first public release (Zenodo mints it automatically when the first GitHub Release is published; it will then be added here and to CITATION.cff), and a standalone SoftwareX article ("Part 2") is forthcoming.

To cite the software itself today:

@software{tong2026pyaldic3dsoftware,
  author  = {Tong, Zixiang},
  title   = {pyALDIC-3D: stereo / 3D Digital Image Correlation built on the
             pyALDIC platform},
  year    = {2026},
  url     = {https://github.com/zachtong/pyALDIC-3D},
  version = {1.0.0},
  note    = {Zenodo DOI pending first release}
}

Please also cite the underlying method, the MATLAB reference it ports, and the 2D software it is built on:

@article{tong2025stereoaldic,
  author  = {Tong, Zixiang and Yang, Jin},
  title   = {3D Stereo Adaptive Mesh Augmented Lagrangian Digital Image Correlation},
  journal = {Experimental Mechanics},
  year    = {2025},
  doi     = {10.1007/s11340-025-01225-7}
}

@article{yang2019aldic,
  author  = {Yang, Jin and Bhattacharya, Kaushik},
  title   = {Augmented Lagrangian Digital Image Correlation},
  journal = {Experimental Mechanics},
  volume  = {59},
  pages   = {187--205},
  year    = {2019},
  doi     = {10.1007/s11340-018-00457-0}
}

@article{tong2026pyaldic,
  author  = {Tong, Zixiang and Yang, Jin},
  title   = {pyALDIC: A Python Implementation of Augmented Lagrangian Digital
             Image Correlation with a GUI, Adaptive Meshing, and Mask-Aware
             Subset Splitting},
  journal = {arXiv preprint arXiv:2607.22755},
  year    = {2026},
  doi     = {10.48550/arXiv.2607.22755},
  url     = {https://arxiv.org/abs/2607.22755}
}

The last entry describes the 2D software this application builds on — its architecture, adaptive quadtree meshing and mask-aware subset splitting — and is a preprint under review, not peer-reviewed yet.

A pyALDIC-3D software DOI (Zenodo) and the SoftwareX "Part 2" citation will be added here when available.


Releases & versioning

Package versions follow the single source of truth __version__ in src/al_dic_3d/__init__.py (git tags vX.Y.Z, published to PyPI by CI). The "v1.x" numbers in the docs/architecture/00_INDEX.md changelog are internal documentation milestones, not package versions. The full release runbook (PyPI Trusted Publishing, Zenodo DOI) lives in docs/RELEASING.md.


License

BSD 3-Clause. See LICENSE. The al-dic 2D engine dependency is likewise BSD-3-Clause-licensed.

Acknowledgements

pyALDIC-3D is built on the pyALDIC 2D platform (the al-dic package, described in arXiv:2607.22755 — preprint under review) and follows the MATLAB 3D-Stereo-ALDIC reference. Developed in Dr. Jin Yang's group at The University of Texas at Austin.

Download files

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

Source Distribution

al_dic_3d-1.0.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

al_dic_3d-1.0.0-py3-none-any.whl (861.7 kB view details)

Uploaded Python 3

File details

Details for the file al_dic_3d-1.0.0.tar.gz.

File metadata

  • Download URL: al_dic_3d-1.0.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for al_dic_3d-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8f5c36855be14942bdf5cd0daadc811e9238d78d52ef2449bae68717eb94e9fe
MD5 7b61fb8f1a5fcc1946e042a18571a429
BLAKE2b-256 8ab430de41230fa84e356e7b684367f266463c2cb13e4787ef20e46445dd005f

See more details on using hashes here.

Provenance

The following attestation bundles were made for al_dic_3d-1.0.0.tar.gz:

Publisher: publish.yml on zachtong/pyALDIC-3D

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file al_dic_3d-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: al_dic_3d-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 861.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for al_dic_3d-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1de447108fc9cd1f09bf6a8f7175fd7d3802486acc4e0d968d03b0ae2a660539
MD5 fc6dd4b0d92a68275b4757f7b80cec6a
BLAKE2b-256 c1b3fc548c5622b5824a6aa016bb3955094bc4cacb88f6b54d46170da98875f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for al_dic_3d-1.0.0-py3-none-any.whl:

Publisher: publish.yml on zachtong/pyALDIC-3D

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page