Skip to main content

GPU-accelerated image processing in python using OpenCL

Project description

py-clesperanto

Build License Website Python Version Development Status GitHub issues GitHub stars GitHub forks

pyclesperanto is the python package of clEsperanto - a multi-language framework for GPU-accelerated image processing. clEsperanto uses OpenCL kernels from CLIJ. This package relies on the CLIc back-end for processing.

Installation

Get a conda/python environment, e.b. via mini-conda. If you never used python/conda environments before, please follow the instructions here first.

conda create --name my_env python=3.10
conda activate my_env

Install pyclesperanto package using conda:

conda install -c conda-forge pyclesperanto

OR using pip:

pip install pyclesperanto

Code Example

Note: This project is under heavy development. General API, functions, and parameters are subject to change.

from pyclesperanto import cle
from skimage.io import imread, imsave

# initialize GPU
device = cle.select_device("GTX")
print("Used GPU: ", device)

image = imread("https://imagej.nih.gov/ij/images/blobs.gif")

# push and create buffer
gpu_output = cle.create(image.shape)
gpu_input = cle.push(image)

# process the image
inverted = cle.subtract_image_from_scalar(image, scalar=255)
blurred = cle.gaussian_blur(inverted, sigma_x=1, sigma_y=1)
binary = cle.threshold_otsu(blurred)
labeled = cle.connected_components_labeling_box(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))

# save image to disc
imsave("result.tif", labeled)

Example 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 user documentation folder

Contributing

Contributions are very welcome. Before spending effort on coding and filing a pull-request, please get in touch, [file an issue], and let's discuss your potential contribution.

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.

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

Uploaded Source

Built Distributions

pyclesperanto-0.6.2-cp310-cp310-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.10Windows x86-64

pyclesperanto-0.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pyclesperanto-0.6.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

pyclesperanto-0.6.2-cp310-cp310-macosx_11_0_arm64.whl (686.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyclesperanto-0.6.2-cp310-cp310-macosx_10_9_x86_64.whl (670.3 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pyclesperanto-0.6.2-cp39-cp39-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.9Windows x86-64

pyclesperanto-0.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pyclesperanto-0.6.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

pyclesperanto-0.6.2-cp39-cp39-macosx_11_0_arm64.whl (686.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

pyclesperanto-0.6.2-cp39-cp39-macosx_10_9_x86_64.whl (670.5 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pyclesperanto-0.6.2-cp38-cp38-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.8Windows x86-64

pyclesperanto-0.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pyclesperanto-0.6.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ i686

pyclesperanto-0.6.2-cp38-cp38-macosx_11_0_arm64.whl (686.1 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

pyclesperanto-0.6.2-cp38-cp38-macosx_10_9_x86_64.whl (670.4 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pyclesperanto-0.6.2-cp37-cp37m-win_amd64.whl (2.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

pyclesperanto-0.6.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

pyclesperanto-0.6.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ i686

pyclesperanto-0.6.2-cp37-cp37m-macosx_10_9_x86_64.whl (668.3 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pyclesperanto-0.6.2.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for pyclesperanto-0.6.2.tar.gz
Algorithm Hash digest
SHA256 6e0df0011e1b24f13f57c9612b948b90e82b9609280409062e019bc06e09ae5e
MD5 127291ae046e3944bb6114d852f5ebf2
BLAKE2b-256 d5c88b9d38cc54cffc833cd5070e6ee5cd6ca39658da45e6b1e7c865b96c9d0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b62d4d9d9cd9f435fe27057b43dc52df69c99f051eb0440a2acc3e9681e51e7d
MD5 93eee0969693dea0207b3f35414ed372
BLAKE2b-256 4e744bc9e1eac9506e443813e408755d3d0554642f71ab26f98f580ee68c96c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da366bfaaa2f48651ea19bd7c13c652a10799bb6bc3642052425b50adee89834
MD5 105112dac85ab112d2db868dc7989cbb
BLAKE2b-256 cdb13bd4d8d68a83ece458d01a37f001118c5be2aae402c231764e5b9a29ffe8

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4530b13fbde788267ce2394f8b8db4b91db1fc431f40bdaf142cdf4e6edb1e74
MD5 c59df56721e054589ad4deeaf71d5e28
BLAKE2b-256 97af82871f2a9edb862a04592420a75207e6441252788c799a06aca45cb9cf8f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30a6ca376d8892758da7cd6c606d38cf435e1a0e3ccb69399e59a926e6ead491
MD5 7655f0a0978a864a64a1c0ce44871602
BLAKE2b-256 dfd7ecc3aa46adfcda248e60ba12d65a9326d5b0eaa3bd9555caf92e41f73103

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b7d7530c8e1757af288c8bae48bfc625312b782eb626b26a2fb7983b85559caa
MD5 15a5e263649d9da8262f5693c2e9c624
BLAKE2b-256 68e03cd8f3b9b44ad69ec928a36d26e4e9907a695c4f97fe230c2f967b064cce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5a4202578f59067c10384b5c1327f09811096e06c59dd1f6b6b867b9d8f49bd5
MD5 da7da1dfa4553768b4ce4cb3a9de39ef
BLAKE2b-256 473c7ca81ef77e4d0e90d61f0b847aa8b813381836dbd9f684cf2b10cc1847a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07cac1d0e63816706e352f66281ca14ee199714e9813037da4b449c306c19d6b
MD5 67d81813d9e62808a572d2553f054966
BLAKE2b-256 973d791d430e85ab79853e84f09c50c850926b7ad9ef4ba5a592d42711bd593f

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 dcacb63513c5f85dcb0e475d3a3752e46a0bf0304fb4b9a68ac97dfc22362baf
MD5 c12167f9b9b5d4b08c9c75b03fd6ba8d
BLAKE2b-256 3d83c232bc8330f285e5defaf7ed1d4744e969789acabde8909683047352d355

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4e49fe721d5f8a11282cbd7f956bd0a68ebe498951a7075b3eb4e42a2a5a454b
MD5 67090660182e486de1a05e697cd91256
BLAKE2b-256 48a5a94e54ee3666757eeb967084d4656f48f6407dd65c2e19cf6fb32accea86

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 91411392b5d781e5adff1b0723cb99e0da8e4730aa7c2a6622ef2ee1a5bad79d
MD5 2e60ea4de641728e9cb097ec69e1f28e
BLAKE2b-256 f02f504e9825156de20fe64321048ccfbe40bd53d00cf0eedef02d5636911769

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b248f24605d94ca44a7f3cd52e0b07e3940c8835bb74786a6c6fa8c799245e32
MD5 963eeb07f15c4e9b72bf88581373fac4
BLAKE2b-256 e6d61ded46bdc8ffaaf133d8c4c35a0c32011230a492cf3dba8bde1c0e5bd237

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e92761fb803e83de0e3afc90f3602a4f1d038fab066d87e0667dd558d3090c5b
MD5 0a51d32cc207bed813f42ce3e64d30b1
BLAKE2b-256 0d5492d8bc279d6cbceda50c465c12398828df227ebbbd6dd813a2811afcebc5

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 643f2cc66de9be8393758ca0578a3b7725879a5d0ebbff93e6354da4122912de
MD5 89919ab878bc87905a06bfd260a32952
BLAKE2b-256 f4230975fcb25304815fcdb52a714a9faeca1b275c507c2ef59358e91308f568

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce4a4df4ae236e191dbaa81e3e3071852dea0a8e2a58512ca1c410bde5219c10
MD5 d4edeaa896bf968351b557aee93010e8
BLAKE2b-256 f65f45e2758c2f7218139dfeec4aebc6fd0c21baa797da23f484b9fd3ea114bd

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9e413174c8db0dcc4639d9a2b0524a92ec2d27e2ba5c2354be7a24855175ba8e
MD5 9a31dc4d5e751bd8e220f6dfe75430dc
BLAKE2b-256 ca94417a8a8340b8cf9ea3d56943adeb86d4331ee81a46d542daa4fe84f20223

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1fb4ce724caccb89e3f69af69c1253595436094efafb9959c262a0287b91cb15
MD5 f9c4e0daede97ffb6604b00d7aacbc45
BLAKE2b-256 03eed4d2e4d9cc498a2396d25a707facd13639686caf58c037d7f22caf2db969

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0725501c70ab8c8db0fd3777566be9b05c166767328a77538d8712724977ea5
MD5 89b74b1a358fc358b90f92e54a39c22f
BLAKE2b-256 138701138fb03ef4205efb05856ae58458349f36a23c6e0c350a24313856725c

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d7d9b6c3d429602a2babbe93cd82bf4ed6a027eae8436b47b95b3efe03186da6
MD5 7d40db0863dc709af2d1d903801fc9b7
BLAKE2b-256 cb86ea2eec71767f0c9270762a92570ed5c0726ebf2d66cc4ad6fcc14baa29e2

See more details on using hashes here.

File details

Details for the file pyclesperanto-0.6.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyclesperanto-0.6.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f60b2212db77b4b2c49e522699c9dba8acac58040bd9103d0c96c14596a5572f
MD5 ff19a176d6e7b22b5deb198167eb8f3e
BLAKE2b-256 3981b2c9819aad68c84bf32c2a5e064cca36ac00afec5603c93a16748d328a87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page