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.1

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.1
File Size Uploaded Provenance Actions
dgimage-0.2.1.tar.gz 28.4 kB With provenance Details for dgimage-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 51.5 kB

Release files / dgimage-0.2.1.tar.gz

Download URL dgimage-0.2.1.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1c9f154a2b7a479e2e582015d136be29fa02bb3fa52463600850ed25932adc11
BLAKE2b-256 checksum
How to use checksums
14f7ee782fb1f21c31bd59f743d8c97bff70e2c9e4865c0f9e697ded6777ba7c
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.1-py3-none-any.whl

Download URL dgimage-0.2.1-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10e1537e6c78f21d95cc46e182e07eaf9a393bb8fdf4bef78c94f1a71fca4177
BLAKE2b-256 checksum
How to use checksums
404b8303234e7a563df6ad909ee87c5f2489f4bdcacc93040c7b1df2c1374717
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.1

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.1.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