Explore, annotate, and analyse multidimensional image data with napari
Part of the Scientific Python specialist track
napari is an n-dimensional image viewer for Python. If you’ve ever tried plt.imshow(arr)
and made Matplotlib unhappy because arr
has more than two dimensions, then napari might be for you! napari will gladly display higher-dimensional arrays by providing sliders to explore additional dimensions. But napari can also: overlay derived data, such as points, segmentations, polygons, surfaces, and more; and annotate and edit these data, using standard data structures like NumPy or Zarr arrays, allowing you to seamlessly weave exploration, computation, and annotation in image analysis.
See this talk and many more by getting your ticket to PyCon AU now!
I want a ticket!napari is an n-dimensional image viewer for Python. If you’ve ever tried plt.imshow(arr)
and made Matplotlib unhappy because arr
has more than two dimensions, then napari might be for you!
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 full data, rather than a few sampled slices.
Image analysis and visualisation 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, allowing users of Scientific Python to gain a rapid understanding of the algorithms they’re using — where they work well and where they might go wrong.
Sometimes, image analysis algorithms get you this far, but not quite far enough. In such cases, it’s useful to manually curate their output, 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 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 found that napari plugins can help collaborators run Python image analysis workflows without needing to launch Python.
In this talk, we'll introduce napari’s history, (live) demonstrate the features described above, and discuss current limitations and where we’re going.
I'm a research scientist helping other scientists get insights from their image data using Python. I've been using Python since 2008, and the main scientific Python ecosystem (NumPy, SciPy, & co) since 2010. In 2012, on a whim, I went to my first SciPy (US) conference, and it changed my life! I realised that "open source" didn't mean just posting the code online. It meant actively collaborating on code with other scientists, across vast distances and at different times. Before you could say "import numpy as np", I had joined the scikit-image team, written a paper about it, written a whole book on SciPy (!), spoken at various SciPys and PyConAUs, started new collaborative, open source libraries, and just generally been all-in on Scientific Python. I love this community and what it has done for me, and always try to pay it forward for new folks in our community! 😊
I'm currently a PhD student working on timelapse microscopy data analysis, and I've been learning and working with Python for almost a decade now! I love the open-source community and everything it has to offer the world, and I've been lucky enough to make my own contributions to the community as a core developer for napari - an n-dimensional image viewer written entirely in Python. I'm passionate about making coding more accessible for scientists who want to make their own lives easier, and I love teaching everything from the fundamentals to the nitty gritty.