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.15.1.tar.gz (4.7 MB view details)

Uploaded Source

Built Distributions

pyclesperanto-0.15.1-cp312-cp312-win_amd64.whl (454.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.15.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (858.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.15.1-cp312-cp312-macosx_11_0_arm64.whl (493.5 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.15.1-cp312-cp312-macosx_10_14_x86_64.whl (529.8 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.15.1-cp311-cp311-win_amd64.whl (459.7 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (863.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.15.1-cp311-cp311-macosx_11_0_arm64.whl (491.0 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.15.1-cp311-cp311-macosx_10_14_x86_64.whl (526.2 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.15.1-cp310-cp310-win_amd64.whl (458.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (860.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.15.1-cp310-cp310-macosx_11_0_arm64.whl (489.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.15.1-cp310-cp310-macosx_10_14_x86_64.whl (525.1 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.15.1-cp39-cp39-win_amd64.whl (439.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (860.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.15.1-cp39-cp39-macosx_11_0_arm64.whl (489.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.15.1-cp39-cp39-macosx_10_14_x86_64.whl (525.1 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.15.1-cp38-cp38-win_amd64.whl (458.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (859.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.15.1-cp38-cp38-macosx_11_0_arm64.whl (489.3 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.15.1-cp38-cp38-macosx_10_14_x86_64.whl (524.9 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.15.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.15.1.tar.gz
Algorithm Hash digest
SHA256 0a513cc14a0bcb5f950c8d079d6a2a0a60180f88844b4f94d071834007e92fd4
MD5 7f326d6bf12d63da55f4fe1fa8ed54ea
BLAKE2b-256 915170db2520b528d37e39ab2f57faefd72b6dc9798747763e02c5f52a947025

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f9fd64474c54d660bfb625e34de2f99ec294357cdd671f4edf51b852ed7e9b87
MD5 01e3cfe3fa3a4e1143e858451dbe4f28
BLAKE2b-256 50a9ab54de1b0f545c0b13439af9c5ce7a68eb87be6c74129d5e239b021bf709

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 77bc4f4efb222f79ff652fb723044bb9ff8d7b74b28e28bef4e2b382db08facf
MD5 28a2ec63b39f6800864018882deb48f0
BLAKE2b-256 622f09f4dcb14e4cc10a75382a7baa252b27e63fee8557169cca0df0d0139cd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e7c44b5c8ba871e9ec17f14382488ce18505bb8940cd0c60edc55ec09038042
MD5 69566ddc1f8536cafd6cd890233e439b
BLAKE2b-256 09bdc3c06035dfeb9d0c50e63bb53711aa09aff63e0b9a55c7148336c0f13772

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2dbbae94daf6feda3b87dcccbd48fd4c235777209c3e7775647e62a2be876732
MD5 fe865933946cf47f5e4021b91fd1f33a
BLAKE2b-256 927568347c5ae06b73a576591b466815f3edb5a447253fb132b9744e9612b528

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22096eb725e3fa2ff2cd2005d0fd0706c678bb7c8d0773c1613e92ba25782057
MD5 af945a8d3da3545ba5cf51d349770434
BLAKE2b-256 8588be04714e622ffbdac99542d11e12bad1a9ce07db1e77089ab9b59a144856

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ace4a54b53a96d1fd1a0274de2c84b66963080c8c599b4cd979dc5b668c8c424
MD5 57d26ba473de82cce1be46708f6fab8b
BLAKE2b-256 e2ef9d285c6dd72d4982e2e2868f9142438d3968381804fde40488e43049fae4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b7afc5f4be882898b34fb1a1214f6d3c6b535ba6e9a79b1ecae14d8c912d6dd7
MD5 1f222c6a41090bdaf93bdb10e1155b63
BLAKE2b-256 4298e1e95dfeb947d3a3d5e740070f190fc21df3847bdf1950b8150493bb1a7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c68ee2c82b28da7c404040faaf65772fbc25e53cf3dc8945868fc62abb081d6a
MD5 973a22a03d5daee61507bdead8607707
BLAKE2b-256 612bb961e0e422486ff5741371afe37da24908f7844b0cf557725a58bedcb623

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 0d14f47140e3b9e4e8759d8ad2e29e90c724634f5d284fa095db80792d546840
MD5 4b85468467f886930d488bd6d5066088
BLAKE2b-256 b220daf0ecf45fb681a28ca9cc18ba9ddd1b2526c02c1dc83e4934719c321bbd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f597a248ebb34254cb6bf1c4d50768484735ced1ddff5593953ca51d95831dcc
MD5 6f5cef3399b3b659182eba9e87391fcb
BLAKE2b-256 3b64f6edeb2110f493bf40e66e0f574f4dcc8a5cbc191e3b8b8b0cfb2d670a3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 853055cca0c14f9b8cbd69e48ee40781280790865e7d3a6aac5948265bdb55d1
MD5 6d744234ad29200688f2f762ce6c6aef
BLAKE2b-256 6019f5554cfa62beb8ce698db04f4935e734d7260bd2b7e3fb02b24f4dec3787

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8b99f3b7f57481b7e3828f36ccebb1c60ca84e595637c119f26cfdf09e9f42d9
MD5 9628c23698ca78a9c7dda9620a957742
BLAKE2b-256 c144631d3bc7f1e5b0ab9ac090f5d398f1c9bb771b796058839e0dc1113efbc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b5bb489c8fd2d0739bb8bd8026ed290284dd2bcc40c6daac66c5be0f8b111acd
MD5 5096ad863f23d99136333e4d2a719b69
BLAKE2b-256 7612568a057573ab8f765118de2588856fed5cb5275f44ff7ad04d995e4240dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c699903abb92a65be68b1cc2a7b24c9f2c264bc334da657006da98eb858b148
MD5 d2f972baebe1c4c52ad6dad305c35783
BLAKE2b-256 f4fce75668973bb577c9dd47f0fdc6726fc134d2be622e5e07a7573a3d1d2675

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 319191ec51977827e77c0f9256571c95489e3f99d23f4fa59142aaa3ec1fe76d
MD5 77170474ba99eec2e2ada8ce86fc07f5
BLAKE2b-256 6d4d0e1c4fb26859a8689cf5f21b770108511e18192b58c4477f379fa3471861

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5a929416ca711f894940ae74c9caa0c741c86f2da30d2ee3789a6237f8baa751
MD5 b122f9dac66968f74bdd7fd4788f35d5
BLAKE2b-256 5d61923485182d25a21bf108fcc1574b5fff7c8322d9888b0e15eec8dd746d51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 176da753a81df6d7480a05e9d333b5952952d67bbebe9479145613772b6756c6
MD5 a667ceba3c4283396abeaec65fbdb03d
BLAKE2b-256 3d7c9fb935738a2e3bc3c7ad3e41adb9ec5192f6a9885694e276237db59ce307

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1bd3299c6ec29645e481d05bc3f593e2ef77bcdb4f7a81179b60dfffeab8472
MD5 1041ace5a4662a956151ce695aa3973f
BLAKE2b-256 9e8bc9e8b729859dd169562002186f61b191b139a26d588bc01a94d5395d80e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd84cc092f19c8ac8cc25ab48561cd67effb170d9da53ca9d1e6cac6c8dc5c1b
MD5 1b5ceaa799107ad9bea906e60c23096b
BLAKE2b-256 4faf9c74b017b20ce355cc9240ab158bdf34623ec272305bb612040614c71e4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.15.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ea5a83e37513dd9ee19a51de577796fc47e2f2158fd83f8fb432cb6d3d0de5ef
MD5 cae29df5793db1432e6b0a56f03f7993
BLAKE2b-256 b15d95c8f7f6c0632f3941a6ae6251931577a7811c52fad2172d39bcdbd68630

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