pyclesperanto

GPU-accelerated Image Processing library for Python

https://github.com/clesperanto/pyclesperanto

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    3 of 8 committers (37.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.0%) to scientific vocabulary

Keywords

gpu image-analysis image-processing image-segmentation opencl python

Keywords from Contributors

interactive mesh interpretability distribution sequences generic projection optim hacking fairness
Last synced: 6 months ago · JSON representation

Repository

GPU-accelerated Image Processing library for Python

Basic Info
Statistics
  • Stars: 51
  • Watchers: 6
  • Forks: 8
  • Open Issues: 5
  • Releases: 36
Topics
gpu image-analysis image-processing image-segmentation opencl python
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

py-clesperanto

Image.sc Forum 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

[!WARNING] * 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] pyclesperanto package is also available on PyPI and can be install with the command: * pip install pyclesperanto

Troubleshooting: Graphics cards drivers

In case you encounter one of the following error messages indicate a wrong OpenCL setup on your system: * "clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR" * "No backend 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: * AMD drivers * NVidia drivers * Intel GPU drivers * Microsoft Windows OpenCL support

And make sure that your OpenCL library are accessible in you PATH.

[!TIP] Linux users may install packages such as intel-opencl-icd or rocm-opencl-runtime depending on their GPU.

Code Example

```python 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.subtractimagefromscalar(inputimage, scalar=255) blurred = cle.gaussianblur(inverted, sigmax=1, sigmay=1) binary = cle.thresholdotsu(blurred) labeled = cle.connectedcomponentslabeling(binary)

The maxmium intensity in a label image corresponds to the number of objects

numlabels = cle.maximumofallpixels(labeled)

print out result

print("Num objects in the image: " + str(num_labels))

read image from device memory

outputimage = cle.pull(labeled) imsave("result.tif", outputimage) ```

Examples & Demos

* [Select and Manage devices](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/api/select_devices.ipynb) * [Host-Device memory management](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/api/push_pull_create.ipynb) * [Process an image](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/api/process_image.ipynb)
* [Crop, Flip, Paste arrays](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/basics/crop_flip_paste.ipynb) * [Math operations](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/basics/arithmetic_operators.ipynb) * [Matrix operations](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/basics/matrices_operations.ipynb) * [Vector and Matrix operations](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/basics/vectors_and_matrices_operations.ipynb) * [How to inspecting 3D image](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/basics/inspecting_3d_images.ipynb)
* [Segment and analyse blobs](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/analyse_blobs.ipynb) * [Voronoi-Otsu labeling](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/voronoi_otsu_labeling.ipynb) * [Cell segmentation based on membrane](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/membrane_segmentation_2d.ipynb) * [Cell segmentation in 3D](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/Segmentation_3D.ipynb)
* [Edge detection](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/edge_detection_and_enhancement.ipynb) * [Ridge and Tube detection](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/ridge_detection.ipynb) * [Parametric maps](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/parametric_maps.ipynb) * [Rotation, scaling, translation, and affine transform](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/affine_transforms.ipynb)
* [Multi-device tile processing](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/examples/multi-gpu_tile_processing_with_dask.ipynb) * [Ask Bia-Bob example](https://github.com/clEsperanto/pyclesperanto/tree/main/demos/interoperability/biabob-example.ipynb)

More usage and example can be found as notebooks in the demos folder. As well as in the documentation.

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 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).

Owner

  • Name: clEsperanto
  • Login: clEsperanto
  • Kind: organization

GPU-accelerated image processing across languages and platforms

GitHub Events

Total
  • Create event: 51
  • Release event: 10
  • Issues event: 38
  • Watch event: 14
  • Delete event: 34
  • Issue comment event: 70
  • Push event: 161
  • Pull request review event: 6
  • Pull request review comment event: 5
  • Pull request event: 103
  • Fork event: 3
Last Year
  • Create event: 51
  • Release event: 10
  • Issues event: 38
  • Watch event: 14
  • Delete event: 34
  • Issue comment event: 70
  • Push event: 161
  • Pull request review event: 6
  • Pull request review comment event: 5
  • Pull request event: 103
  • Fork event: 3

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 518
  • Total Committers: 8
  • Avg Commits per committer: 64.75
  • Development Distribution Score (DDS): 0.226
Past Year
  • Commits: 409
  • Committers: 8
  • Avg Commits per committer: 51.125
  • Development Distribution Score (DDS): 0.193
Top Committers
Name Email Commits
Stephane Rigaud s****d@p****r 401
Stephane Rigaud S****d@p****r 54
Robert Haase h****f 32
dependabot[bot] 4****] 20
unknown h****e@e****z 6
Johannes Müller 3****r 3
Graham Ross g****s@c****k 1
pr4deepr p****r@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 106
  • Total pull requests: 270
  • Average time to close issues: 3 months
  • Average time to close pull requests: 14 days
  • Total issue authors: 11
  • Total pull request authors: 10
  • Average comments per issue: 1.82
  • Average comments per pull request: 0.99
  • Merged pull requests: 197
  • Bot issues: 15
  • Bot pull requests: 134
Past Year
  • Issues: 31
  • Pull requests: 92
  • Average time to close issues: 5 days
  • Average time to close pull requests: 4 days
  • Issue authors: 5
  • Pull request authors: 5
  • Average comments per issue: 1.61
  • Average comments per pull request: 0.79
  • Merged pull requests: 76
  • Bot issues: 15
  • Bot pull requests: 63
Top Authors
Issue Authors
  • haesleinhuepf (45)
  • StRigaud (32)
  • github-actions[bot] (14)
  • thawn (6)
  • m-albert (4)
  • TimMonko (1)
  • truatpasteurdotfr (1)
  • wuziqi-cmu (1)
  • guijacquemet (1)
  • indahaus (1)
Pull Request Authors
  • StRigaud (124)
  • dependabot[bot] (119)
  • haesleinhuepf (36)
  • github-actions[bot] (29)
  • pre-commit-ci[bot] (12)
  • m-albert (2)
  • pr4deepr (1)
  • jo-mueller (1)
  • CherifMZ (1)
  • grahamross123 (1)
Top Labels
Issue Labels
bug (24) auto-update (20) low_priority (8) documentation (6) help wanted (6) prototype (6) request (6) wontfix (4) wrapper (3) api (3) dependencies (2) question (2) enhancement (1) build (1) low priority (1)
Pull Request Labels
dependencies (125) github_actions (24) enhancement (6) api (6) wrapper (5) build (5) bug (5) documentation (2) submodules (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 6,465 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 38
  • Total maintainers: 2
pypi.org: pyclesperanto

GPU-accelerated image processing in python using OpenCL

  • Documentation: https://clesperanto.github.io/pyclesperanto/
  • License: Copyright 2024 Stéphane Rigaud, Robert Haase, Institut Pasteur Paris, Max Planck Institute for Molecular Cell Biology and Genetics Dresden, ScaDS.AI, Leipzig University Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • Latest release: 0.18.3
    published 6 months ago
  • Versions: 38
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 6,465 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 13.1%
Forks count: 13.6%
Stargazers count: 14.2%
Average: 15.6%
Dependent repos count: 30.6%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • conda-incubator/setup-miniconda v2.2.0 composite
.github/workflows/wheels.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • pypa/cibuildwheel v2.12.0 composite
  • pypa/gh-action-pypi-publish v1.6.4 composite
.github/workflows/pages.yml actions
  • actions/checkout v4 composite
  • actions/configure-pages v3 composite
  • actions/deploy-pages v2 composite
  • actions/setup-python v4 composite
  • actions/upload-pages-artifact v2 composite
pyproject.toml pypi
  • matplotlib python_version >='3.7'
  • numpy python_version >='3.7'
  • toolz python_version >='3.7'