clEsperanto - GPU-accelerated image processing across languages and platforms

View the Project on GitHub clEsperanto/napari_pyclesperanto_assistant

napari-pyclesperanto-assistant forum website License PyPI Python Version tests codecov Development Status napari hub DOI

The py-clEsperanto-assistant is a yet experimental napari plugin for building GPU-accelerated image processing workflows. It is part of the clEsperanto project and thus, aims at removing programming language related barriers between image processing ecosystems in the life sciences. It uses pyclesperanto and with that pyopencl as backend for processing images.

This napari plugin adds some menu entries to the Tools menu. You can recognize them with their suffix (clEsperanto) in brackets. Furthermore, it can be used from the napari-assistant graphical user interface. Therefore, just click the menu Tools > Utilities > Assistant (na) or run naparia from the command line.


Start up the assistant

Start up napari, e.g. from the command line:


Load example data, e.g. from the menu File > Open Samples > clEsperanto > CalibZAPWfixed and start the assistant from the menu Tools > Utilities > Assistant (na).

In case of two dimensional timelapse data, an initial conversion step might be necessary depending on your data source. Click the menu Tools > Utilities > Convert to 2d timelapse. In the dialog, select the dataset and click ok. You can delete the original dataset afterwards:

Set up a workflow

Choose categories of operations in the top right panel, for example start with denoising using a Gaussian Blur with sigma 1 in x and y.

Continue with background removal using the top-hat filter with radius 5 in x and y.

For labeling the objects, use Voronoi-Otsu-Labeling with both sigma parameters set to 2.

The labeled objects can be extended using a Voronoi diagram to derive a estimations of cell boundaries.

You can then configure napari to show the label boundaries on top of the original image:

When your workflow is set up, click the play button below your dataset:

Neighbor statistics

When working with 2D or 3D data you can analyze measurements in relationship with their neighbors. For example, you can measure the area of blobs as shown in the example shown below using the menu Tools > Measurements > Statistics of labeled pixels (clesperant) and visualize it as area image by double-clicking on the table column (1). Additionally, you can measure the maximum area of the 6 nearest neighbors using the menu Tools > Measurments > Neighborhood statistics of measurements. The new column will then be called “max_nn6_area…” (2). When visualizing such parametric images next by each other, it is recommended to use napari-brightness-contrast and visualize the same intensity range to see differences correctly.

Code generation

You can also export your workflow as Python/Jython code or as notebook. See the napari-assistant documentation for details.


pyclesperanto offers various possibilities for processing images. It comes from developers who work in life sciences and thus, it may be focused towards processing two- and three-dimensional microscopy image data showing cells and tissues. A selection of pyclesperanto’s functionality is available via the assistant user interface. Typical workflows which can be built with this assistant include


It is recommended to install the assistant using mamba. If you have never used mamba before, it is recommended to read this blog post first.

mamba create --name cle_39 python=3.9 napari-pyclesperanto-assistant -c conda-forge
mamba activate cle_39

Mac-users please also install this:

mamba install -c conda-forge ocl_icd_wrapper_apple

Linux users please also install this:

mamba install -c conda-forge ocl-icd-system

You can then start the napari-assistant using this command:


Feedback and contributions 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


This project was supported by the Deutsche Forschungsgemeinschaft under Germany’s Excellence Strategy – EXC2068 - Cluster of Excellence “Physics of Life” of TU Dresden. This project has been made possible in part by grant number 2021-240341 (Napari plugin accelerator grant) from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation.