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

Uploaded Source

Built Distributions

pyclesperanto-0.13.4-cp312-cp312-win_amd64.whl (464.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.13.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (873.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.4-cp312-cp312-macosx_11_0_arm64.whl (500.9 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.13.4-cp312-cp312-macosx_10_14_x86_64.whl (539.9 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.13.4-cp311-cp311-win_amd64.whl (469.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.13.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (881.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.4-cp311-cp311-macosx_11_0_arm64.whl (498.6 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.13.4-cp311-cp311-macosx_10_14_x86_64.whl (533.6 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.13.4-cp310-cp310-win_amd64.whl (467.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.13.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (876.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.4-cp310-cp310-macosx_11_0_arm64.whl (497.0 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.13.4-cp310-cp310-macosx_10_14_x86_64.whl (531.9 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.13.4-cp39-cp39-win_amd64.whl (447.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.13.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (876.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.4-cp39-cp39-macosx_11_0_arm64.whl (497.1 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.13.4-cp39-cp39-macosx_10_14_x86_64.whl (532.0 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.13.4-cp38-cp38-win_amd64.whl (467.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.13.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (874.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.4-cp38-cp38-macosx_11_0_arm64.whl (497.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.13.4-cp38-cp38-macosx_10_14_x86_64.whl (531.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.13.4.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.13.4.tar.gz
Algorithm Hash digest
SHA256 eed379d6000503cbf413548fcd4077d3c8fc09deb7d7721f4d66cb92f47f9814
MD5 34301d76acd3c5994e55ce282c73e5df
BLAKE2b-256 ea00f935382afcc94c74adbc348972855adabee2ab5081def996f1f2090d2647

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a514fadb76ed7ace1c107cd5de161e9ae883138f3941d229c5ea6397dd113360
MD5 e44d7171382eb5de687aed49d4c02fa5
BLAKE2b-256 0ce59734853b0c947ddf36d15b58f91c60ac5bb09ddc402e3d0099d09fa2dcf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 321c817e8a3648ca0173184705124a5e421625e2d421934c754a700c51cf092d
MD5 155795fd824969e954bd9cd54216d76a
BLAKE2b-256 12546ee319ed0f45a214f4e27f5371ae926a1ca7e947e1a04082184abec5c568

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d25098874c7386c03b1afa4990fa20257493d596eedd7bb936c7cdd1b8be7a18
MD5 1ec69df21165cdfd0f5afb6e8f119bf3
BLAKE2b-256 c70436f78cf287886d9ceed49525923a5dea9b7170542ae27a12483b823f16aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ca93eefbc95af7555fb63ea2a24d6d5cd5d6ac1fb09ead1b4ca11ddbd32a4fc3
MD5 7c9bddbf8f5c76d48c46e8e98d6cee35
BLAKE2b-256 0531cf72cb29444305cb71a0f6c39741f0db979b6f5c4950f99053fcb40b229a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 91831ff6270c222638e7eddc770bf569c2cbe7265dd63feec3a0a85bd330a550
MD5 7a0bab5defa89421a8282096686b9ae6
BLAKE2b-256 b5e35e19a6304e3d2283fb6d67aa126cbc1c9d59a5da0195bf17785a2b9fd093

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2bcd1e60cf4121e17287883d857eff36ece16de1df9b6a567594c8308151b5c
MD5 2c4a64f09dc247f0ea6d45bbd9937dd6
BLAKE2b-256 dd1dc8fa3e6aaea89f25862e5e15cc65738fd44a4f0cae26a5086de0b6b6a804

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8d0be9bba325004fcebd3704d344cb61be878edffa1d2261a9fe1588f918a0c
MD5 cafc561b91e80561f5feb4d23aa78e11
BLAKE2b-256 eaada66d38f873b1084db48d0b71695810ccf9eb298f3860eac9513ff4a61770

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 932e305c61b7bb778aaf3cafc34fc5f241a179c7f6ced0f69659db5f7df783d6
MD5 b098bca1e2452e0764201252b5eb8fa1
BLAKE2b-256 aab60e833b032754c6d8d7f115e01310b09f6f919dd66a7657890b28738e80af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a99b10b9b00937f31688528b4e56a4f47fe5b14e27441bdc91c6f1b7b9617f87
MD5 f916060a48c728339cd17ab7b0e7fa61
BLAKE2b-256 f047b61241bf79575f0b6c014ec73373f985b975852eb67b3ae8993580126f69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4cc4943491eecc745176cf5067f51d39bcf9d59f6315bd200bf43adf7c98295f
MD5 7f5b7edc29591963ace0a61eca6d6d22
BLAKE2b-256 88fb111a189582dfc5541291740d11a137b9b6d3cb7fd668f1d7c0b4ba734345

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f4e4dc58bfd38c04cb38932341e16f4519eb638b5f244b4610d23df7d003427
MD5 8d41636b757363ce18f7c22838a5a54a
BLAKE2b-256 b9a33222177fafb77cf2c724c187ede757420591dfe3395922382a4382611f55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0c157c9720254be17cd076c014c5fd6d8ae765106f0b92b1f280201de3248fa1
MD5 5edbd67bee796f7b86c0bc1e2a27294f
BLAKE2b-256 1d959fd1bc36873fea2439497618a9162b2258f69fbdd286250e8a60555ace8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c10161b2704c42c485b77d7b3aed85396351eb4fa31f92d90098c51cc32502a6
MD5 d04365483b9f3989f2b4431b19111743
BLAKE2b-256 9465d927dfe3ade9c0a9e892c6c89795ac8adeb5127b490679d73d0ce804b621

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a477535bfe1a6f8f4560c3a23b0fac294e6e34763a6f1f05e9e6bcdf1ab836a8
MD5 f8fec792312fd55e0188ad2999833ae1
BLAKE2b-256 8683177dcf973a299d9002e5ecc851ce1e73c69debaf49b6a0d91f89918d5dae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 411ca2f8a99021eeb9fa7341a0b51c45cb89bfec0e623541ef68b76826f013a6
MD5 74e1349449b777b5e29e33c0f7c55831
BLAKE2b-256 9b2f03ac3013241a668964d59eb69d7849dadc107dc0756aebc716c197ebcea3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0ba34600b36bb27e57e29fee61534992c7b0bed3f7e75711b04ddadc73fdea8f
MD5 26c2947f1fd2369391a70e0800b5974f
BLAKE2b-256 79516bfdc0a1bb857f0572b3a5cc0c9e7531852fc9665c00421c146b0f4eb69b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6e2f7ae6c84c33153d2e4e246aa636d0e67b3f7037e3ec1996975c220f4c8a67
MD5 c87cfaaf84faa32d39ee9362aa3e44ae
BLAKE2b-256 bc097b02aa76e45fa7ce6aa63d1edfc9264fab5425919953ed4de5ec7729e4e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9e2122890bdc852809e12c6d007d332859f88b45bad0336968deec8495d9b6a5
MD5 aef4c973a662eeba5f538cff3e1b2d78
BLAKE2b-256 a05f4bfe7a085dfe0742a534ee7406672313366dc41b959e11b8d3b0e8b16165

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e3d72a2e5df5e93e8567f2bee4433816b64982b14033075e18ed69f42f68a94
MD5 212fa9ae9e9c09c96c3a35e5642d2a64
BLAKE2b-256 8627aa8e0e048817fe5582d42e57a27762a6e3627ce6d0ac25ccbb425aa9fb24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8856be23c10f8473ccdb8b3c8174160007efc3744e5be7c8d8d557b60b02c582
MD5 bf5d9e2a1191ee33daaca14bb30503ea
BLAKE2b-256 517f3c2e0431c9631c6c4ba2bc45f4e5bf4e0539939accea7e3f3c9f0b4e4c67

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