Skip to main content

pyclesperanto

Image.sc Forum PyPI License Development Status Build codecov DOI

pyclesperanto is the python package of clEsperanto - a multi-language framework for GPU-accelerated image processing, compatible with OpenCL, CUDA, and Metal.

We mostly use it in the life sciences for analysing 3- and 4-dimensional microsopy data, e.g. as we face it developmental biology when segmenting cells and studying their individual properties as well as properties of compounds of cells forming tissues.

Installation, Documentation, and Uses

To install pyclesperanto from pip:

pip install pyclesperanto[all]

Full documentation, examples and API references here 📚

If you encountering any difficulties or have questions we encourage you to raise them on the image.sc forum under the tag clesperanto, or to open a github issue.

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?raw=true")

# 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

More usage and example can be found as notebooks in the tutorial section of the documentation as well as in the docs/demos folder of the repository.

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. Contributions, of any kind, are very welcome. Feel free to reach out to us. And 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 and by the Institut Pasteur, Paris. 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, and by support from the French National Research Agency via the France BioImaging research infrastructure (ANR-24-INBS-0005 FBI BIOGEN).

Metadata

Release files for pyclesperanto 0.25.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyclesperanto 0.25.0
File Size Uploaded
pyclesperanto-0.25.0.tar.gz 79.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyclesperanto 0.25.0
File Interpreter ABI Platform
pyclesperanto-0.25.0-py3-none-any.whl Python 3 none any Details

Total release size: 79.1 MB

Release files / pyclesperanto-0.25.0.tar.gz

Download URL pyclesperanto-0.25.0.tar.gz
Size 79.0 MB
Tags Source
SHA-256 checksum
How to use checksums
5692e2617153aa7c298d3796e90f9ad14177847f16220bfaf02b428149a0fb30
BLAKE2b-256 checksum
How to use checksums
2d087337167fa1da32de56faac0c41b9818a34f29260a4b40fa8ba72e1e8f016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pyclesperanto-0.25.0-py3-none-any.whl

Download URL pyclesperanto-0.25.0-py3-none-any.whl
Size 96.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f944aa5dfbe79e40d8da0c106c089e4fab01de31e7a5b546e5158337029b429
BLAKE2b-256 checksum
How to use checksums
95fa568976b75e8df318e80857623297ba344e42d427428f3903af5e3b425e8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.25.1

2 release files

This release

0.25.0 This release

2 release files

0.24.0

2 release files

0.21.4

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.9.0

24 release files

0.8.2

24 release files

0.8.1

24 release files

0.7.0

17 release files

0.6.7

21 release files

0.6.6

25 release files

0.6.5

21 release files

0.6.1

20 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page