pyclesperanto
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.
[!NOTE] If transitioning from
pyclesperanto_prototype, check out the transition notes to help you update your code.
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).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyclesperanto-0.24.0.tar.gz.
File metadata
- Download URL: pyclesperanto-0.24.0.tar.gz
- Upload date:
- Size: 75.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52c5b7dc6b931d45352c158ec8eab372d8a21e4bee41fc92e29c7e1d218fa5eb
|
|
| MD5 |
01addb05859669babf47f0b6b605dd43
|
|
| BLAKE2b-256 |
a3a843058ab9a3e6c33182033cba6ac12f83c4c5c0e964de31c3d1eab2fe254f
|
File details
Details for the file pyclesperanto-0.24.0-py3-none-any.whl.
File metadata
- Download URL: pyclesperanto-0.24.0-py3-none-any.whl
- Upload date:
- Size: 92.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95b750fc73cdfaa6602fa3e8ed60d8c6e99ca0e345b94516e94ecb3047be4de6
|
|
| MD5 |
6e09a30692da34ca3906552aa22c3601
|
|
| BLAKE2b-256 |
f81f626622c8889e01a6ac8a870d4768fdcbe09e137d62702d5eec2a80880a1e
|