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

Uploaded Source

Built Distributions

pyclesperanto-0.13.3-cp312-cp312-win_amd64.whl (461.6 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.13.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (872.6 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.3-cp312-cp312-macosx_11_0_arm64.whl (500.1 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.13.3-cp312-cp312-macosx_10_14_x86_64.whl (538.7 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.13.3-cp311-cp311-win_amd64.whl (466.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.13.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (880.5 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.3-cp311-cp311-macosx_11_0_arm64.whl (497.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.13.3-cp311-cp311-macosx_10_14_x86_64.whl (532.6 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.13.3-cp310-cp310-win_amd64.whl (465.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.13.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.1 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.3-cp310-cp310-macosx_11_0_arm64.whl (496.0 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.13.3-cp310-cp310-macosx_10_14_x86_64.whl (531.0 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.13.3-cp39-cp39-win_amd64.whl (445.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.13.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (875.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.3-cp39-cp39-macosx_11_0_arm64.whl (496.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.13.3-cp39-cp39-macosx_10_14_x86_64.whl (530.9 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.13.3-cp38-cp38-win_amd64.whl (465.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.13.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (873.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.13.3-cp38-cp38-macosx_11_0_arm64.whl (495.7 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.13.3-cp38-cp38-macosx_10_14_x86_64.whl (530.8 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.13.3.tar.gz
  • Upload date:
  • Size: 4.7 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.3.tar.gz
Algorithm Hash digest
SHA256 4fd1a6b5f2085aeb171e30a8db28db9625b4e5e5db4fe4bf276e3717b268330c
MD5 2acba44d5bd67c7491ed49870458abc7
BLAKE2b-256 d43f241f060205820ef19f8b0aac09900c093a74dfc2a641ff2901362abcd701

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6b25b7502fc13d983f5c6d7b43e92ca2b96acdd8aa0daa05ca08a61d0a95aa9d
MD5 c6dbc8b9670a25ec6573970e69f3aec6
BLAKE2b-256 7214c3712f96d024f6b03d83847535595f17c59a07eae105dda7ca287c709542

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 50cfe58866ff859b3ac7b53bd5b2e14691e43f6ea3d12808ca10a0ad7eb0fe54
MD5 2b3c871bb33cd06c1075edba10d24016
BLAKE2b-256 7eb058a922ac921549773adb70ba94db0e6cdcc86aa461d904d9e2c80fbbe1a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1ec55c8ba7363540cb7a24658bf36f6102ac929cffead5945789f259ea490a06
MD5 078fa1d77337ddeec8030ab20840006d
BLAKE2b-256 3cda4eef7347e50b622b4c902980aff5320670f905cbad61ab70c1ad1644f532

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8e7803f0feedfbce363a868a6253769f66d56acc5f50653eeab08a6531f9434b
MD5 72c47228a68f2376a72c5ee5477fab3b
BLAKE2b-256 baa13c36322d42854371ea98d1e81315de0df772052995508fe756e10aa427f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ea7d5e0a3ddc6ecfb18aa1b3550a5c638a9006521d3dedd9c3f92ee99147bede
MD5 0697531cab4a2e1561fa0ca3a987db29
BLAKE2b-256 679b17d08f73a9dfecc67db975cf9ad09c1d7b38b724e567ad8012d70c1fe44c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bfd9b4a29899ee9606da0ba3bba229a73bdb2ca55123a6fa1265fbaa13f6f5c5
MD5 c0f3d9fa8b543408f7ebe7ccb4bb12dc
BLAKE2b-256 c103bed383de034ab78cf12432c9458a315419f15d0ac83cc2ce85e84e524716

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d4d664ed049947d555c9a3a43578b72a9df9b2f3ecdbaf2f3c3d2f92975b2c2
MD5 d451b9b80f63611e1defc956caead1c4
BLAKE2b-256 2aa32003d1e38a70bdb17b21aff45da9eb8468d7b90817db17c1d45cda222dc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 622f1110ee5a5a807a9aca843de0e05574adad62b40ecc27959e3f83bea20b63
MD5 c94231a8d2f3c83b7e1f096c73e573a3
BLAKE2b-256 0b861e7035ac002fcacdf23f6adfe581bf0bba5aea7fe80be5052ede14635c19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d58110c0b652c7cb7b39d21ce07795703e614dcb849dda165940abd12699de7e
MD5 12460625da3376a53fe72aecb4e1eea8
BLAKE2b-256 2bc7fdc40d0b09a926b0893c7ebfa82a04e73d9f839bcb3982d01261d466a69c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0854a28c846912184a0c69a0002284c1b3fd1ef6c49f0d6a52f6d13e3fc63359
MD5 a5860b1492626165577ec283697fcc6f
BLAKE2b-256 a581ce6d651aa4d4123953bb70bab3005705a8a80d624f8b4e3c56e5ff35403e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bcfbd1f24f5bd17ddda4ed495158c9d0259254789b8b96c2f8b5f2fd3d1dfa9a
MD5 512f08849c2d33f42ee815256c1af02c
BLAKE2b-256 e7386f23bd7bed27ae480570aea18495ccc376c14a4ae2ab87219cb56a12aef9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c5c0d8ecc661a6de4911c2893e1f06449d75276dcfe286235ff349c337d07dcd
MD5 3be8c2ed9bcfe2961af909529b0ff923
BLAKE2b-256 d9579d5f0ee3cac1e4d7724aa7fbeef71461c683a90c43d358e928dd6843b412

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2e02e7f3d157ef048af5f65d877056229cc36389994a184b4980e3a1bac049b4
MD5 263b2d2f1ef89bd99fbb3ee47095b6b9
BLAKE2b-256 245fd2f224e50400305fd60f485a212db784947cc57a2051db6d9904dbcf7c23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69d27a28266938dfaf6533d78d0e9f358f132230b0f449ae49172caeff01de71
MD5 042ffca315006ad9f4acaa3dc5add2df
BLAKE2b-256 888ac01e66a8e6e2e1c734f992dd9ebfee20533dd5d4ca0f115f1a631c23bb3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6289c6173e63ec8edab5ab8924cb7f2def109a88f1434910b15e8f19de47838
MD5 a00a7c3cd185ce947f4d8fb8e94fb7bb
BLAKE2b-256 f79a0fd7c0966a273def329170ff129389ebde80a50e8c4c20b697451cc11fc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6210148dc0b209c7a1d8534b9df39524a1ff1cfd59a4e94b3dcc027a6df8b5be
MD5 cdd3cb4dbc3107eb874f07925e7a8f4b
BLAKE2b-256 255b71077e90305758bd04e188d6e643dde81ac206bfea23c47c913ce223ccce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 042192275fb5de1dad07907e24f2dacaa874c5fa4d679f201572906055c899fa
MD5 40fb5c8ad71c10f17db3677aec1dd840
BLAKE2b-256 bc986aceceae1a950787837b716d5bcc914564f59e66674d89d047566ebef8aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 96e57c334834f7a0e46276f2952394a63e9369d8fbaaf1bc8dae3d9109511c6e
MD5 e071c91af4d5b8586ec9d1c268f84453
BLAKE2b-256 003d68bf53889994d35eb16e7392205f919918dc30b4a02a1f63375b976d06e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fbebea7a8bcc8cfb551abd9c80c2f67a05b582b66365ce369237ff040a9dfaf9
MD5 c8b1a25465bac00292b49bdc43af702b
BLAKE2b-256 69b52f43e0a8404cae6be29f5e05a644ce2d325853d09538ae3fbb4480a535b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.13.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b889dcd635bf5954e8d7818c1499573f2edcb98c1917bdbbaacb3e770ec7f082
MD5 faf586bff092683bd29c3fa47e1247be
BLAKE2b-256 f5b16f5e87d881a65679378944b38b83171c410e18ae2446505766728704d89e

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