Skip to main content

dgimage: image transformations for holography and microscopy

PyPI version Python License: GPL v3 Tests Documentation DOI

dgimage is a small library of the image transformations and radial statistics that the Grier group uses across projects. It needs only numpy and scipy: no camera, no GUI and no analysis framework, so that QVideo, pylorenzmie and other programs can share one implementation of each algorithm.

A hologram of two spheres and its orientation alignment transform

Install

pip install dgimage
pip install dgimage[fast]    # with OpenCV: the circle transform is twice as fast

Use

import numpy as np
from dgimage import circletransform

heat = circletransform(image)      # peaks are the centers of rings
y, x = np.unravel_index(heat.argmax(), heat.shape)

The transform of Krishnatreya and Grier locates circularly symmetric features, such as the rings of the hologram of a sphere, without knowing their radius. A program that transforms many frames of one shape builds a CircleTransform, which keeps its kernel. The radial profile of a ring about its center is

from dgimage import azimuthal

profile = azimuthal.med(image, center=(x, y))      # also avg, std, mad
A hologram of one sphere and its azimuthal median

Contents

Transformation What it does
circletransform orientation alignment transform: a map of the centers of rings
azimuthal average, standard deviation, median and median absolute deviation of an image as a function of the distance from a center

More will join them as projects of the group need them, such as the Crocker-Grier local-maximum finder.

Documentation

https://dgimage.readthedocs.io

Citing

See CITATION.cff. The orientation alignment transform is described in B. J. Krishnatreya and D. G. Grier, "Fast feature identification for holographic tracking: the orientation alignment transform," Optics Express 22, 12773-12778 (2014).

License

GPL-3.0-or-later, like QVideo and pylorenzmie. See LICENSE.

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 dgimage 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dgimage 0.2.0
File Size Uploaded Provenance Actions
dgimage-0.2.0.tar.gz 28.3 kB With provenance Details for dgimage-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dgimage 0.2.0
File Interpreter ABI Platform Actions
dgimage-0.2.0-py3-none-any.whl Python 3 none any Details for dgimage-0.2.0-py3-none-any.whl

Total release size: 51.5 kB

Release files / dgimage-0.2.0.tar.gz

Download URL dgimage-0.2.0.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c0e591651030cd22f3486aaa51077fec3d88fbb2a455845f683a8c0d39d5d88c
BLAKE2b-256 checksum
How to use checksums
1ace7c155559a615f6f1f0b7f1da60406dd0d1e656b5d991e6625e02552a8b17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Release files / dgimage-0.2.0-py3-none-any.whl

Download URL dgimage-0.2.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40a4eea7cd5d760f8f7211c626c2788f17b747e417241ad28d0f99e0f654eddf
BLAKE2b-256 checksum
How to use checksums
e1bfbb7a1b4425f80187229ca78f78c73eabd7356ba47ef6f8496760683047df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 12, 2026.

Transparency log

Security for dgimage 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dgimage-0.2.0.tar.gz

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 Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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