EuroSciPy 2024

napari: multi-dimensional image visualization, annotation, and analysis in Python
08-29, 14:30–15:00 (Europe/Berlin), Room 7

Napari is an interactive n-dimensional image viewer for Python. It is able to rapidly render and interactively visualize almost any array like image data. Additionally, napari can overlay derived data, such as segmentations, points, polygons, surfaces and more. Each of these data exists as a layer in the napari viewer, which allows fine control over how the data is displayed. Furthermore, derived data can be edited. Together with the capability of writing plugins, napari lets you seamlessly weave exploration, computation, and annotation in common and custom image analysis workflows.


Napari is an interactive n-dimensional image viewer for Python. In contrast to matplotlib it can quickly visualize large data even when the data has more than 2 dimensions. Data can also be larger than RAM as napari can natively perform chunked loading when the array is chunked.

The napari canvas can be 2D or 3D. When you give napari an array with more dimensions than the canvas, it will automatically create sliders for those additional dimensions, allowing you to rapidly explore your data to the full extent, rather than a few sampled slices.

Image analysis and visualization involves more than images though: feature detection algorithms result in points, segmentation results in label images, annotation results in shapes such as rectangles or polygons, and more. Napari provides layers that can be displayed on top of each other or side by side. Layers can also be controlled programmatically, which allows users to create workflows compatible with other scientific Python libraries to gain a rapid understanding of the performance of their algorithms, identifying strengths and pinpointing areas for improvement.

Sometimes, image analysis algorithms get you this far, but not quite far enough. In such cases, it’s useful to manually curate their output, and then continue with downstream steps of an analysis. Napari provides editing tools for its layer types, allowing one for example to add missing points to the output of a peak detection algorithm, remove incorrect ones, paint over incorrect parts of a segmentation, or draw polygons around missed objects of interest. The resulting data points are saved in standard Scientific Python data structures, such as NumPy or Zarr arrays.

This design makes it easy to seamlessly weave together image exploration, image computation, processing, and analysis, and data annotation, curation, and editing.

Napari also provides a plugin interface, allowing developers to extend napari’s capabilities, providing users with novel ways to interact with their data. Because napari provides both a library accessible within Python, IPython, and Jupyter, and a standalone executable script, we have even found that napari plugins can be an effective way to help collaborators run Python image analysis workflows without having to launch Python. Because most new algorithms are being developed in Python, it is straightforward to try out new algorithms and assess how they perform using napari or even write a plugin that allows others to easily try as well, even in case of the user not having coding experience.

Napari is still being improved. We are actively working on async slicing and rendering, multicanvas views, layer groups etc.. Developments are guided by the user community. We actively encourage contributions by organizing weekly community meetings, napari code cafés and paired coding sessions.

In this talk we will cover the key features of napari, including its layer-based approach to handling image data, interactive annotation and segmentation tools, and show real-time performance capabilities. Additionally, we will demonstrate how napari can be leveraged in various scientific workflows, highlighting use cases in biology, neuroscience, and medical imaging. Attendees will gain insights into how napari can enhance their data visualization tasks and streamline analysis pipelines.


Abstract as a tweet

View, annotate, and analyze multi-dimensional images in Python with napari

Category [Data Science and Visualization]

Data Visualization

Expected audience expertise: Domain

some

Expected audience expertise: Python

some

Project Homepage / Git

napari.org, github.com/napari/napari