Content-adaptive image processing using the Adaptive Particle Representation
Project description
pyapr
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 |
---|---|
Uniform sampling | Adaptive sampling |
image source, illustration source
For more detailed information about the APR and its use, see:
- Adaptive particle representation of fluorescence microscopy images (nature communications)
- Parallel Discrete Convolutions on Adaptive Particle Representations of Images (IEEE Transactions on Image Processing)
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)
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)
The View Level
toggle allows you to see the adaptation (brighter = higher resolution).
Or view the result in 3D using APR-native maximum intensity projection raycast (cpu).
# launch raycast viewer
pyapr.viewer.raycast_viewer(apr, parts)
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pyapr-1.0.7-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5fb894054801df0e6ccb1e75513fc519763ffd9688281842f023eee4eb95ad4 |
|
MD5 | a6d008e3c7473c530e016250e0bf8a16 |
|
BLAKE2b-256 | 417db0efa41b20b4dd456f02808cc05750020768a19d158d279093407c8725cb |
File details
Details for the file pyapr-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036e7542eb2fc271f1254d02e276d8909cbfcfdf0d20fe99c9be6ecd5a317511 |
|
MD5 | ccce26c8f11949a61fc050a689ca3e94 |
|
BLAKE2b-256 | 7117407ae4b745f418917aa609f8d04e30a92a63f1bc5d8e1dc4cbdc0390a6ef |
File details
Details for the file pyapr-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab7af9656d3e6bc987228f59489bf58fa5a5d47d82d6210562cf54e7467420cc |
|
MD5 | c2e81402b4d125ee98e60d64d3e193c5 |
|
BLAKE2b-256 | caae88a8149ab655f7d7a4f21e5fd63b7d3cb97ae50731a74f31177d009c75f3 |
File details
Details for the file pyapr-1.0.7-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c70bd14f31e1cac70b903639de9754b5c5ef7e6ba7dbb7a08bb3f12d87e29ffc |
|
MD5 | ce2bd08040b81d6c3789d06b99e25fe1 |
|
BLAKE2b-256 | fe6dcfe88e7f778f7351f99d8484e6851d52a58630324f2991f87bebf2e67acd |
File details
Details for the file pyapr-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd5e1178d13d0099aae9de433278c61d0cb35beb05e54e430593a5517304bdf9 |
|
MD5 | bded7657e798b21498df96f8adbc47b5 |
|
BLAKE2b-256 | f7c28728ca5a9650b53355686f4f5fcd0bce0323615136f6fbe7735a868798dd |
File details
Details for the file pyapr-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f29ddc24ec3ad8eb16574e3b72fe03f440fa6cf222e717971444bdb6428f23ee |
|
MD5 | c4b0a70677ac25a0d99bbc88a5ee3155 |
|
BLAKE2b-256 | 6de188d60d9c6d36d76c5d79d37fd7fc974b45e64ad675527e22295f391ccc52 |
File details
Details for the file pyapr-1.0.7-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b978cff3dfdf5429dde6614801a7efa8f5e030c42c93c4784c80fb802b75d5 |
|
MD5 | 1d447a2bfc4a2e3a66776ae67177476f |
|
BLAKE2b-256 | 23f71a22b3973e9ac9bd658e934770c16026a0ccda2342d9a923d2d9c895cda7 |
File details
Details for the file pyapr-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 019f312fcff2933b4d1ce1770e08b996704041111ab04efb9d3e330204788226 |
|
MD5 | 735cd3675e415906b61500ab2c73933a |
|
BLAKE2b-256 | d243453d8663ef2aba8e43030b2c4f4e6cfe7196f1e8bf0e957126e14d6027cc |
File details
Details for the file pyapr-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 506c315d297c79efdb682a260718ac70b1cd662fc41961210d5b8619fb8e0358 |
|
MD5 | d0e0590af618c633f59a9d613339edec |
|
BLAKE2b-256 | 45bcb87f6bfa4f383edd98d7af9c1ec8fb3d0f25c2902704beaa73af335a8a9a |
File details
Details for the file pyapr-1.0.7-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ad97da28711ca97101e8a1f252b293ed10f35603aa5abc3663dd822712c1ac5 |
|
MD5 | 2da53a642dadd8fe9a405d80b3a61113 |
|
BLAKE2b-256 | 56c7a90df2b0e0e62694d3b0fdba9a7623f74f5890177a16e11e3a39aa6f9458 |
File details
Details for the file pyapr-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07b7b88cdd545f5d1780516e113a6b625913938fe4f6a2924ca7b9085f9849ff |
|
MD5 | 53afb28fe8932fdf18e366e9e58c948b |
|
BLAKE2b-256 | e036b41d13093d278d4801b3c83510798293c1caa66d57d8c010bd90fec6e26a |
File details
Details for the file pyapr-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyapr-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f58a73944e55744a9429b45cfd8e20bac98e04dbafff78a304594aed33f70ca8 |
|
MD5 | 08d418bdd765e2849a4c825736858ebb |
|
BLAKE2b-256 | 1fef9e18fdec3609653d0797b29b564c0b51efd473d7746b014cedcbc6a921ec |