Metadata-Version: 2.4
Name: dgimage
Version: 0.1.0
Summary: Lightweight image transformations for holography and microscopy
Author-email: "David G. Grier" <david.grier@nyu.edu>
License: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/davidgrier/dgimage
Project-URL: Documentation, https://dgimage.readthedocs.io
Project-URL: Repository, https://github.com/davidgrier/dgimage
Project-URL: Bug Tracker, https://github.com/davidgrier/dgimage/issues
Keywords: image processing,feature detection,holography,microscopy,orientation alignment transform,scientific
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: dev
Requires-Dist: dgimage[test]; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Provides-Extra: docs
Requires-Dist: pydata-sphinx-theme; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
Dynamic: license-file

# dgimage: image transformations for holography and microscopy

[![PyPI version](https://img.shields.io/pypi/v/dgimage)](https://pypi.org/project/dgimage/)
[![Python](https://img.shields.io/pypi/pyversions/dgimage)](https://pypi.org/project/dgimage/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
[![Tests](https://github.com/davidgrier/dgimage/actions/workflows/test.yml/badge.svg)](https://github.com/davidgrier/dgimage/actions/workflows/test.yml)
[![Documentation](https://app.readthedocs.org/projects/dgimage/badge/?version=latest)](https://dgimage.readthedocs.io/en/latest/)

**dgimage** is a small library of the image transformations and radial statistics that the
[Grier group](https://github.com/davidgrier) uses across projects.  It needs
only `numpy` and `scipy`: no camera, no GUI and no analysis framework, so that
[QVideo](https://github.com/davidgrier/QVideo),
[pylorenzmie](https://github.com/davidgrier/pylorenzmie) and other programs
can share one implementation of each algorithm.

## Install

```bash
pip install dgimage
```

## Use

```python
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

```python
from dgimage import azimuthal

profile = azimuthal.avg(image, center=(x, y))      # also std, med, mad
```

## 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](LICENSE).
