pylorenzmie
Python routines for tracking and characterizing colloidal particles with in-line holographic video microscopy (HVM)
What pylorenzmie does
pylorenzmie provides a set of python classes for interacting with and
analyzing holographic microscopy data. The hologram of a colloidal
particle encodes comprehensive information about the particle's size,
composition, and location in three dimensions. This package extracts
that information by fitting a recorded hologram to a generative model
based on the Lorenz-Mie theory of light scattering.
Documentation
The documentation is on Read the Docs:
- the quickstart shows how to compute and fit holograms,
- the API reference describes the classes, and
- the changelog lists what changed in each release and how to update.
The tutorial notebooks are rendered on GitHub: fitting a hologram, analyzing a frame, fitting a single frame, holograms of several spheres, video analysis and the building blocks of the model. The documentation of the development version is here.
To report a problem or to contribute, see CONTRIBUTING.md.
Installation
pylorenzmie requires Python 3.11 or later:
pip install pylorenzmie
Optional extras add faster calculators:
pip install pylorenzmie[numba] (recommended: a fast CPU calculator),
pylorenzmie[torch] (GPUs, including Apple silicon), pylorenzmie[gpu]
(NVIDIA GPUs with CuPy), pylorenzmie[jax] and pylorenzmie[gui] (PyQt6, which
the lmtool application needs).
Extras can be combined, as in pip install pylorenzmie[numba,torch].
Example
Compute the hologram of a polystyrene sphere that is 1 micrometer in radius and 200 pixels from the focal plane:
from pylorenzmie.theory import LorenzMie, Sphere
model = LorenzMie()
model.coordinates = model.meshgrid((201, 201))
model.particle = Sphere(a_p=1., n_p=1.59, x_p=100., y_p=100., z_p=200.)
hologram = model.hologram().reshape(201, 201)
The quickstart goes on to fit recorded holograms.
Interactive particle tracking and characterization
pylorenzmie includes a GUI application called lmtool
for interacting with experimentally recorded holograms.
Authors
David G. Grier (New York University), Lauren Altman, Fook Chiong Cheong, Mark D. Hannel, Sanghyuk Lee, Michael O'Brien, Sarah Odeh, Kaitlynn Snyder, Jackie Sustiel
Licensing.
References:
Lorenz-Mie analysis of colloidal particles
- S.-H. Lee, Y. Roichman, G.-R. Yi, S.-H. Kim, S.-M. Yang, A. van Blaaderen, P. van Oostrum and D. G. Grier, "Characterizing and tracking single colloidal particles with video holographic microscopy," Optics Express 15, 18275-18282 (2007).
- C. Martin, L. E. Altman, S. Rawat, A. Wang, D. G. Grier and V. N. Manoharan, "In-line holographic microscopy with model-based analysis," Nature Reviews Methods Primers 2, 83 (2022).
Lorenz-Mie theory of light scattering
- C. F. Bohren and D. R. Huffman, Absorption and Scattering of Light by Small Particles (Wiley 1983).
- M. I. Mishchenko, L. D. Travis and A. A. Lacis, Scattering Absorption and Emission of Light by Small Particles (Cambridge University Press, 2002).
- G. Gouesbet and G. Gréhan, Generalized Lorenz-Mie Theories (Springer, 2011).
Computational methods
- W. Yang, "Improved recursive algorithm for light scattering by a multilayered sphere," Applied Optics 42, 1710--1720 (2003).
- O. Pena and U. Pal, "Scattering of electromagnetic radiation by a multilayered sphere," Computer Physics Communications 180, 2348-2354 (2009).
- W. J. Wiscombe, "Improved Mie scattering algorithms," Applied Optics 19, 1505-1509 (1980).
- A. A. R. Neves and D. Pisignano, "Effect of finite terms on the truncation error of Mie series," Optics Letters 37, 2481-2420 (2012).
Acknowledgements
Work on this project at New York University is supported by the National Science Foundation of the United States under award number DMR-2428983.
Metadata
Release files for pylorenzmie 3.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylorenzmie-3.1.1.tar.gz | 3.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylorenzmie-3.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 MB
Release files / pylorenzmie-3.1.1.tar.gz
| Download URL | pylorenzmie-3.1.1.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4251f548fc405a611ac4e98af916673b08faed18660035a32c59aef285e9b227
|
|
BLAKE2b-256 checksum How to use checksums |
4399a38dc7602aa9d8b0478b248452f906a8ccaa949341f8b203c3eaba6eeea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency logRelease files / pylorenzmie-3.1.1-py3-none-any.whl
| Download URL | pylorenzmie-3.1.1-py3-none-any.whl |
|---|---|
| Size | 3.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e61997d0f367d75db29112f64d1efa6f9c704249efb62c60d2d99d37caef0997
|
|
BLAKE2b-256 checksum How to use checksums |
a98fd77ae3dce56a23f653a7a80560baad81bda36e198a6a6e1c3cdcd182dfdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency log