Napari Practical Tutorial

napari Practical Tutorial: 3DMicroscopic imagesBrowsing, layered annotation and physical coordinate grid

In microscopic imaging, medical imaging, and materials characterization, data often involves more than a single two-dimensional image. A set of experiments may contain dozens to hundreds of Z-stacks, multiple fluorescence channels, and even a time dimension. While a regular image viewer can open a TIFF file, it may not be convenient for switching slices, comparing channels, overlaying segmentation results, or examining positional relationships in three-dimensional space.

napari It is an open-source, Python-based tool for viewing and annotating multidimensional images, supporting 2D, 3D, and higher-dimensional image data. It organizes the original image, segmentation labels, points, geometric regions, and trajectories into different layers, allowing researchers to browse, overlay, and interactively examine them within a single view.

Released on October 30, 2026 Napali 0.10.0 A notable update is introduced: the 3D view can now display a coordinate grid with axes, scales, and units. Additionally, the version improves layer name display and multi-view cursor positioning. These changes make Napari a more suitable everyday visualization tool for users who need to examine the spatial relationships of 3D microscopic images. This article, based on version 0.10.0, demonstrates the basic methods for installation, data opening, 3D browsing, physical coordinate setting, and layer overlay.

Version Notes: This article is based on the official Napari 0.10.0 documentation available as of November 11, 2026. Napari uses an EffVer versioning strategy, and major version upgrades may involve significant changes in behavior or dependencies; if you are using an older project environment, you should check the corresponding version's Release Notes before upgrading.

Napari image processing

Two-dimensional, three-dimensional and multi-dimensional data

Napari's primary use isn't simply “opening images,” but rather viewing data with spatial or temporal dimensions. Common scenarios include:

  • Z-stack micrographs: The continuous slices acquired along the Z-axis can be browsed layer by layer, or switched to 3D display.
  • Multichannel fluorescence images: Different channels were treated as separate layers to examine signal distribution and spatial overlap.
  • Time series images: Switch frames in the time dimension to observe the dynamic changes of cells, particles, or other objects.
  • 3D medical imaging: Browse MRI, CT and other body data, and examine structures in different sections.
  • Segmentation and annotation results: The label map, points, ROI, or trajectory output by the algorithm are superimposed on the original image.

Napaari supports n-dimensional data layers, and its viewer can browse 2D or 3D slices. It is suitable for data inspection, annotation, and visualization, but it is not a complete image processing algorithm library; operations such as denoising, segmentation, registration, and quantitative analysis usually need to be completed in conjunction with scikit-image, SimpleITK, Cellpose, or a self-written Python workflow.

Napaari's layer system

A core design element of Napari is the Layers system. The official documentation lists seven main types of layers:

Layer typeMain usesCommon Scenarios
ImageDisplay grayscale images, color images, or multi-dimensional images.Original micrographs, MRI, CT, material images
LabelsDisplay integer labels or segmentation regionsCell nucleus segmentation, tissue region labeling
PointsDisplay point coordinatesCell center, granule location, characteristic points
ShapesDisplays geometric objects such as rectangles, polygons, and ellipses.ROI, measurement area, artificial contour
SurfaceDisplay 3D surface mesh3D surface segmentation and structural reconstruction
TracksDisplays the trajectory as it changes over time.Cell tracking, particle motion
VectorsDisplay vector fieldOptical flow, displacement field, directional data

Different layers can be overlaid, with individual controls over their visibility, transparency, color, and interactivity. For example, the Image layer retains the original intensity information, the Labels layer displays the segmentation results, and the Points layer marks manually identified cell centers. This preserves the original data while facilitating the review and analysis of the results.

Install Napari

Napari offers two common installation methods. Users who only want to open images with a mouse can install the standalone desktop application; users who want to read data from Python, run analysis code, or install more plugins are advised to install it in a standalone Python environment.

Method 1: Install a standalone desktop application

If you don't plan to write Python code for the time being, you can directly download the installation package for your operating system from the official installation page. Napari 0.10.0 provides installers for Windows, macOS Apple Silicon, macOS Intel, and Linux.

Basic steps:

  1. Open Napari Official installation page。
  2. Choose the Windows, macOS, or Linux installation package based on your system.
  3. After downloading, follow the system prompts to complete the installation.
  4. Launch napari from the Start menu or the Applications directory.
  5. After opening for the first time, you can... File → Open Sample → napari Load the built-in sample image.

The Windows installer is signed by NumFOCUS. If SmartScreen prompts you for a newly released version, first confirm that the installer package is indeed from the official Napari GitHub Release and verify the publisher information. Do not obtain the installer package from third-party download sites.

The standalone application is suitable for quick browsing and basic annotation. However, the official documentation also warns that some plugins may not work in the standalone application environment. If a specific microscope format reader or a custom Python workflow is required, it is recommended to use the Python package installation method.

Method 2: Install in the Python environment

The official documentation supports Python 3.11–3.14 and recommends installation in a clean virtual environment. The following example uses Python 3.12.

Using Conda:

conda create -n napari-env -c conda-forge python=3.12 napari pyqt6 scikit-image conda activate napari-env

Using pip virtual environment:

Windows PowerShell:

py -3.12 -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip python -m pip install "napari[all]" scikit-image

macOS / Linux:

python3.12 -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip python -m pip install "napari[all]" scikit-image

After installation, check the version and launch:

napari --version napari

napari[all] It will install the officially recommended default Qt backend and related optional dependencies. Napari 0.10.0 has removed Qt5 backend support, so PyQt5 can no longer be used; PyQt6 or PySide6 should be used instead. If your research group's Python environment already has software such as Spyder installed, there may be Qt dependency conflicts. It is recommended not to directly integrate Napari into the main environment used long-term, but rather to create a separate environment.

Open image

Using built-in sample data

For first-time users, it's not recommended to practice with very large experimental data. You can start by opening the examples that come with Napari:

  1. Start napari.
  2. Choose File → Open Sample → napari。
  3. Select from the list of examples Cells (3D+2Ch) Or other images.
  4. Waiting for the data to finish loading.

Cells (3D+2Ch) This is an example of a three-dimensional dual-channel fluorescence microscopy image, suitable for practicing Z-stack browsing, multi-channel display, and three-dimensional coordinate settings. The example data comes from the scikit-image image dataset; its two channels correspond to the cell membrane and cell nucleus, respectively.

Open your own image file

For common image formats such as TIFF, PNG, and JPG, you can open them in the following ways:

  • Use File → Open File Select a single file;
  • Use File → Open Folder Select the folder containing the image sequence;
  • Drag the file directly into the Napari canvas.

For proprietary formats used by microscope manufacturers, such as CZI, LIF, and ND2, a corresponding reader plugin is usually required. Don't assume Napari doesn't support this type of data just because the file extension isn't in the default open list; first check the Napari Hub for suitable reader plugins and confirm which Napari version the plugin supports.

Understanding the different areas of the interface

  • Canvas: Displays the currently selected image or 3D scene.
  • Layer List: Manage images, labels, points, and other overlay objects; you can adjust their order, visibility, and names.
  • Layer Controls: Displays settings such as contrast, color, transparency, and drawing tools based on the current layer type.
  • Dimension Sliders: Switch the Z, T or other dimensional positions for multidimensional data.
  • 2D / 3D display switching: Switch between slice browsing and 3D volume data viewing.

If you are opening 4D or 5D data, first confirm what each axis represents. A common axis order might be... T, C, Z, Y, XThis may also vary depending on the data source. You cannot determine which axis represents time and which represents a channel simply by looking at the number of array dimensions.

Load 3D cell images and display physical coordinate grids

One of the most noteworthy new features of Napari 0.10.0 is the 3D coordinate grid. In the past, when viewing 3D volumetric data, researchers typically relied on the coordinate information of the image itself or external rulers to determine location; now, a grid with scales and units can be displayed in the 3D scene, making spatial locations easier to identify.

Running the official example

Run the following script in the Napari Python environment:

import napari # Create a 3D viewer viewer = napari.Viewer(ndisplay=3) # Open the built-in 3D dual-channel cell image in napari layers = viewer.open_sample("napari", "cells3d") # The voxel spacing of this sample data is Z/Y/X = 0.29/0.26/0.26 µm for layer in layers: layer.scale = (0.29, 0.26, 0.26) layer.units = ("µm", "µm", "µm") layer.axis_labels = ("Z", "Y", "X") # Display the 3D coordinate grid viewer.scene.overlays.coordinate_grid.visible = True napari.run()

Once run, the viewer will open a 3D cell image and display the coordinate axes, scales, and units. You can rotate the viewpoint to observe the volume data from different directions.

Here scale`units` and axis_labels Not the same thing:

  • scale: The spacing between adjacent pixels or voxels on each array axis;
  • unitsThe physical unit used for spacing, such as µm, nm, or s;
  • axis_labelsThe axis itself represents something, such as Z, Y, X, or Time.

In the example cells3d The data comes from scikit-image, and its original array dimensions are... (z, c, y, x)The two channels represent the cell membrane and the cell nucleus, respectively; after downsampling of the example data, the voxel spacing is... (0.29, 0.26, 0.26) Micrometers. (In the example code) open_sample The two channels are opened as independent layers, so each layer uses a three-dimensional Z/Y/X spacing.

Important: Do not copy the physical spacing from the example. Actual experimental data should be read from microscope metadata, OME-TIFF metadata, or the voxel size in the experimental record, and then filled in according to the array axis order. scale 和 unitsIf reliable calibration information is unavailable, retain the pixel unit for now and avoid arbitrarily entering values just to display µm.

Setting coordinates for your 3D TIFF

If a three-dimensional array has already been read by another program volumeIt can be added directly as an image layer:

import napari import tifffile volume = tifffile.imread("sample_stack.tif") viewer = napari.Viewer(ndisplay=3) layer = viewer.add_image( volume, name="raw_volume", scale=(0.5, 0.2, 0.2), # Sample values, be sure to replace with the actual voxel spacing units=("µm", "µm", "µm"), axis_labels=("Z", "Y", "X"), ) viewer.scene.overlays.coordinate_grid.visible = True napari.run()

This code assumes that the TIFF file is read in three dimensions. (Z, Y, X) Array. (Example) scale These are placeholder values and cannot be directly used for actual quantitative analysis. If the data dimension is... (T, Z, Y, X) 或 (C, Z, Y, X)First, you need to clarify the meaning of the axis before deciding whether to split the channel, set the time unit, or create multiple layers.

Napari 3D rendering

Overlay segmentation results:

Match the original image with the label

In cell counting, tissue region analysis, or particle recognition, a common workflow is to first obtain the segmentation result using an algorithm, and then check whether the segmentation boundaries are consistent with the original image. Napali can place the original image and the label array in the same view.

Assuming you already have an array of integer labels with the same spatial dimensions as the original image. segmentationWhere 0 represents the background, and 1, 2, 3... represent different areas:

viewer.add_labels(segmentation, name="segmentation")

Labels The layer will display different integer labels in different colors. Label value 0 is transparent by default, so the underlying Image layer is still visible. You can toggle the display status of the label layer in the layer list, and you can also adjust its opacity to observe whether the segmentation boundary covers the correct structure.

If you want3D imagesThe coordinates of the points to be manually checked can be marked on the top; the Points layer can be used for this.

viewer.add_points( [[10, 80, 120], [25, 120, 180]], name="checked_centers", size=5, )

The coordinate order here matches the axis order of the image array. If the image is... (Z, Y, X)The point coordinates should also be in accordance with (z, y, x) Provide: Do not directly treat the order of the horizontal and vertical coordinates on the screen as the index of a three-dimensional array.

It's important to emphasize that while Napari's Labels layer is responsible for displaying and editing labels, it doesn't mean the software has automatically completed cell segmentation. The segmentation algorithm still needs to be generated by Cellpose, scikit-image, StarDist, or other tools. Napari is better suited as an interface for result checking and manual revision.

Processing larger images:

Do not load all data into memory at once.

When the data volume reaches tens of gigabytes, or when experiments use numerous TIFF files to save different time points, channels, and Z-stacks, directly reading all the data into a NumPy array can lead to memory pressure. Napaari supports working with tools like Dask to read data slices on demand.

For example, if a folder contains a set of TIFF slices with the same size and data type, you can use... dask-image Construct a lazy-read array:

python -m pip install dask[array] dask-image
import napari from dask_image.imread import imread # Read a set of TIFF files as needed stack = imread("experiment/*.tif") # Explicitly specify contrast_limits in big data scenarios to avoid automatic scanning of the entire data range viewer, layer = napari.imshow( stack, contrast_limits=[0, 2000], # Adjust according to the actual data intensity range multiscale=False, ) napari.run()

The advantage of this type of deferred reading is that when a user switches dimensions or browses a certain area, the program can read only the data blocks needed at that moment, instead of loading the entire dataset at startup. The example assumes that the TIFF files have a consistent shape and data type; if different files have inconsistent sizes, the data needs to be pre-processed or a custom read function needs to be written.

For large, multidimensional datasets requiring long-term storage and frequent random access, further exploration of Zarr, HDF5, and multi-scale pyramid formats is warranted. Each has its own applicable scenarios for block storage, parallel access, and remote retrieval, but compatibility with existing Fiji, Python, or other analysis software within the research group must also be considered.

Plugins and file formats:

How do I access proprietary microscope data?

Napari's built-in reader can handle common image formats such as TIFF, PNG, and JPG. For proprietary formats from microscope manufacturers, a reader plugin is usually required to extend reading capabilities. For common formats such as CZI, LIF, and ND2, you should first search for the corresponding plugins on the Napari Hub and check them.

  1. Is the plugin still under maintenance?
  2. The range of Napari versions supported by the plugin;
  3. Do we need to install Bio-Formats, Java, or other dependencies?
  4. Can it correctly read the channel name, pixel size, Z-interval, and time information?
  5. Does the reading result match the manufacturer's original software?

It is recommended to first verify the metadata and image hierarchy using a small sample file before importing the complete experimental data in batches. In particular, the channel order, physical size, and time interval should not be considered correctly just because the image can be opened.

Troubleshooting

An error occurred during startup, indicating that Qt could not be found.

Napari requires a Qt graphical interface backend. When installing using Python, it is preferable to run in a standalone environment:

python -m pip install "napari[all]"

If you have already selected PyQt6 or PySide6, please ensure it is compatible with your current Napari environment. Napari 0.10.0 no longer supports PyQt5/Qt5; do not continue to install older Qt5 bindings to resolve issues.

The terminal can be launched, but importing is not possible in the IDE.

This usually happens when the IDE and the terminal use different Python interpreters. Check the IDE project interpreter path to confirm it points to the installation directory of Napari. .venv Or the Conda environment, instead of the system Python.

The dimensions are incorrect after opening the image.

First, check the array shape and axis order. For example... (Z, C, Y, X) 与 (C, Z, Y, X) The meanings are different; if the channel axis is treated as the spatial axis, the slice slider and 3D display will not behave as expected. If necessary, check in Python first. array.shapeThen use slicing or transposition to organize the data.

The coordinate grid units or scale are incorrect.

examine scale`units` and axis_labels Does it correspond one-to-one with the data axes? Units only indicate physical dimensions and do not automatically calculate the actual size of each voxel. When reliable metadata is lacking, retaining pixel units is safer than using a fictitious µm scale.

Opening large images is very slow or uses too much memory.

First, validate the process using a smaller ROI or downsampled data; check if automatic intensity range calculation for the entire dataset is triggered; for large sequences, consider using Dask delayed reads or Zarr/HDF5 block data. Do not mistake “can be opened” for “suitable for loading all data at once”.

CZI, LIF, or ND2 files cannot be recognized.

Check if the corresponding reader plugin is installed and verify its compatibility with the current Napari version. Proprietary formats may contain vendor-specific metadata; if necessary, convert them to OME-TIFF using vendor software or Bio-Formats, and then verify the channel and pixel dimensions against the original file.

How do Napari and other research software divide their roles?

Napari is better suited for browsing, overlaying, and interactive annotation of multi-dimensional images; Fiji/ImageJ has a mature ecosystem of image processing macros and plugins; Python's scikit-image, SimpleITK, and Dask are suitable for building repeatable data processing workflows; QuPath is more geared towards digital pathology image analysis. These are not simple substitutes but can be used in combination according to workflow stages.

For example, a microscopic imaging workflow could be:

  1. Export the raw data using microscope software or Bio-Formats;
  2. Use Python or Fiji to perform preprocessing, registration, or segmentation;
  3. The original image and analysis results are overlaid in Napari to check spatial correspondences and perform manual annotation;
  4. The confirmed labels and measurement results are then passed to the subsequent Python/R statistical workflow.
  5. Complete the final layout of the figures in professional drawing software according to the requirements of the journal or report.

The advantage of doing this is that it separates “data processing”, “interactive inspection” and “final mapping”, reducing the pressure of completing all tasks in a single software.

Conclusion

If you frequently work with Z-stacks, multichannel fluorescence images, time series, or 3D medical images, Napari is a valuable tool to use as a foundational tool in your research image workflow. Its layer system allows for comparison of raw images, segmentation labels, and manual annotations in the same coordinate space; the new 3D coordinate grid in version 0.10.0 makes axes, scales, and physical units more intuitive.

When starting out, it is recommended to use the built-in one first. Cells (3D+2Ch) Practice slice browsing and 3D display using examples, then open your own TIFF data. After becoming familiar with layers, axis order, and physical calibration, you can then connect to reader plugins, Dask, or Zarr to handle more complex datasets.

One thing to remember is:For a visualization interface to display accurately, the dimensions, voxel spacing, and units of the input data must be accurate. For scientific images, coordinate calibration and metadata inspection are just as important as the images themselves.

References

  1. Napari official website
  2. napari 0.10.0 Release Notes (2026-10-30)
  3. Napari Installation Guide
  4. Open the image in Napari
  5. Napari Layer Description
  6. Scale and unit-aware rendering
  7. Using Dask and napari to process & view large datasets
  8. scikit-image: 3D data examples and cell3d data descriptions
  9. Napari official usage and download statistics panel

This article is based on the official documentation of Napari and Scikit-image. Installation dependencies, plugin compatibility, and interface layout may vary between different versions; please check the official documentation for your specific version before use. For images used for quantitative analysis, the original data must be preserved, and the pixel spacing, channel order, and time information must be verified.