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

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

Uploaded Source

Built Distributions

pyclesperanto-0.13.1-cp312-cp312-win_amd64.whl (456.6 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (867.3 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.1-cp312-cp312-macosx_11_0_arm64.whl (495.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.13.1-cp312-cp312-macosx_10_14_x86_64.whl (533.7 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.13.1-cp311-cp311-win_amd64.whl (461.6 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.1-cp311-cp311-macosx_11_0_arm64.whl (492.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.13.1-cp311-cp311-macosx_10_14_x86_64.whl (527.6 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.13.1-cp310-cp310-win_amd64.whl (460.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.13.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (870.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.1-cp310-cp310-macosx_11_0_arm64.whl (490.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.13.1-cp310-cp310-macosx_10_14_x86_64.whl (526.0 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.13.1-cp39-cp39-win_amd64.whl (440.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (870.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.1-cp39-cp39-macosx_11_0_arm64.whl (491.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.13.1-cp39-cp39-macosx_10_14_x86_64.whl (526.1 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.13.1-cp38-cp38-win_amd64.whl (460.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (868.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.1-cp38-cp38-macosx_11_0_arm64.whl (490.8 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.13.1-cp38-cp38-macosx_10_14_x86_64.whl (525.8 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyclesperanto-0.13.1.tar.gz
Algorithm Hash digest
SHA256 0ca0788e04e4bcf36a75da3b3b1e16d05bc3aa43a14619b15b09af072f2e887f
MD5 9c82768f412f58425787d8e2797d13a3
BLAKE2b-256 1e6b9d6094bb77f40070565e6b21d78f2669d90515ff2b319ae466f935deffef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 df2ba350e229a19b35a68685809dfad1174365c2efddf018df1490996b7a079b
MD5 b7b550ca6a912a3960ae7d448f96f195
BLAKE2b-256 4582fa70aa8d397bda8698a4cffca1dc2dad7910b192ab17f3d283ada5267f34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 54b93a69588edbf0797fbfcbb0f32539733c8cfad8df554cf941bc357318b8ad
MD5 8348ff0a396c64cb506c861dc1f1b80c
BLAKE2b-256 a637c0cb4c3cc3709270ad5b6981ba05ee15f044216af080654667ede7e2bbf6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4f903c7d8668d805ad67506844f69529c1c6112c3c1f6af16e74eec3a739a98
MD5 83b73dce7b299a7cd18c6f4d62fe7178
BLAKE2b-256 2ee90112bf11f488590f0554961706028922e248cbb7d90782125f5694e45e14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a7bb3e1130d4637f997d7dd1aff3ee11b98444167ea85ab736c0d43f197c3e38
MD5 91b7ce83de76ba0f8931ad133bcc3052
BLAKE2b-256 ecc016551ad70ea49e197edcf2f4cdad9d5972a097f8ac53afd7a2f9dd4523d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bcbfb1904dc4b2d2c81771b44e6aecdb712ad7cc71e7241b9388556e3664d562
MD5 73c63ff94f91055a6875be24585908d0
BLAKE2b-256 aea79fef3478ea9b6cec1ac74759fee3129353335418bb815a985eb690e19ea5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 000d31785f0303fa0d5e52ba3f5f2236aa4fe21ed28356b6278fbc69da57332c
MD5 86af089a2b349552c5e4bd882d201700
BLAKE2b-256 125c4101a0148ea488ee1872e16a4e83675785f75aea96f22c819a2e451640ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bfa48cbab84850bc9a60c54ec5b9f6d814ce373c03cf3f145127f190d13530f6
MD5 b7702f5446d22bb3a8e7685809fc6ee8
BLAKE2b-256 f94051fd8d81a0812cd6119670f8d1a073b37518adb6db699c2ce9b9d8a54976

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 db33590ea669b98d81da4a24229476222ddfb59efcc05b98b14d75da6cd689a6
MD5 a5969fc18694bcbc77a43e6692e917df
BLAKE2b-256 79949ddc4b0de0edeef4b3142fbb98fcaa3ce739d8cb84c6ce15ab48721a6e0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f49242b137a2aacdb3f8ced672ddcbbd168b30008c5f2f2e14541b0bd1eb7ed2
MD5 0e6382a699f0db51f6268985b4f25328
BLAKE2b-256 5b0c7b58011e3fd82845af4b512e964891cdebde9449d75506c57ce4b49f5871

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8f79398cb812232d6ffb1547194153128f0af196d5d5e4619f170939bb0242b
MD5 b842df8c0d672dc8a7bce61288536a87
BLAKE2b-256 9d20eabf6cc2a7b9aa2ad1b7af22deea08334d7b5adb040601245fa43c4fc51a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f1cd29a9b8c0cd933adf1ca367577857b646757cc6656826b11d3a30b61d042
MD5 d1a40ec84be4445befc104cae9822752
BLAKE2b-256 f1afddc5e839fe2c6249aa997a01328b5c7d943183536be211492d83e2d95a40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 177616254e251f03c5cfad56e23c92619347a0f5662a9b18b4a151f485ba5df6
MD5 645077eda359db43303fd29faf77ea72
BLAKE2b-256 1e2c9f39a20e9ac4461e6a63e08b2f26f4287fa32d8d4bb0485204d2874c8356

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 80d01c1a0feba002143b297bc712add0ff213c467da072ca1bb18520031259b6
MD5 0ad249b7e65356de3f3c3d4030e8332f
BLAKE2b-256 6b968d1cecc3ace23cf48768a6a478e30e1060e7a646b62f9aa0e66f15d2ae8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad4342dc4cf8eb56bf3ea99d10a67d63ab1493204d3e0cf87084701ab9f31486
MD5 0c6d51d04815951060c494aa7d27dc7f
BLAKE2b-256 8aa89030bd4332b8935b94c5b0803140b900e70fd05af6d81c0054871ae13b12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 26a2ca626cfb6c084ecd65488c4272515666199762c026d4cb2a356424488697
MD5 5bd6674345660582df4c2fd8445865d5
BLAKE2b-256 c79e5f7c1091c6e5cccb00569c7ac5ec0bf599e18fbd98adc2b037353511005a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e3c6e71eeacb8a580f127432cb57aacc14c6e1a4a3ba2e7ca37806d8c9c9add8
MD5 5edd4cdcfc219922c4e5a34f5fac8dbc
BLAKE2b-256 cd13b27096d235ec7eba3dfd63dca1c82aaa8b555bd09db124c479de9b54a53d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4cdad16749a96a27167e91d99cfcf12be56247050660b1912ce1ec07f39688d4
MD5 0065d6f146ff659915e69e7d7efbeba6
BLAKE2b-256 96caea464c3e676ad932e4fb022ca7398672393cbe0112d84b0871cc0b57342b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 249e2127fd81beaa005e055a19f079d6a0eecb74a3166ce3b193a03eefd634cb
MD5 31ee303c323c8584e1a5bb973e8835f7
BLAKE2b-256 414539852dd52367623a716bcb72298fcafe75e2319adc8170eed9041b7ba262

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e74e20b2fdd4c7e57961c9bc4d75ae0b9d96f5aba1e0d61eb951babc5a82dbe
MD5 bb9cd881b6712447d944e84c01622487
BLAKE2b-256 28f0f17dc023cfdd76f57e56db39348d2d312ecd0de9d0cbbafa8edf1aa26501

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ad85137bb45d4785410c0fec47dff69f69e42babce2b97c4df73466c4fb608fd
MD5 11b8f8d4e91e57cb2acc8dfba3507fb7
BLAKE2b-256 607d70c22659a721981ddf082c71b35088bea54bf754ec85dbb713d86508a2f9

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