Skip to main content

pyapr

build and deploy codecov License Python Version PyPI Downloads DOI

Documentation can be found here.

Content-adaptive storage and processing of large volumetric microscopy data using the Adaptive Particle Representation (APR).

The APR is an adaptive image representation designed primarily for large 3D fluorescence microscopy datasets. By replacing pixels with particles positioned according to the image content, it enables orders-of-magnitude compression of sparse image data while maintaining image quality. However, unlike most compression formats, the APR can be used directly in a wide range of processing tasks - even on the GPU!

Pixels APR
pixels.png apr.png
Uniform sampling Adaptive sampling

image source, illustration source

For more detailed information about the APR and its use, see:

pyapr is built on top of the C++ library LibAPR using pybind11.

Quick start guide

Convert images to APR using minimal amounts of code (see get_apr_demo and get_apr_interactive_demo for additional options).

import pyapr
from skimage import io

# read image into numpy array
img = io.imread('my_image.tif')

# convert to APR using default settings
apr, parts = pyapr.converter.get_apr(img)

# write APR to file
pyapr.io.write('my_image.apr', apr, parts)

apr_file.png

To return to the pixel representation:

# reconstruct pixel image
img = pyapr.reconstruction.reconstruct_constant(apr, parts)

Inspect APRs using our makeshift image viewers (see napari-apr-viewer for less experimental visualization options).

# read APR from file
apr, parts = pyapr.io.read('my_image.apr')

# launch viewer
pyapr.viewer.parts_viewer(apr, parts)

view_apr.png

The View Level toggle allows you to see the adaptation (brighter = higher resolution).

view_level.png

Or view the result in 3D using APR-native maximum intensity projection raycast (cpu).

# launch raycast viewer
pyapr.viewer.raycast_viewer(apr, parts)

raycast.png

See the demo scripts for more examples.

Installation

For Windows 10, OSX, and Linux direct installation with OpenMP support should work via pip:

pip install pyapr

Note: Due to the use of OpenMP, it is encouraged to install as part of a virtualenv.

See INSTALL for manual build instructions.

License

pyapr is distributed under the terms of the Apache Software License 2.0.

Issues

If you encounter any problems, please file an issue with a short description.

Contact us

If you have a project or algorithm in which you would like to try using the APR, don't hesitate to get in touch with us. We would be happy to assist you!

Metadata

Release files for pyapr 1.0.7

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

Built distributions (wheels)

Table of built distributions (wheels) for pyapr 1.0.7
File
pyapr-1.0.7-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pyapr-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pyapr-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
pyapr-1.0.7-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pyapr-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pyapr-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
pyapr-1.0.7-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pyapr-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pyapr-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
pyapr-1.0.7-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
pyapr-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
pyapr-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 45.8 MB

Release files / pyapr-1.0.7-cp311-cp311-win_amd64.whl

Download URL pyapr-1.0.7-cp311-cp311-win_amd64.whl
Size 3.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
a5fb894054801df0e6ccb1e75513fc519763ffd9688281842f023eee4eb95ad4
BLAKE2b-256 checksum
How to use checksums
417db0efa41b20b4dd456f02808cc05750020768a19d158d279093407c8725cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyapr-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.2 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
036e7542eb2fc271f1254d02e276d8909cbfcfdf0d20fe99c9be6ecd5a317511
BLAKE2b-256 checksum
How to use checksums
7117407ae4b745f418917aa609f8d04e30a92a63f1bc5d8e1dc4cbdc0390a6ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl

Download URL pyapr-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl
Size 4.4 MB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
ab7af9656d3e6bc987228f59489bf58fa5a5d47d82d6210562cf54e7467420cc
BLAKE2b-256 checksum
How to use checksums
caae88a8149ab655f7d7a4f21e5fd63b7d3cb97ae50731a74f31177d009c75f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp310-cp310-win_amd64.whl

Download URL pyapr-1.0.7-cp310-cp310-win_amd64.whl
Size 3.8 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
c70bd14f31e1cac70b903639de9754b5c5ef7e6ba7dbb7a08bb3f12d87e29ffc
BLAKE2b-256 checksum
How to use checksums
fe6dcfe88e7f778f7351f99d8484e6851d52a58630324f2991f87bebf2e67acd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyapr-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
dd5e1178d13d0099aae9de433278c61d0cb35beb05e54e430593a5517304bdf9
BLAKE2b-256 checksum
How to use checksums
f7c28728ca5a9650b53355686f4f5fcd0bce0323615136f6fbe7735a868798dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl

Download URL pyapr-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl
Size 4.4 MB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f29ddc24ec3ad8eb16574e3b72fe03f440fa6cf222e717971444bdb6428f23ee
BLAKE2b-256 checksum
How to use checksums
6de188d60d9c6d36d76c5d79d37fd7fc974b45e64ad675527e22295f391ccc52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp39-cp39-win_amd64.whl

Download URL pyapr-1.0.7-cp39-cp39-win_amd64.whl
Size 3.8 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
96b978cff3dfdf5429dde6614801a7efa8f5e030c42c93c4784c80fb802b75d5
BLAKE2b-256 checksum
How to use checksums
23f71a22b3973e9ac9bd658e934770c16026a0ccda2342d9a923d2d9c895cda7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyapr-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.2 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
019f312fcff2933b4d1ce1770e08b996704041111ab04efb9d3e330204788226
BLAKE2b-256 checksum
How to use checksums
d243453d8663ef2aba8e43030b2c4f4e6cfe7196f1e8bf0e957126e14d6027cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl

Download URL pyapr-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl
Size 4.4 MB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
506c315d297c79efdb682a260718ac70b1cd662fc41961210d5b8619fb8e0358
BLAKE2b-256 checksum
How to use checksums
45bcb87f6bfa4f383edd98d7af9c1ec8fb3d0f25c2902704beaa73af335a8a9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp38-cp38-win_amd64.whl

Download URL pyapr-1.0.7-cp38-cp38-win_amd64.whl
Size 3.8 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
1ad97da28711ca97101e8a1f252b293ed10f35603aa5abc3663dd822712c1ac5
BLAKE2b-256 checksum
How to use checksums
56c7a90df2b0e0e62694d3b0fdba9a7623f74f5890177a16e11e3a39aa6f9458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyapr-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.2 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
07b7b88cdd545f5d1780516e113a6b625913938fe4f6a2924ca7b9085f9849ff
BLAKE2b-256 checksum
How to use checksums
e036b41d13093d278d4801b3c83510798293c1caa66d57d8c010bd90fec6e26a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / pyapr-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl

Download URL pyapr-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl
Size 4.4 MB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f58a73944e55744a9429b45cfd8e20bac98e04dbafff78a304594aed33f70ca8
BLAKE2b-256 checksum
How to use checksums
1fef9e18fdec3609653d0797b29b564c0b51efd473d7746b014cedcbc6a921ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18
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