https://github.com/clesperanto/pyclesperanto_prototype
GPU-accelerated bio-image analysis focusing on 3D+t microscopy image data
Science Score: 33.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
-
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
4 of 13 committers (30.8%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.8%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
GPU-accelerated bio-image analysis focusing on 3D+t microscopy image data
Basic Info
- Host: GitHub
- Owner: clEsperanto
- License: bsd-3-clause
- Language: Jupyter Notebook
- Default Branch: master
- Homepage: http://clesperanto.net
- Size: 221 MB
Statistics
- Stars: 231
- Watchers: 12
- Forks: 48
- Open Issues: 76
- Releases: 67
Topics
Metadata Files
README.md
py-clesperanto
py-clesperanto is a prototype for clesperanto - a multi-platform multi-language framework for GPU-accelerated image processing. 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.
Image data source: Daniela Vorkel, Myers lab, MPI-CBG, rendered using napari
clesperanto uses OpenCL kernels from CLIJ.
For users convenience, there are code generators available for napari and Fiji. Also check out the napari workflow optimizer for semi-automatic parameter tuning of clesperanto-functions.
Reference
The preliminary API reference is available here. Furthermore, parts of the reference are also available within the CLIJ2 documentation.
Installation
- Get a conda/python environment, e.g. via mamba-forge.
- If you never used python/conda environments before, please follow these instructions first.
conda create --name cle_39 python=3.9
conda activate cle_39
- Install pyclesperanto-prototype using mamba / conda:
mamba install -c conda-forge pyclesperanto-prototype
OR using pip:
pip install pyclesperanto-prototype
Troubleshooting: Graphics cards drivers
In case error messages contain "ImportError: DLL load failed while importing cl: The specified procedure could not be found" see also or "clGetPlatformIDs failed: PLATFORMNOTFOUND_KHR", please install recent drivers for your graphics card and/or OpenCL device. Select the right driver source depending on your hardware from this list:
Sometimes, mac-users need to install this:
mamba install -c conda-forge ocl_icd_wrapper_apple
Sometimes, linux users need to install this:
mamba install -c conda-forge ocl-icd-system
Linux user may have to install packages such as intel-opencl-icd or rocm-opencl-runtime depending on their GPU.
Computing on Central Processing units (CPUs)
If no OpenCL-compatible GPU is available, pyclesperanto-prototype can make use of CPUs instead. Just install oclgrind or pocl, e.g. using mamba / conda. Oclgrind is recommended for Windows systems, PoCL for Linux. MacOS typically comes with OpenCL support for CPUs.
mamba install oclgrind -c conda-forge
OR
mamba install pocl -c conda-forge
Owners of compatible Intel Xeon CPUs can also install a driver to use them for computing: * Intel CPU OpenCL drivers
Example code
A basic image processing workflow loads blobs.gif and counts the number of objects:
```python import pyclesperanto_prototype as cle
from skimage.io import imread, imsave
initialize / select GPU with "TX" in their name
device = cle.select_device("TX") print("Used GPU: ", device)
load data
image = imread('https://imagej.nih.gov/ij/images/blobs.gif')
process the image
inverted = cle.subtractimagefromscalar(image, scalar=255) blurred = cle.gaussianblur(inverted, sigmax=1, sigmay=1) binary = cle.thresholdotsu(blurred) labeled = cle.connectedcomponentslabelingbox(binary)
The maximium intensity in a label image corresponds to the number of objects
numlabels = labeled.max() print(f"Number of objects in the image: {numlabels}")
save image to disc
imsave("result.tif", labeled) ```
Example gallery
| [Select GPU](https://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/select_GPU.py) |
| [Image processing in Jupyter Notebooks](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/interoperability/jupyter.ipynb) |
| [Counting blobs](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/count_blobs.ipynb) |
| [Voronoi-Otsu labeling](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/segmentation/voronoi_otsu_labeling.ipynb) |
| [3D Image segmentation ](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/segmentation/Segmentation_3D.ipynb) |
| [Cell segmentation based on membranes](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/segmentation/segmentation_2d_membranes.ipynb) |
| [Counting nuclei according to expression in multiple channels](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/measurement/counting_nuclei_multichannel.ipynb) |
| [Differentiating nuclei according to signal intensity](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/measurement/differentiate_nuclei_intensity.ipynb) |
| [Detecting beads and measuring their size](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/segmentation/bead_segmentation.ipynb) |
| [Label statistics](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/label_statistics.ipynb) |
| [Parametric maps](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/tissues/parametric_maps.ipynb) |
| [Measure intensity along lines](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/measurement/intensities_along_lines.ipynb) |
| [Crop and paste images](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/crop_and_paste_images.ipynb) |
| [Inspecting 3D image data](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/inspecting_3d_images.ipynb) |
| [Rotation, scaling, translation, affine transforms](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/transforms/affine_transforms.ipynb) |
| [Deskewing](https://github.com/clEsperanto/pyclesperanto_prototype/blob/master/demo/transforms/deskew.ipynb) |
| [Multiply vectors and matrices](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/multiply_vectors_and_matrices.ipynb) |
| [Matrix multiplication](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/multiply_matrices.ipynb) |
| * [Working with spots, pointlist and matrices](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/spots_pointlists_matrices_tables.ipynb) * [Lists of nonzero pixel coordinates](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/nonzero.ipynb) |
| [Mesh between centroids](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/mesh_between_centroids.ipynb) |
| [Mesh between touching neighbors](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/mesh_between_touching_neighbors.ipynb) |
| [Mesh with distances](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/mesh_with_distances.ipynb) |
| [Mesh nearest_neighbors](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/mesh_nearest_neighbors.ipynb) |
| [Export to igraph and networkx](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/ipgraph_networkx.ipynb) |
| [Neighborhood definitions](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/neighborhood_definitions.ipynb) |
| [Tissue neighborhood quantification](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/tissues/tissue_neighborhood_quantification.ipynb) |
| [Neighbors of neighbors](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/neighbors_of_neighbors.ipynb) |
| [Voronoi diagrams](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/voronoi_diagrams.ipynb) |
| [Shape descriptors based on neighborhood graphs](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/shape_descriptors_based_on_neighborhood_graphs.ipynb) |
| [Measuring distances between labels in two label images](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/neighbors/distance_to_other_labels.ipynb) |
| [Tribolium morphometry + Napari](https://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/tribolium_morphometry/tribolium.py) |
| [Tribolium morphometry](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/tribolium_morphometry/tribolium_morphometry2.ipynb) [(archived version)](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/tribolium_morphometry/tribolium_morphometry.ipynb) |
| [napari+dask timelapse processing](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/napari_gui/napari_dask.ipynb) |
Technical insights
| [Browsing operations](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/browse_operations.ipynb) |
| [Interactive widgets](https://colab.research.google.com/github/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/browse_operations.ipynb) |
| [Automatic workflow optimization](https://colab.research.google.com/github/clEsperanto/pyclesperanto_prototype/tree/master/demo/optimization/optimize_blobs_segmentation.ipynb) |
| [Tracing memory consumtion on NVidia GPUs](https://github.com/clEsperanto/pyclesperanto_prototype/blob/master/demo/optimization/memory_management.ipynb) |
| [Exploring and switching between GPUs](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/switching_gpus.ipynb) |
| [Interoperability with cupy](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/interoperability_cupy.ipynb) [Using the cupy backend](http://github.com/clEsperanto/pyclesperanto_prototype/tree/master/demo/basics/select_backend.ipynb) |
| [Big data handling with Dask GPU clusters](./demo/interoperability/dask.ipynb) |
Related projects
| [napari-pyclesperanto-assistant](https://github.com/clesperanto/napari_pyclesperanto_assistant): A graphical user interface for general purpose GPU-accelerated image processing and analysis in napari. |
|
| [napari-accelerated-pixel-and-object-classification](https://github.com/haesleinhuepf/napari-accelerated-pixel-and-object-classification): GPU-accelerated Random Forest Classifiers for pixel and labeled object classification |
| [napari-clusters-plotter](https://github.com/BiAPoL/napari-clusters-plotter): Clustering of objects according to their quantitative properties |
Benchmarking
We implemented some basic benchmarking notebooks allowing to see performance differences between pyclesperanto and some other image processing libraries, typically using the CPU. Such benchmarking results vary heavily depending on image size, kernel size, used operations, parameters and used hardware. Feel free to use those notebooks, adapt them to your use-case scenario and benchmark on your target hardware. If you have different scenarios or use-cases, you are very welcome to submit your notebook as pull-request!
- Affine transforms
- Background subtraction
- Gaussian blur
- Convolution
- Otsu's thresholding
- Connected component labeling
- Extend labels
- Statistics of labeled pixels / regionprops
- Histograms
- Matrix multiplication
- Pixel-wise comparison
- Intensity projections
- Axis transposition
- Nonzero
See also
There are other libraries for code acceleration and GPU-acceleration for image processing. * numba * cupy * cucim * clij
Feedback welcome!
clesperanto is developed in the open because we believe in the open source community. See our community guidelines. Feel free to drop feedback as github issue or via image.sc
Owner
- Name: clEsperanto
- Login: clEsperanto
- Kind: organization
- Website: clEsperanto.net
- Repositories: 16
- Profile: https://github.com/clEsperanto
GPU-accelerated image processing across languages and platforms
GitHub Events
Total
- Issues event: 2
- Watch event: 19
- Issue comment event: 12
- Push event: 2
- Fork event: 2
- Create event: 1
Last Year
- Issues event: 2
- Watch event: 19
- Issue comment event: 12
- Push event: 2
- Fork event: 2
- Create event: 1
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Robert Haase | h****f@u****m | 865 |
| haesleinhuepf | r****e@g****e | 471 |
| haesleinhuepf | r****e@m****e | 160 |
| PRADEEP\Pradeep | p****r@g****m | 64 |
| Talley Lambert | t****t@g****m | 31 |
| Graham Ross | g****s@c****k | 12 |
| Juan Nunez-Iglesias | j****s@m****u | 5 |
| Lachlan Whitehead | w****d@w****u | 3 |
| ClementCaporal | c****t@g****m | 2 |
| Jacky Ko | k****o@k****k | 2 |
| Christophe Avenel | c****l@g****m | 1 |
| ENicolay | 1****y@u****m | 1 |
| Elissavet Sandaltzopoulou | 7****l@u****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 83
- Total pull requests: 53
- Average time to close issues: 5 months
- Average time to close pull requests: 2 days
- Total issue authors: 28
- Total pull request authors: 8
- Average comments per issue: 2.96
- Average comments per pull request: 1.23
- Merged pull requests: 45
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 1
- Average time to close issues: 7 days
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 10.5
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- haesleinhuepf (32)
- thawn (9)
- paxcalpt (3)
- somas193 (3)
- jo-mueller (3)
- ClementCaporal (2)
- tlambert03 (2)
- pr4deepr (2)
- MariusCausemann (2)
- allysonryan (2)
- oleksiievetsno (2)
- xiachenrui (2)
- lcferme (2)
- ajsc4 (2)
- hamdaan-shaikh (1)
Pull Request Authors
- haesleinhuepf (44)
- thawn (3)
- grahamross123 (3)
- pr4deepr (2)
- iionichi (2)
- jackyko1991 (1)
- ENicolay (1)
- ClementCaporal (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 2,749 last-month
-
Total dependent packages: 17
(may contain duplicates) -
Total dependent repositories: 5
(may contain duplicates) - Total versions: 96
- Total maintainers: 1
pypi.org: pyclesperanto-prototype
GPU-accelerated image processing in python using OpenCL
- Homepage: https://github.com/clEsperanto/pyclesperanto_prototype
- Documentation: https://github.com/clEsperanto/pyclesperanto_prototype#README.md
- License: BSD-3-Clause
-
Latest release: 0.24.5
published over 1 year ago
Rankings
Maintainers (1)
pypi.org: clesperanto
A graphical user interface for clesperanto based on napari
- Homepage: https://github.com/clEsperanto/pyclesperanto_prototype
- Documentation: https://clesperanto.readthedocs.io/
- License: BSD License
-
Latest release: 0.1.3
published about 4 years ago
Rankings
Maintainers (1)
conda-forge.org: pyclesperanto-prototype
- Homepage: https://github.com/clEsperanto/pyclesperanto_prototype
- License: BSD-3-Clause
-
Latest release: 0.19.4
published over 3 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- actions/configure-pages v2 composite
- actions/deploy-pages v1 composite
- actions/upload-pages-artifact v1 composite
- actions/checkout v2 composite
- codecov/codecov-action v1 composite
- conda-incubator/setup-miniconda v2.0.0 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite