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

Uploaded Source

Built Distributions

pyclesperanto-0.14.2-cp312-cp312-win_amd64.whl (465.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.14.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (878.9 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.2-cp312-cp312-macosx_11_0_arm64.whl (504.1 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.14.2-cp312-cp312-macosx_10_14_x86_64.whl (544.1 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.14.2-cp311-cp311-win_amd64.whl (470.4 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.14.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (885.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.2-cp311-cp311-macosx_11_0_arm64.whl (502.2 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.14.2-cp311-cp311-macosx_10_14_x86_64.whl (538.3 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.14.2-cp310-cp310-win_amd64.whl (469.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.14.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (881.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.2-cp310-cp310-macosx_11_0_arm64.whl (500.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.14.2-cp310-cp310-macosx_10_14_x86_64.whl (535.9 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.14.2-cp39-cp39-win_amd64.whl (448.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.14.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (882.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.2-cp39-cp39-macosx_11_0_arm64.whl (500.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.14.2-cp39-cp39-macosx_10_14_x86_64.whl (536.1 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.14.2-cp38-cp38-win_amd64.whl (469.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.14.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (880.2 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.14.2-cp38-cp38-macosx_11_0_arm64.whl (500.5 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.14.2-cp38-cp38-macosx_10_14_x86_64.whl (535.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.14.2.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.2.tar.gz
Algorithm Hash digest
SHA256 879f48f1bb60297d4af654c510b791616cb6722fd0e5269014a0907d2e661edb
MD5 9cccb1d3d26c2696d113335019c3501f
BLAKE2b-256 84b50f4a8b32cb615de67aa67bed4aa630fd1df912684a0b27785513a23ded06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ca3f2b9a344ce5f4ce2d22be3d8032f265b899014802d4ca371f04373b0376e3
MD5 5faae8223beb94c990a69054ab54fba7
BLAKE2b-256 aba3e5ae5e28c064632c122db2ec4efa5ce42949eb7b1188ba028d1dde6a9488

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4eb6fbd78f153b1abbc303e66fc2b6c682a55a5575bd2258c11321dd6b30d3ce
MD5 ecf30ae3e075e7c66aa741a680316882
BLAKE2b-256 73bb5ec16ac0e955ca44e1518e96c1837d0b677b49b7205343f793e3b6ef8d21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 381aed9652626e5071df1dc8aa061af6bd84d0414bb17ce39e5fe45cf3a8b88d
MD5 27bba1a8d3ddc6b16e870105d98c9efd
BLAKE2b-256 fc5ec43b835d54852f121dbaa0c489b942627f1567f8628dfc6e2344de4b66d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 723efb87e799ecf83f36ea13abebd06fc30d77315405f9cef08948f31b7e1acb
MD5 4fb77cf74920f8ef894ca13580c0d2c8
BLAKE2b-256 3f856290300257bceb96f36251894c68948bfb665430cbf7fdb624a71df30947

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 03acb53f0eb8f660c63052243ae30685dfa8adcd6bc1edf9d84fea30ebb60435
MD5 13ae4736de5bebf4c46cfe41cbb16814
BLAKE2b-256 3bbb8b7387b4a15ae50b456c17fad98821cf714364e4e774b786725d3be118ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a74b057b9928da51532d15099319613a413e38eb305c04aaf6853ce3a452d81a
MD5 6b1efb21a45ca5ef0fa50f393bb0c329
BLAKE2b-256 918930656d0ff8002023aadfcdf17e69df054ff771881fbaa1aff9e3af41d755

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3d3e337cde9059406928a33ec03c711c9b5ed562892b3d45eadcf06694da20b
MD5 53afc37c7c1e7d3a2b0ebd6547d79d7c
BLAKE2b-256 a022dbf3952069ec479088b3e38d2fe1e0f58edee6012ddad7b1d0dfa00d6a28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c21c23ec93bb29feda010835bef524a120ae31cd9e7b61df0cc7c0a2ca409941
MD5 cb1e496b0420cef97ac75b9aa42fa52e
BLAKE2b-256 4e4fdbdc57359991e77e77a9d63efdf0f82bc6b53a82ed89c35cc26c43e14107

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f0e22e947bd5c260ccf1b0dd63c9452fe620bca4e8a3fff0eca7efb5008b39c6
MD5 999a28324b718be7d40ad20097f36260
BLAKE2b-256 a78ade3b72b14569b9915abb7948a4b23b17dd09ebc2c261a6892c9494d52ff5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd543f7e4156a43604f61e2f5337f80ca2116d417434672b5249d5122a1870bd
MD5 3f8d68832206da55bd72eaa3c67f9b58
BLAKE2b-256 59297c3cb00ce2e635e3cfc199d821b472ddbf3f0c576ebb917a43828e3f56b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d9cd0938053adf647d7e55d4b86cc48507a6bd4891c1e6c66e9d1fec580014eb
MD5 0a469c5368154e254e89f9c8b3b498a4
BLAKE2b-256 87a61bc020156e98ad3425776bc6798951aa9f48b606064a0886dc0eee4b1856

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fe6f04f01b3928d6cae7ce680b4426ace5366dc7831aa10a29331a352ecb6bbc
MD5 6a153b3e426c95c67f37ecd4bbd8bbaf
BLAKE2b-256 42f2d3bd7920cc3076d8d67e069ba34292ac11c813fbba70fe6a3146ea246080

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 37ffcb03db377bb85121a4b0c7af221727251f12b477e06fa4106a41ae078334
MD5 c70057f0a1dc1baf1e3702f0eafa6466
BLAKE2b-256 96dedeabc86bb43a6519837113046f3a322f3dac700b72e25af7183fdb0e9c35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e1fe616f34771eefa30705eb495cfb81321003c42317d804d5590de7af15d157
MD5 7049106133f0b3443ea40d02b662a424
BLAKE2b-256 f83dc048cb9273ad2787db70b1e379540dcaa59a08abd0666149f29baf85ecfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 efc4df1044585aa32093ce61d19a0bcb2ee3d9f5c616a6c59b50b01d7972fd57
MD5 137b76524a5f2e6cf1da20b9f60c7430
BLAKE2b-256 1fd02bcafbc523837245c54f24a07a1d27dc54d5d94edd59666a48d01965133a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f67cbed8e3c24446153079ae62381de53a7187a22090cfa99cddccb108b89a5a
MD5 e611566458233a534e2fef33beac559f
BLAKE2b-256 c0e336e261e2e7eb4253089308d989c8d33f2ec62395e3d110f401d4beec532f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 4e1bc836ce7bb1ca0cca230e889b575f4b837fdad12507a7554a90a6c73e0839
MD5 a5be1020cd3d46b57401b1ebfa2a7daa
BLAKE2b-256 fb996f2bf2e44e80644c3052b919db56d6c9e6e1533cc89b81ab02fc982ccb7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0305e3cca9388cd36e619bee09d10419aa1394874802da983d5f85faf2a47fea
MD5 749bfaeb6ad44f9b86ada0a12f6cfaaa
BLAKE2b-256 adf0427068ff6268a1b5b0c9603bd69871cbe8274bed2e4c15fe2b015eebf576

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be39146f2355f30ed237ab3a18f3705af2ea4b8e4fd2d8db9651eceb80a64bfe
MD5 8791e4dfbc7822c6bf58598c2cefa35d
BLAKE2b-256 a100414712db875ea93a6808ae36bd575b21a28608f380f523c56faa2ca5a018

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.14.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 58259a8b2630d9a64cbcabd6a8528170b998893fcc64a592ae8b69149e7f004d
MD5 98179ce55456474c8548760582347398
BLAKE2b-256 d7eca2ec44f137710748fef1a637da6ec3ed731aef3261b593d1370ed007270c

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