Skip to main content

Zarr V2 and V3 codecs for compressing photon-limited movies.

Project description

PyPI version tests

Anscombe transform

This codec is designed for compressing image recordings with Poisson noise, which are produced by photon-limited modalities such multiphoton microscopy, radiography, and astronomy.

The codec assumes that the video is linearly encoded with a potential offset (zero_level) and that the photon_sensitivity (the average increase in intensity per photon) is either already known or can be accurately estimated from the data.

The codec re-quantizes the grayscale efficiently with a square-root-like transformation to equalize the noise variance across the grayscale levels: the Anscombe Transform. This results in a smaller number of unique grayscale levels and significant improvements in the compressibility of the data without sacrificing signal accuracy.

To use the codec, one must supply two pieces of information: zero_level (the input value corresponding to the absence of light) and photon_sensitivity (levels/photon).

The codec is used in Zarr as a filter prior to compression.

Zarr.

Installation

Install via pip:

pip install anscombe-transform

Development Setup

Getting Started

  1. Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/anscombe-transform.git
cd anscombe-transform
  1. Install Hatch

Via pip:

pip install hatch

Or directly.

  1. Create a development environment
# See available environments
hatch env show

# Enter a test environment
hatch shell test.py3.11-2.2

Install pre-commit

  1. Run tests
# Run all tests
hatch run test:pytest tests/

# Run specific test file
hatch run test:pytest tests/test_codec.py

# Run with coverage
hatch run test:pytest tests/ --cov=src/anscombe_transform

Testing

The project uses pytest for testing. Tests are found in the tests/ directory.

Building Documentation

Local Documentation Server

# Install docs dependencies
hatch run docs:mkdocs serve

# View at http://127.0.0.1:8000

Building Documentation

# Build static site
hatch run docs:mkdocs build

# Output in site/

Getting Help

License

By contributing, you agree that your contributions will be licensed under the MIT License.

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

anscombe_transform-1.0.0.tar.gz (19.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anscombe_transform-1.0.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file anscombe_transform-1.0.0.tar.gz.

File metadata

  • Download URL: anscombe_transform-1.0.0.tar.gz
  • Upload date:
  • Size: 19.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for anscombe_transform-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0624897aa2ab98b545181778de53936a6b7a60b111b3f1b945d39b27714c39b2
MD5 08197bc1ac287319c2307e6a23b25aa1
BLAKE2b-256 260c6b644a460c60cc8accf424bd8e70d7c5882cc64511c275e2aaca7b1b32c2

See more details on using hashes here.

File details

Details for the file anscombe_transform-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for anscombe_transform-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5eaf4c1bc15c2d62f2771aee2f20a0493059759f8794c6673c9c70c83207621a
MD5 d5f12145f71a0e3a38b276ddb8c258ac
BLAKE2b-256 1010e3e702702dde1f5a511a8df9b8beb8dbbd82b3ac4a9935effa4ce2182fe1

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