Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyapr

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyapr

Content-adaptive image processing using the Adaptive Particle Representation

  • 1.0.7
  • PyPI
  • Socket score

Maintainers
1

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!

PixelsAPR
pixels.pngapr.png
Uniform samplingAdaptive 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!

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc