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

Uploaded Source

Built Distributions

pyclesperanto-0.14.0-cp312-cp312-win_amd64.whl (465.3 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (876.4 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.0-cp312-cp312-macosx_11_0_arm64.whl (503.2 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.14.0-cp312-cp312-macosx_10_14_x86_64.whl (542.9 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.14.0-cp311-cp311-win_amd64.whl (470.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (884.2 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.0-cp311-cp311-macosx_11_0_arm64.whl (501.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.14.0-cp311-cp311-macosx_10_14_x86_64.whl (537.2 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.14.0-cp310-cp310-win_amd64.whl (469.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (879.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.0-cp310-cp310-macosx_11_0_arm64.whl (499.6 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.14.0-cp310-cp310-macosx_10_14_x86_64.whl (534.7 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.14.0-cp39-cp39-win_amd64.whl (448.0 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.14.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (880.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.0-cp39-cp39-macosx_11_0_arm64.whl (499.7 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.14.0-cp39-cp39-macosx_10_14_x86_64.whl (534.8 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.14.0-cp38-cp38-win_amd64.whl (468.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.14.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (878.2 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.0-cp38-cp38-macosx_11_0_arm64.whl (499.4 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.14.0-cp38-cp38-macosx_10_14_x86_64.whl (534.5 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.14.0.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.0.tar.gz
Algorithm Hash digest
SHA256 ee280b222801d99c56a7469494f4638d0ef9cab16aecc6dfe6444dcaf797fc8d
MD5 255c8122e84e9b1db55624ed2d24d914
BLAKE2b-256 fff59e99b8ba167f23ca00c00ab4ab3d590e963275abd8a5bc4671aa3aa48e66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9e6a1b18dfaccb664cd404028359e662d33025b6c6cf0f74859a0ce96f46452d
MD5 56d060b798f9babf87ff23e33aa64e5f
BLAKE2b-256 dfac5bfd2748b71c7742819a756f4c4f651a6ba12e689ade69bf25a55f480807

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a7b65ebb4940e7ccf24f9220a7551d09d6ad613972d2f71c2c0cd7a620e4d12
MD5 861c71769d78941427d8cdd359c06ed3
BLAKE2b-256 0f155e122e4d4b2da20097564ae6dbc8b159305509ef799dd8367258ccd71d61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5487bccb35c9641af4900ccb33db6e06f7bc8b2abe805f538e4f3e2e227f00e6
MD5 1b1b831dd3a916968fd2e9cba0d02dbc
BLAKE2b-256 f48c6da5bf5b0496763174c6383df7d81f68c69130a31db6e216f74be5ad33d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8f7b553d800bbab669a7c01d93add58804478cc4a435e89bfcf4b87e25e99846
MD5 dfd8d8be900750a7bfa9bf5500e20af1
BLAKE2b-256 ff9a5366d777c72a8eb2868108fee4b2ace0bffdf33fdbce2d9a4edc7dfeb5f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6c0941c556da66e02c19e7eccb661b2c139b5f8fedc225d13bc8e3abbeed41b8
MD5 20dbe2b045e17ae932ea77e62a0d0816
BLAKE2b-256 409faf73fae6568e8560fc15b9a2d7141d7601a362e7020734cf3fa3baf89a2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8ba69d7b0b9e90658c25190478496c95fd89d420aff11ac383d8628deae26000
MD5 c266d4bd055c97c0dec5c27b21d2e141
BLAKE2b-256 c4687ecf15f21fb64ed0fc389c777cf5be1e2357c128a2894539e983f15cb475

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8de86fc5b94db743bdb8d2b8dab464dc823b6b90b3299776893b29d9aefe2a37
MD5 a1b80c782834668bc6ebba9e24d29982
BLAKE2b-256 4010b24b560a15383d3c8887732e83460ebec11f23319a1ad1aefff99825faec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fe902aba2ebf6eda476b9353db7669e641dbb29120d019fd96adc05dd1d860d5
MD5 ab14c9fc757e3387ee4b8a9f389c6a64
BLAKE2b-256 fb6205cdeaa6a2c51154bc4f2d2a6bd1bb9b0788bb107af681b58861756b80a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9050efd7575928ac13af993e685e1da33e367cb337c54cd9824c5ba5f0d4be05
MD5 51e06a0725089fc9e6e923095a6ce5b8
BLAKE2b-256 d3a072bbcb92fded0974fea454e51579a770e010d17f3082a6605b3ab3be024f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6afd4bb1a7198512f9729f8f6d20b2a80975741f484b8b2646b799e8d7c39f92
MD5 fc2c94b5f6f1ed03a5b4b45a3f8a02e2
BLAKE2b-256 60d5e3cce9330e3cb1cea186e83d6739c1deae5b4476f47c2701bae395588b1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 87c1c772992245ab68c8eacb0789221f864f9323a19f4a67f23a6c38f824eafd
MD5 9d51b2d01f26e3395b2c48860835a39a
BLAKE2b-256 1f54881b465ad77e26233ce944149fee2ccbf4e9b6a47e2c539768c8204409df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 0c09427c36764b94ab7e97db0ad9364aaf3423097edbcee80b09568250064a96
MD5 329e71c0b2ec3f8a289600aa02db48fd
BLAKE2b-256 c46be1bff7286a2a3d1be2b559415a1aa4b9b4a3f544491f9c617db1e03830ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 27275b7f00c07ba874a5cc430a862d9be2a358fd2edcf2011ee9dbedb06717a5
MD5 743202a4f04f9d8dbb5ce301e59adccd
BLAKE2b-256 eb786c937ad576b94c95721b3817132843625db595cb627ae6cd7d8c7e3560de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 60762082775945ce3f24cf4aee5e32c0972151cee00a70f9d1138ad3523f3383
MD5 aa2169d8183f66acfa19d3ba1fd3653f
BLAKE2b-256 02ca08994532b7cfdc81f4a92dd79231565a4d7540386d92a7937fd40fd66531

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 32e90d209423d8596a49657337f76b754ffdfbf432043a633ff450475cfa13f2
MD5 d7fbbbac0d3e90aa600e9108dfb5363c
BLAKE2b-256 c502c4bc6702faffac280cd1d80a3fb07d32c2902f29868ca38de44546f58ea6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 98ac5b71b8c790f0cc4ff47e3fff5886de7ad68474e7a6f62d13ebaa8d160523
MD5 072a359ee2d239bfbd7b319b4f546cc2
BLAKE2b-256 1486a0d285d387c7555c14186403e30616983be6b0969c57f80f093f9cd9604b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 48bd42fbbecd075b5d9cec14d947f197955f4db7a11868c4a337247cb1365fad
MD5 85dbea8f1e9a852fa5782f9e38a572fe
BLAKE2b-256 7585c3fb58edeb7b6668c2a41cd96009459a69522a602f3a9e48788216ac230a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 443e8d52e8dc0fc4e37fd4cf7be4eef34b4124c33529f24625766174fa8af27b
MD5 a3f317d1e980b8c84b82d326098c2579
BLAKE2b-256 262740ac19b19e1e4786a6baa8658fa5366aae0144e0ac0fc9547d48b71a6b6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9bff77e8d07af0c14024f0afb2db6b758633f47daa053500e088603be6bc13b
MD5 8134845485378ab3df1b205689a98deb
BLAKE2b-256 8578e9b16925d0362ade87896d2a44dd687e05ab5491467538fe2e8f51821977

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8cafb98dfc513dd2c67b4e514931c5b67c29da2f7461329bc1c1b8ce9e377e52
MD5 af2e7263333ae72f869a0fca63f652b7
BLAKE2b-256 5d9bdf2f4ba9e86f28456500eeeccac61668c8f9f116976164b8ccf7d0621da2

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