Skip to main content

GPU-accelerated image processing in python using OpenCL

Reason this release was yanked:

conda build failed

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

Uploaded Source

Built Distributions

pyclesperanto-0.12.0-cp312-cp312-win_amd64.whl (441.3 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (844.0 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.12.0-cp312-cp312-macosx_11_0_arm64.whl (476.8 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.12.0-cp312-cp312-macosx_10_14_x86_64.whl (516.3 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.12.0-cp311-cp311-win_amd64.whl (445.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (848.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.12.0-cp311-cp311-macosx_11_0_arm64.whl (474.5 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.12.0-cp311-cp311-macosx_10_14_x86_64.whl (512.1 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.12.0-cp310-cp310-win_amd64.whl (444.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (847.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.12.0-cp310-cp310-macosx_11_0_arm64.whl (473.1 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.12.0-cp310-cp310-macosx_10_14_x86_64.whl (510.4 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.12.0-cp39-cp39-win_amd64.whl (426.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (845.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.12.0-cp39-cp39-macosx_11_0_arm64.whl (473.2 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.12.0-cp39-cp39-macosx_10_14_x86_64.whl (510.5 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.12.0-cp38-cp38-win_amd64.whl (444.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (844.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.12.0-cp38-cp38-macosx_11_0_arm64.whl (473.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.12.0-cp38-cp38-macosx_10_14_x86_64.whl (510.4 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pyclesperanto-0.12.0.tar.gz
Algorithm Hash digest
SHA256 71455156af6e0d88e8df10188abe60f25da3afa8ec4bf84d1fe9a98389dca6eb
MD5 04211a145344ac46f783e1b7459a94af
BLAKE2b-256 3606935ee9d9e7de332f0b9973c4e7966cafc770994b3045f1400513aea5e9ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5487759a541809fb8c2f0d2c22825cc80de325675705d4acb8e147bc9ed9e772
MD5 f1e01da5358cf6503ab8c923551bd34c
BLAKE2b-256 d49345e9f23e8307c2b4efbc2b01c2e0b54b2ac3456cd88f34f47ba41692460c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8b55cbe746194576941a5fd7967dd21d8fc9ac835d34a5d8383b55e1fb5812d
MD5 4713cfd834cb7bbb110e43172f86f3e7
BLAKE2b-256 60eea4e5d74489ccff27367b0ed84e83cf32853bf795a376ad62d44b08e74850

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f34e3fa5d37e69ddb84df7b350c1c692c7e6e2eb9a4b92c7a6d01953fc58cb74
MD5 1487879ba415a5d07398e91a528ff31a
BLAKE2b-256 a66809705b3a0b9a1b243d31a5744873f16b7034336f8e65fe552b49d154b066

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9c36d2522fde98dc6e5cae8127331a431f49a350631871049dd577ecbc3a93ad
MD5 05f3e621f43b0f2f0e3d83df39fe16a4
BLAKE2b-256 9e97f2637fa3c8e6328eff59377a665c1598d8385d58891271bb9f924239b6a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 88d1a8fc665f050d3eaab623c72a3b5d7f4df22272843c3f6628cd048ba85946
MD5 a9c9bc673fcd646dc9edacbbd7cfa63b
BLAKE2b-256 6f20eb9664d6034fd8c01a2a06eb6779c7b3c19ef8af1f5bd57cab9cf401f435

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 072707e3cb5615fb6200f983205b89ddf5c2c412d8bd9fb8e56a65c3ced6a78b
MD5 dbe6a9e9878fd7e4f876a5f109d373b6
BLAKE2b-256 f3d099f375b2a031c7567cc5a26869a85d0f4ad385fe4d3cf33a26f3a464bf36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d1a3565d146a813adf16db87b5560b4ee0845fd7418fd138a326783b46ba0ef
MD5 429a44d3017aab85b762247f6176b7dc
BLAKE2b-256 ef443ac57a00cb3214c959c93f281766a80f61b3da71bce70538f59c3d7f5940

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 645a0c56dcc0a32b9290d6d2cd810e09167c1bbd9bd8e93e864b047e289b787c
MD5 64e3cc936c19518e3b8ebdad6a866dbe
BLAKE2b-256 aa5cf56fbde185f109d3f5f203859dca1bd9e0361c21b263323281c16d3efc82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3dc1a7866f25e9c19263b613d467d7ecb00e29e1b81706717a17c5b1c3418652
MD5 e345492989efb7b9695423dd5712c98f
BLAKE2b-256 1d3fffe071df0ef9758809f9b83cb8157424e03992d40e7e8076411d492d09f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bbb7f5e37f2375ece359ec5dbaa3e41f13d626e74358b82831a12ab22f7ccdc8
MD5 b64b50be70aa370c04e6d6e57a1100c7
BLAKE2b-256 3ee87b8d097011b84e9b8c9802fbfdce74e2fc1fe37b7cc60641f1addfa31d38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9169b80365a448bfe73fb60f5dbab0a38ab0c420c2413cc17bdc5b89812f7637
MD5 eea9064694a2ac285b319c797de95df0
BLAKE2b-256 26e784e6292baeed7d22e15dc3af5a031c914c38fcca9de05dd55013c0b90f36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 013ee9a84c6a2e8478e3970308f15f3d3571c78259dc9a08718aab5717a2cd2d
MD5 63ad0806a1446c5aa1ab59d4b5ff0a10
BLAKE2b-256 28f5b433a0c03f342f66feabc12ef8458636df33b047aabae4af60877437a78b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b7f3066096f7f854e89064e107e298f1be9670d2c4abd1800cf388861fef0f81
MD5 26f828ff010ac5089ca8ad542aa3d785
BLAKE2b-256 b941508c7e10778d97386260646827bdf25ffb59953dcf69f9183965c923f2d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43381b59fd1db11af3d59574c94c695e4522fa3ea433f0009e97463a05ece8fd
MD5 bfb340ca1a19b4e42c015bf11a9e6a21
BLAKE2b-256 eb2c67324e418f968f2afb61954820b44fe4283b452a8c4526001450909159ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01578c1ef0983ad01d88a7799bf82c746a8368a15399f0d6b22ed51982004e7c
MD5 913b8a1f50ed141df961b2002952a2c7
BLAKE2b-256 b91bffa3bfa0ce35cc96cf40582189a16cbd4f52271c169fa2cef2a4282fa08e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 93f8e24c5e193ab0fcb202c8b1f2aa285951b21d92bcbda76a1937f16427a8e0
MD5 c47d6b9122b0d39cc3fbf7932bbea7dd
BLAKE2b-256 d48fe5ab0fe1f1f9005a78b263c611fc3ef8a600782d1b741440530130cf7387

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2dcf7d7488b91e73da22227cc38af792e38312e0c3011c503762509dc868c498
MD5 9fba880c3ba9a5467f579ff2c6cdd229
BLAKE2b-256 7f60e958073aacbd650ccd957ab8c42cac897b4755e25bfb892d037e8f8f4bfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 772a6562b3a55ea1856fe462f7f9622038fca2f6de5f30f15189d48074fb91f4
MD5 f627c6740f66f3f403eaeb1b70660c58
BLAKE2b-256 5dc52363d82c87366b8eeacc5dcbdbe5c02937f1f2accef1f5d0af3a1d188d49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4427498f321e07bd648afcb2ed7c826612ab5bc2a30b587000c23c32bdc81861
MD5 b5ad9912c82348e0e05b9ac701b1700a
BLAKE2b-256 587b12902c750fef621733f0f66a34fb3900a918eada4ef22fb521ebba0dc04f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.12.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f7a96d1d9d651413a60aa5eae1b9563c55a6488148ac113f067584f11242f5a5
MD5 f59474d27f555b4d31313fc841d37dbd
BLAKE2b-256 36527322aedd49c29c8ac6743882e7f91940369a0be2cd275a1312a62e7f4dfe

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