Skip to main content

AL-DIC: Augmented Lagrangian Digital Image Correlation with adaptive quadtree mesh

Project description

pyALDIC Banner

Full-field displacement and strain measurement with adaptive mesh refinement,
ADMM global–local optimization, and a built-in desktop GUI.

CI Python PySide6 License DOI PyPI


Why pyALDIC?

Standard subset-based DIC (IC-GN) solves each node independently — accurate for small deformations, but struggles with large displacement gradients, discontinuities, and noisy images. pyALDIC uses an Augmented Lagrangian (ADMM) framework that couples local IC-GN subproblems with a global FEM regularizer, producing smoother, more accurate fields while maintaining sub-pixel precision.


Key Features

User-Friendly GUI

A complete desktop application built with PySide6. Three-column layout with image list, ROI tools, and parameter controls on the left — interactive zoom/pan canvas in the center — run controls, field overlay, and console log on the right. Load images, draw ROIs, configure parameters, run DIC, and visualize results — all without writing a single line of code.

Desktop GUI — demo coming soon

Adaptive Spatial Refinement

Quadtree mesh refinement with 5 built-in criteria: mask boundary, ROI edge, brush region, manual selection, and posterior error. Concentrates computational effort where it matters — near boundaries, discontinuities, and high-gradient regions.

Adaptive Mesh Refinement

Dual Solver: Local DIC + AL-DIC

Run traditional local IC-GN (fast, independent nodes) or full AL-DIC with ADMM global–local coupling (regularized, smoother). Switch between modes with a single parameter — same GUI, same workflow.

Local DIC vs AL-DIC Comparison

Dual Tracking Modes

Accumulative mode — every frame compared to the first reference (best for small, monotonic deformation). Incremental mode — each frame compared to the previous (handles large cumulative deformation with automatic displacement composition and mask warping).

Accumulative vs incremental tracking — demo coming soon

Window Splitting (Masked Subsets)

Near mask boundaries, standard square subsets include invalid pixels. pyALDIC automatically detects partially masked subsets, splits them using connected-component analysis, and solves IC-GN on the valid region only — with Hessian conditioning checks to ensure reliability.

Window Splitting

Visualization & Export

Full-field displacement and strain overlay with configurable colormaps, alpha blending, and deformed configuration display. Export to MATLAB .mat, NumPy .npz, CSV, PNG field maps, animated GIF/MP4, and PDF reports.

GUI visualization and export — demo coming soon


Comparison with DIC Tools

pyALDIC Ncorr DICe VIC-2D MatchID
Algorithm ${\color{green}\textsf{ADMM global-local}}$ Subset (IC-GN) Subset / Global Subset (proprietary) Subset (proprietary)
Regularization ${\color{green}\textsf{FEM Q8 global}}$ Tikhonov (global mode)
Adaptive mesh ${\color{green}\textsf{Quadtree (5 criteria)}}$
Mask handling ${\color{green}\textsf{Auto warp + split}}$ Manual Manual ROI GUI masks GUI masks
Multi-frame Accum. + Incremental Accumulative Both Both Both
GUI Built-in (PySide6) MATLAB GUI CLI + ParaView Built-in Built-in
Platform ${\color{green}\textsf{Cross-platform}}$ MATLAB (cross-platform) Cross-platform Windows only Windows only
Export formats ${\color{green}\textsf{MAT, NPZ, CSV, PNG, GIF, PDF}}$ MAT ExodusII, VTK Proprietary CSV, images
Cost ${\color{green}\textsf{Free (BSD-3)}}$ Free (needs MATLAB license) Free (BSD) $5K–50K+ $5K–30K+
Open source ${\color{green}\textsf{Yes}}$ Yes Yes No No

Accuracy

Sub-pixel accuracy on synthetic speckle images (Lagrangian ground truth):

Test Case RMSE
Rigid translation (2.5 px) 0.010 px
Rotation (2°) 0.011 px
Affine strain (2%) 0.011 px

512² images, winsize=32, step=8. The global FEM regularizer (ADMM) enforces kinematic compatibility across neighboring nodes, improving robustness in noisy and high-gradient regions. Accuracy is regression-tested in CI.

Performance

Config Nodes Solver Time Throughput Pipeline FPS†
256², step=8 784 0.04 s ~20,000 POIs/s ~5
512², step=8 3,600 0.17 s ~22,000 POIs/s ~1
512², step=4 14,400 0.57 s ~25,000 POIs/s ~0.2
1024², step=4 61,504 2.7 s ~23,000 POIs/s ~0.06

Solver Time = IC-GN + ADMM (3 iterations), excluding precomputation. Pipeline FPS = full per-frame pipeline (FFT init + IC-GN + ADMM), excluding strain. Numba JIT, post-warmup; first run adds ~0.5 s for compilation. Using Local DIC mode (no ADMM) is ~3× faster.


Quick Start

Installation

pip install al-dic

For development (editable install with test dependencies):

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

Requires Python >= 3.10.

Launch GUI

al-dic
# or
python -m al_dic
Programmatic API
from pathlib import Path
from al_dic.core.config import dicpara_default
from al_dic.core.pipeline import run_aldic
from al_dic.io.io_utils import load_images, load_masks
from al_dic.export.export_npz import export_npz
from al_dic.export.export_mat import export_mat

# Load images and masks
images = load_images("path/to/images", pattern="*.tif")
masks = load_masks("path/to/masks", pattern="*.tif")

# Configure and run
para = dicpara_default(winsize=32, winstepsize=16)
result = run_aldic(para, images, masks, compute_strain=True)

# Access results
for i, fr in enumerate(result.result_disp):
    print(f"Frame {i}: max disp = {abs(fr.U).max():.4f} px")

# Export to .npz and .mat
out = Path("output")
fields = ["disp_u", "disp_v", "strain_exx", "strain_eyy", "strain_exy"]
export_npz(out, "result", "run01", result, fields=fields)
export_mat(out, "result", "run01", result, fields=fields)

Project Structure
src/al_dic/
├── core/           Pipeline, config, data structures, frame scheduling
├── gui/            PySide6 GUI application
│   ├── controllers/  Image, ROI, pipeline, visualization controllers
│   ├── dialogs/      Batch import, export dialogs
│   ├── panels/       Canvas area, left/right sidebars
│   └── widgets/      Image list, parameter panel, ROI toolbar, frame nav
├── io/             Image I/O and utilities
├── mesh/           Quadtree mesh generation, refinement criteria
│   └── criteria/   Mask boundary, ROI edge, brush region, manual selection
├── solver/         IC-GN, ADMM (Subpb1/Subpb2), FFT search, FEM assembly
├── strain/         Strain computation, deformation gradient, smoothing
└── utils/          Interpolation, outlier detection, mask warping

tests/              86 test files, 800+ tests
Testing
# Run all tests
pytest

# Run with parallel workers
pytest -n auto

# Run specific module
pytest tests/test_solver/test_icgn_solver.py

Citation

If you use pyALDIC in your research, please cite:

@software{tong2026pyaldic_software,
  author = {Tong, Zixiang and Yang, Jin},
  title  = {pyALDIC: Augmented Lagrangian Digital Image Correlation in Python},
  year   = {2026},
  doi    = {10.5281/zenodo.19521071},
  url    = {https://github.com/zachtong/pyALDIC}
}

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Acknowledgments

  • Based on the AL-DIC MATLAB implementation by Dr. Jin Yang
  • Developed at The University of Texas at Austin

License

BSD 3-Clause. See LICENSE for details.

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

al_dic-0.2.0.tar.gz (2.8 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-0.2.0-py3-none-any.whl (289.8 kB view details)

Uploaded Python 3

File details

Details for the file al_dic-0.2.0.tar.gz.

File metadata

  • Download URL: al_dic-0.2.0.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for al_dic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1f9078509739baac540e97017ec4c348470f668e5fb3b6c75e33c189216f7f60
MD5 0a255825a02af3035d13eb781889aa36
BLAKE2b-256 5c6f592b9631d3031259ae2b8f133637685b16b45e712a77592ca44c7c8524ac

See more details on using hashes here.

File details

Details for the file al_dic-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: al_dic-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 289.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for al_dic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a85836ad282bf842d717166014acef0e3b39db1782a41fdfa445440a30732242
MD5 5e65e698ab8ae23ebbb300b1c39318ea
BLAKE2b-256 ef04b4548eec0f6cbc14b5d57773be2e708d0163df96f9640bd49a83bdfe9121

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