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

Uploaded Source

Built Distributions

pyclesperanto-0.16.0-cp313-cp313-win_amd64.whl (464.4 kB view details)

Uploaded CPython 3.13 Windows x86-64

pyclesperanto-0.16.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (870.3 kB view details)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.16.0-cp313-cp313-macosx_11_0_arm64.whl (501.4 kB view details)

Uploaded CPython 3.13 macOS 11.0+ ARM64

pyclesperanto-0.16.0-cp313-cp313-macosx_10_14_x86_64.whl (536.5 kB view details)

Uploaded CPython 3.13 macOS 10.14+ x86-64

pyclesperanto-0.16.0-cp312-cp312-win_amd64.whl (464.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

pyclesperanto-0.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (871.1 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.16.0-cp312-cp312-macosx_11_0_arm64.whl (501.2 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyclesperanto-0.16.0-cp312-cp312-macosx_10_14_x86_64.whl (536.6 kB view details)

Uploaded CPython 3.12 macOS 10.14+ x86-64

pyclesperanto-0.16.0-cp311-cp311-win_amd64.whl (469.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

pyclesperanto-0.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (876.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.16.0-cp311-cp311-macosx_11_0_arm64.whl (498.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyclesperanto-0.16.0-cp311-cp311-macosx_10_14_x86_64.whl (532.0 kB view details)

Uploaded CPython 3.11 macOS 10.14+ x86-64

pyclesperanto-0.16.0-cp310-cp310-win_amd64.whl (468.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

pyclesperanto-0.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (872.1 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.16.0-cp310-cp310-macosx_11_0_arm64.whl (496.6 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyclesperanto-0.16.0-cp310-cp310-macosx_10_14_x86_64.whl (531.5 kB view details)

Uploaded CPython 3.10 macOS 10.14+ x86-64

pyclesperanto-0.16.0-cp39-cp39-win_amd64.whl (449.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

pyclesperanto-0.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (872.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.16.0-cp39-cp39-macosx_11_0_arm64.whl (496.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pyclesperanto-0.16.0-cp39-cp39-macosx_10_14_x86_64.whl (531.5 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

pyclesperanto-0.16.0-cp38-cp38-win_amd64.whl (468.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

pyclesperanto-0.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (871.5 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyclesperanto-0.16.0-cp38-cp38-macosx_11_0_arm64.whl (496.7 kB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pyclesperanto-0.16.0-cp38-cp38-macosx_10_14_x86_64.whl (531.3 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.16.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.16.0.tar.gz
Algorithm Hash digest
SHA256 8ef99f687562467216cef25d8dcc4edaa2f94701cbc573688314cf3a0cf4f76f
MD5 05d1c9a2a5d8a37532916c5b477982e3
BLAKE2b-256 67342bc42b756ce5f245c890ccd319386099d9fc8c70f27687d32789c96bc914

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.16.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 483a8604b63cee60cdf961c9498aa3e213f09609019580cd1c6f26dafac60821
MD5 e4c4c28237981e98f62bb024ed31bb55
BLAKE2b-256 7c979bf3e0d106d54a4e2256840f8e5aa1c1113f06508271101915e80387283d

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.16.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3709ff8f1b4683c617505ccc41e54477b47b2267b3b6920f3a1cc3e7a8b13f9c
MD5 49b8179132a5c14829fc60b58ab9dfdd
BLAKE2b-256 091415024e92fc6659af608d730deba50dde2a4de593fb89ac14ec3d316b5988

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.16.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fbca90319d97f5aa329c66366d464a7c90369e8074c8ad5b39d2f1d4b09dfb3f
MD5 8dd6f75eb9a93f6caa94b64fdb02aee5
BLAKE2b-256 7fc06d31855d804de84c4bec5c8d3ad97e8e2e9d9cacf6b70f7924e15c83291c

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.16.0-cp313-cp313-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp313-cp313-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 19d356337f77c4a6a831ecabae7089ab38eb0f612133e41f2d4778d5d61c47f8
MD5 875b37b27a9946a642617827315d27d6
BLAKE2b-256 f26433ea1b5fef1afa028778adf9357a4f947d34be25e8a534e24ad0f132a616

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 97ed56d22e0dcfa11cc48f178f87cc6472982b5500e876307ff0003d59e71175
MD5 bc6f4a2c38696dc59a63371093735a45
BLAKE2b-256 556d421bd7ba0de0c6b854039d3e37b870a4234af5118a4c5abe3bec308fe221

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 137ac5ba58649e1feaf7cbd5d2d71a62d066031396cae05d252a890b254009c2
MD5 af81d58fbeaa1cecb6dc8f9da1763817
BLAKE2b-256 8b2b598c768395f7bc692a1d2206f3ec9e73bd26952493ef850209b49a325d47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34977d9c9ee7fed91eceee5e2a5d59a46478873db2987bf422110d1e558ef1f7
MD5 bfd6638929dbb216bd58278fafd2a568
BLAKE2b-256 6921f87232406a7e0368a33ed4bf14c4ce5a96e25b381e2733c633276b188719

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp312-cp312-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5525d6851727912008529bafb4c47bc3c6a78a3dee4b32e995ac1de9125453c5
MD5 84accd5865dba8cc4127a3f680487392
BLAKE2b-256 472e8d7dce1d8d2b96a8772fb8a1db6742a4d11e266f35fdd57079d9bd0e6c9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fb935d458954a87060120f80be18fa69e69267fc9c40c9cdffe77d2bec8155a4
MD5 b85b47991d28bf4be33aa5a94c82e8c4
BLAKE2b-256 8bbb811a1530567ed3c96d6281a16c64fda2f79f81dbd7b3f40c86018c5e5823

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a7e8f798a70ae9305e0ca1ff8aa1c80190e8870776ec8690e6caa74d0afd150c
MD5 7793f621ced6d5c8e748032cfa6c09fb
BLAKE2b-256 be6bf5e6b679086514edadad33b798b80ee94460c9b00dc0a1f39a79158e31c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8aa5a2f48f5ef06cdeba2d634e5e2ca7c89c2fb147f98ca8540db37cafec508c
MD5 6c5ff1e9969e03f5db82b758c552955a
BLAKE2b-256 ce84f49cd24b825295fd9342cdfa0e89b7de0d2b63f69677ea03e4bc277a475f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp311-cp311-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a9c1fe858b7f16b35c009ecbef7dd4a70601eb1ee629a85d442e64a75b49637c
MD5 a2b9392840230d0d15fe7d5a1a58ccba
BLAKE2b-256 78e1de8dd2083a9847afc385364906ba62c027ea622b33f08438f60aa2d95eb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9a87c7050822707329797c0664da963ea30d5c15eff47bbca2896698ed1f3f2f
MD5 e87c0e060414d4e11a44afe3536f0fdb
BLAKE2b-256 f4946a03712fc7eac0d875d785be81d07beeadb92d9fd70bcd4ad173f663abc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09467d71a59fff9a1328df6a1a6fd095181951ed78a83812b014fc8cd958b4d8
MD5 f6708027abdf61dbc4d04bb800761701
BLAKE2b-256 73eefe7e637def86b29482b3c265dc718abc92f7561bace82fb46f7db36af5ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef84411c1c2471ba3338ba393cf6ef08e317d592e964703f060ebf93fb058479
MD5 b82db39759678981b9e077e4a9b6ccbe
BLAKE2b-256 54a6e083ec31fd41baf8c9fb33954302c6f10026acd4120ebd395baa752473a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 303e22fa44982bf71841419fd7ed7e38ab96d8365d20cf3cf1ee24574eefb469
MD5 bd7fbb33dc2788ea3ddb112f4b752e0a
BLAKE2b-256 5c5d154026806f3f69a4fd647135dd4d11f592fa263c11a79073632777e27b23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 35a1538f7d00ad31e4081dcbeece9b2441029814c2ac6c4c5260580965cbe516
MD5 24ca2b1a79e20a562c9b3797f1a7d7b4
BLAKE2b-256 81bb8b33439f926e87fbca5a639e5cc2d99829767dfa2d08b721b2a592253c46

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b50a5eaa528f12d741a0928866ad819d23c3c43e02708dab6e349161ef29fbb2
MD5 5fb12df71c2deb84bc0c4791e6e6a838
BLAKE2b-256 e0301a4670fd17bf5acf09f3c21a54b6793bfc4d44c3524e886068fffbba4ba6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13186ca7e13678a4130ae4737b62e8e87e603d07b00ffca44ce310991f20345b
MD5 ee13dc9fa240282c2e291c11ee3ab4ae
BLAKE2b-256 edb44f75535b4adeef0c05a54ae27f32193e8cfee22e3ad2707736ecdf1c8000

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 3daa7943fb942f09fd57b7c19d65447524e1ee288e48b3a1e7f8308f1ac46da3
MD5 06998fdc1fb25b13399d4b368f1528cc
BLAKE2b-256 75e4de432cb14d46517d0adb3e456e7e186e6fe36b5c64f885f6f6fed531ffc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a9d5761db3bc64b79b774e5c64e243300b06ef5c87e2d837a6fe5e221bc73107
MD5 4abcce5e3f63820ceb25550159525708
BLAKE2b-256 543d0199e206af0139adeb181f3e2d0776ddb2165bc3bd74630184156da47d20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb9643a59de1ad30d3ae2c93a2742a57de143376ce57841b3a78759cf40e4532
MD5 2b22b606457c76009ad43d1a9eca37af
BLAKE2b-256 02ab984cba12b74e159a2bcbe75ef5ef0db0d2a3db1eda52940d8cbdb686c0f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97405f07368cc41ef3bb229586b6bcb0ec0897a3b2fef53702933b14aa542063
MD5 659bc36bdd82d90fa0c249c1d5f276c1
BLAKE2b-256 bb44dbc38c8326f9b018d33ee127fd6f3d122fcb4fc3c85abc149aa9bb9cdbfe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.16.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ed2d6fbb832d8cf3bb5139ffe7b246cdd58833f6b206a0881788df6913d35b05
MD5 dd0e6976a1ab2295a4543ca9f715b2a8
BLAKE2b-256 8bdacaf1f4640d0af783a2de60b3d09f0444648579af20f4e74a571c0ebf9550

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