Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1. Welcome and GUI Walkthrough

Goal: Set up your environment, get an overview of the workshop, and learn your way around the napari viewer — from the GUI essentials to running example scripts.

Welcome (10 min)

Workshop Overview (5 min)

This workshop has four blocks:

BlockTopic
1Welcome and GUI Walkthrough — get oriented in the napari viewer
2Python, Data, and Metadata — control napari from Python, set physical scales, work with xarray and Zarr
3Custom Widgets and Interactions — build interactive GUIs with magicgui, keybindings, and mouse callbacks
4From Script to Plugin — package your custom tools as pip-installable napari plugins

The workshop blurb says it best:

About napari (3 min)

napari is a free, open-source, multi-dimensional image viewer for Python. It is:

What Are Images? (3 min)

A quick conceptual grounding before we open our first image:

Open Your First Image (5 min)

Let’s get the viewer up and running with a sample dataset:

pixi run -e extend napari
  1. In napari, select: File > Open Sample > napari builtins > Cells (3D + 2Ch)

  2. Two layers appear in the layer list: membrane and nuclei

  3. Use the dimension slider at the bottom to scroll through z-slices

  4. Toggle each layer on/off with the eye icon next to its name

Loading...

What you’re looking at: Confocal microscopy images of cells in 3D. The nuclei channel (channel 1) shows cell nuclei stained with a dye. The membrane channel (channel 0) shows cell membranes.

Screenshots

Save what you see in napari at any time:

Keyboard shortcut: Alt+S (saves to file) or Alt+C (copies to clipboard). Add Shift to include the viewer UI: Alt+Shift+S or Alt+Shift+C.

GUI Essentials Walkthrough (15 min)

Follow along as we walk through the major parts of the napari interface.

The Viewer Layout

AreaPurpose
Canvas (center)Where your image is displayed
Dimension sliders (bottom)Scrub through z, t, or other axes beyond 2D
Viewer buttons (bottom-left)2D/3D toggle, home, grid, axes, scale bar
Layer list (left)All open layers; click to select, eye to toggle visibility
Layer controls (top-left)Adjust appearance of the selected layer

Key Interactions

Dimension Sliders

When a layer has more dimensions than the two displayed on the canvas, sliders appear at the bottom. Drag a slider to move through z-slices, time points, or channels.

Loading...

You can rename the slider labels! Right-click the roll dimensions button (bottom-left) and double-click an axis label to edit it.

Dims ordering

2D ↔ 3D Toggle

Click the 2D/3D button in the viewer button row to switch rendering modes. In 3D mode, click-drag to rotate the volume. Give it a try!

viewer buttons
Loading...

Overlays

napari can display helpful overlays on the canvas. Here are the most useful ones:

Layer Controls

With a layer selected in the layer list, the layer controls panel (top-left) lets you change how that layer appears. The most important controls:

Loading...

Try adjusting these controls yourself — change the colormap of nuclei, lower the opacity of membrane, or switch the blending mode to additive. The changes are immediate, which makes exploring your data fast and intuitive.

Console Peek

napari has a built-in Python console — open it from Window > Console or click the leftmost viewer button. It lets you interact with the viewer programmatically while you explore:

# Type this in the console and press Enter:
viewer.layers['nuclei'].colormap = 'viridis'

The console gives you access to the full napari Python API without leaving the GUI. It’s the bridge between point-and-click exploration and scripted analysis.

Opening Files from the Command Line

napari can also run Python scripts — it reads them and executes them in the viewer. This is a great way to explore the napari gallery examples:

pixi run -e extend napari demos/everything.py

Drag-and-drop works too: download any .py file from the napari gallery and drop it onto the napari canvas. napari runs it automatically.

Speaking of which…

  1. Displaying Xarray data in napari

  2. Interactive Control Over Parallel Computations

  3. Set Multiscale Resolution Level

  4. Surface with texture and vertex colors

  5. 3D Vector field and image across time

  6. Heart with multiple annotations

  7. Tracks 3D

  8. Surface with multiple textures

Sharing Time (3 min)

In Block 2, we’ll switch from clicking to coding — controlling napari entirely from Python, loading our own data, and setting physical scales for real-world measurements.