Skip to main content

GPU-accelerated image processing in python using OpenCL

Project description

py-clesperanto

Conda Version PyPI License Development Status Build codecov Python Version Code style: black GitHub stars GitHub forks DOI

pyclesperanto is the python package of clEsperanto - a multi-language framework for GPU-accelerated image processing. It relies on a familly of OpenCL kernels originated from CLIJ. This package is developped in python and C++ wrapped using PyBind11, and uses the C++ CLIc library as a processing backend.

Reference and examples

An in-depth API reference and package documentation can be found here, and several demonstration notebook on how to use the library and major functionnality are available in the demos folder

Installation

  • Get a conda/python environment, e.g. via mamba-forge.
    • If you never used python/conda environments before, please follow these instructions first.
  • Create a new environment and activate it:
mamba create --name cle
mamba activate cle
mamba install -c conda-forge pyclesperanto

MacOS users may need to install the following package: mamba install -c conda-forge ocl_icd_wrapper_apple Linux users may need to install the following package: mamba install -c conda-forge ocl-icd-system

NOTE: It is also possible to install pyclesperanto with pip

Troubleshooting: Graphics cards drivers

In case you encounter one of the following error messages:

  • "ImportError: DLL load failed while importing cl: The specified procedure could not be found" see also
  • "clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR"
  • "No backend available. Please install either OpenCL or CUDA on your system."
  • "No device available. Please install either OpenCL or CUDA on your system."

please install recent drivers for your graphics card and/or OpenCL device. Select the right driver source depending on your hardware from this list:

Linux user may have to install packages such as intel-opencl-icd or rocm-opencl-runtime depending on their GPU.

Code Example

import pyclesperanto as cle
from skimage.io import imread, imsave

# initialize GPU
device = cle.select_device()
print("Used GPU: ", device)

image = imread("https://samples.fiji.sc/blobs.png")

# push image to device memory
input_image = cle.push(image)

# process the image
inverted = cle.subtract_image_from_scalar(input_image, scalar=255)
blurred = cle.gaussian_blur(inverted, sigma_x=1, sigma_y=1)
binary = cle.threshold_otsu(blurred)
labeled = cle.connected_components_labeling(binary)

# The maxmium intensity in a label image corresponds to the number of objects
num_labels = cle.maximum_of_all_pixels(labeled)

# print out result
print("Num objects in the image: " + str(num_labels))

# read image from device memory
output_image = cle.pull(labeled)
imsave("result.tif", output_image)

Examples & Demos gallery

Segment + analyze blobs

Cell segmentation + Voronoi labeling

3D image filtering

Find local maxima

3D Tribolium nuclei segmentation

Explore application programming interface (API)

More usage and example can be found as notebooks in the demos folder

Contributing and Feedback

clEsperanto is developed in the open because we believe in the [open source community]. Feel free to drop feedback as github issue or via image.sc forum. Contribution are also very welcome. Please read our community guidelines before you start and get in touch with us so that we can help you get started. If you liked our work, star the repository, share it with your friends, and use it to make cool stuff!

Acknowledgements

We acknowledge support by the Deutsche Forschungsgemeinschaft under Germany’s Excellence Strategy (EXC2068) Cluster of Excellence Physics of Life of TU Dresden. This project has been made possible in part by grant number 2021-237734 (GPU-accelerating Fiji and friends using distributed CLIJ, NEUBIAS-style, EOSS4) from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation.

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

pyclesperanto-0.14.1.tar.gz (4.7 MB view details)

Uploaded Source

Built Distributions

pyclesperanto-0.14.1-cp312-cp312-win_amd64.whl (465.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (878.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.1-cp312-cp312-macosx_11_0_arm64.whl (504.1 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.14.1-cp312-cp312-macosx_10_14_x86_64.whl (544.1 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.14.1-cp311-cp311-win_amd64.whl (470.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (885.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.1-cp311-cp311-macosx_11_0_arm64.whl (502.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.14.1-cp311-cp311-macosx_10_14_x86_64.whl (538.3 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.14.1-cp310-cp310-win_amd64.whl (469.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (881.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.1-cp310-cp310-macosx_11_0_arm64.whl (500.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.14.1-cp310-cp310-macosx_10_14_x86_64.whl (535.9 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.14.1-cp39-cp39-win_amd64.whl (448.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (882.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.1-cp39-cp39-macosx_11_0_arm64.whl (500.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.14.1-cp39-cp39-macosx_10_14_x86_64.whl (536.1 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.14.1-cp38-cp38-win_amd64.whl (469.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (880.2 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.1-cp38-cp38-macosx_11_0_arm64.whl (500.5 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.14.1-cp38-cp38-macosx_10_14_x86_64.whl (535.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

Details for the file pyclesperanto-0.14.1.tar.gz.

File metadata

  • Download URL: pyclesperanto-0.14.1.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyclesperanto-0.14.1.tar.gz
Algorithm Hash digest
SHA256 d9eae9e63d0689f8f72c4824489d75e203cd87856338ad17b9850c7e44daed59
MD5 b27c4c20de1f0d7fca2a75e4ca90dc64
BLAKE2b-256 be86be91e80c73ce6de4de57da471ee1284feb36c249282ac7949b50956a53ac

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 26a1e239ae02cbb092f1c7edf9bd50bce98108027efbfa7a4a8cb11ab4bc3eda
MD5 b3632804d81a6831cf359328f57be25e
BLAKE2b-256 6f492085d571aa7c44434b7aa1157061e0d4558761936677a3c95fa618f59d68

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8b3e976ecdc50e5731affd686e6f2fffbd818079c5b9b52cadfebc6c023743e
MD5 6568d070dae296c42cdcbaa0c033b4d0
BLAKE2b-256 1096589b8dfa95534e5b03f83ae7bb86d94ab43ecd92fe5f3bcd5470fe1e9ea4

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 329b8c3f40cef548db5db473137103b6593df90ba56bbdab958fd58cab773dac
MD5 f9b2ead83b4e1bba93847756fd59c013
BLAKE2b-256 6afdd55d596206cffac07d2bee1a3bfb5fb2f39b07afea03cf847de496101203

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp312-cp312-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 bee8a6751cdfd07138ccb54a4fa2a31872c5e802fd28c236f544b76fdcd8a2f7
MD5 045578ccb278d6b523e7523d1c9f676d
BLAKE2b-256 d61aa0697df54a09cfbaed17fbc18a3e38c6f74305dfdf52d1958aaa917932d1

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 19d3333b6f60463894f089ea921f7276a7196b6903eac3b688fbb34975407207
MD5 8f6b7ba84272fa3ad90cea1ab2cea0a6
BLAKE2b-256 9898c2eca4f6e834e7d0005e0d84fb84e9804e08dc29167667ed5e1ead7f1bca

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e7a667154f151992e429814eb27c38345dc8b294813b87911600e9a089d19c2
MD5 b1a08876b8e07a0a7e18ae19d0ff61d0
BLAKE2b-256 eb7d759be8bc557c804d1e4aed42d985fd5d34882b543417fe491df527e95da9

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 40e66214d8f21bfa1b1bfa89077aba492df10a370dbc1026699169a4b885009c
MD5 1539cbe64dbe792a1d38d1c4374e0368
BLAKE2b-256 332914bd9495ee0193c0a81d9f5a6ccde6c34912a07e2915decbfe94eb311925

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp311-cp311-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 76831d9a4eded7082803bb75b9a0cb7fc9a7b5a6b4693ccbc479103216cd9b9c
MD5 ce8ce52f65cee5c10901fa276db35ba2
BLAKE2b-256 477a53e9d6df7ca1b467ea7063ad7f1236bfdbb7bf774f64e80aa21b90d86d7c

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6e75c9aee832b61e03356b501be851ad511e6f5d5a17971ca6090ed591083c8b
MD5 55f93de1eafac9aeda859fdb7b8427de
BLAKE2b-256 deaa46c8aced95a826c7a96001e7f36b9ade515aacd6c6bea3bfbf6e5993a540

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 45e0d2512d89e36f7d98ce85a88308d02825fb8844f9cd8ec7694821a8dc3724
MD5 9d42c3533dbf26fddb1042a40c9690a3
BLAKE2b-256 7b0f92e4806e11266080a8649de46bb44ea1ea3bd49e5e1ca13ae2938ba343e0

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b02392241cc12db46df0bc244c3321c3ff034fb2578e293e6d057d3d578e8596
MD5 655060d44b40c713433e608b77b11cc1
BLAKE2b-256 e8b245a6475c1e7dd09c7e2852a0db25c33ae2ff68a5e541e7e130406b8d64b0

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp310-cp310-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2021ab336ed425bc3fd71278e078dfaf26798550ceceb16c93da2ac6ee4b0550
MD5 e17d51efa5130c81bf1086a3b0d7a62a
BLAKE2b-256 301d569d2b3b60761d7af58be56f0e8b19ff4f161b941b082f1ba0bd77374dc3

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e0def314674a6ff5e2fcfa027d1b74f8297849723cb498f09bf1ce0a09b6df3a
MD5 8297a852b53ca0d28c6268bb569d3831
BLAKE2b-256 ea1007b1bffff14c45f69aa6291396321e7933c32b236f71dfec990d25939ce2

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c69c2f65e3b3f529c9c4f6796ffa6a37f3436989b6f13da7a28140912dbaac9a
MD5 bb8da3e584b2560f26069ee753d66607
BLAKE2b-256 bb15a1d67efee96d008b3519562f2dd253d115cb7639e3e8cfe15ddf4ff37a97

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18d73ef570b514ef1a0f0c913c6f9e93477fcfa093936bca04d1d3492b89ee85
MD5 103cbcc2cd2adb5f706f3e184f1d0f1d
BLAKE2b-256 e4d9a0c23b332f1581d14250e9fa607a9b4f1b77ace18ea6f0dfa5b3dac24b16

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4d959268f7e3b729179a569ed8ce0faa7058ee635890707da0501c0445582a62
MD5 5a085adf708f2d42f7ffaed48e4ab0e9
BLAKE2b-256 545b39bb98fc0498100cbfd85cfe97890403d02620ec202f774659066d509a41

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0f48c6d2bc0f3b137458fb76cc915b44c5dc1a71dfd344ed2bcb81b1f67fc547
MD5 4bd1da35b4c530103c34725af7de6e43
BLAKE2b-256 4da1df988f6c80d15de497be24f632bf3b596f0738a27eb230e1d631f6bc6268

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3804906a95844d21fbf786a02cad908b1acb9dc82e3fcfa3d5153039ea25b32
MD5 7cf3ee45b780bfc5ce69d6c765332e6e
BLAKE2b-256 e24f5fcd80498dfada2575b41207c54db0aa408959fa7fe843f47c5adda4045a

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3381000913454fcdd06a8b3a854cc768a6999dd3d7ea19ad25c66765516d7c8f
MD5 3214285b0b5672a0fa56e43085dffcac
BLAKE2b-256 1c51e7746188dd62628b9c565542fbdc1e787268d48e54184ec232e7e8525f3c

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.14.1-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.14.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 39274fb512fb292e6709167ec8b3a02c82e1ff21793247b0a34b0efe083f73fa
MD5 a81edf89ce23634df70c4e8793f1d867
BLAKE2b-256 6f49de9aeeae0feb53ec2e42abb305e7fe1afbae5085138b73ea8d235c8e407f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page