Bioimage Analysis with Napari
Current announcements
Nothing at the moment.
Course requirements
- Please, bring a laptop.
- Please, install conda/miniforge and Napari before the course starts. Follow the steps described in this installation guide.
- Please, download the course material, the links are provided in the installation guide.
- You can also bring your own images you have taken in the lab.
Syllabus
Tutorial 1: Napari installation guide
Tutorial 2: Basic handling of Napari
Tutorial 3: Reslicing stacks in Napari
Tutorial 4: Cropping images in Napari
Tutorial 5: Scale bars and adjusting image scaling
Tutorial 6: The Napari Assistant
Tutorial 7: Image denoising and background subtraction in Napari
Tutorial 8: Bleach correction in Napari
Tutorial 9: Spectral unmixing in Napari
Tutorial 10: Image registration in Napari
Tutorial 11: Image segmentation and feature extraction
Tutorial 12: Advanced cell segmentation with Cellpose
Tutorial 13: Advanced cell segmentation with StarDist
Tutorial 14: Changing labels in Napari
Tutorial 15: Colocalizing cells
Tutorial 16: Tracking cell migration
Tutorial 17: Filament tracing
Tutorial 18: Data exploration, dimensionality reduction and clustering with Napari
Acknowledgements
Image credits
Exercises
Unless otherwise stated, please perform the examples shown in each tutorial. Use the image file(s) shown in the example or any other file provided in the GitHub data folder. You can also use your own images taken in the lab or an appropriate sample image from the Cell Image Libraryꜛ. Also try to combine the techniques you have already learned in the previous tutorials (if appropriate). Each tutorial including reading time and exercise takes around 15-30 minutes.
Learning outcomes
Upon successful completion, students will be able to:
- Install and configure Napari and relevant Python environments
- Set up a reproducible Python environment using conda/mamba and install Napari along with essential plugins for bioimage analysis, accounting for platform-specific issues and troubleshooting installation errors.
- Understand the principles and graphical user interface (GUI) of Napari
- Describe the purpose and capabilities of Napari as a multi-dimensional image viewer for bioimage analysis.
- Navigate the Napari GUI, including the main window, layer list, layer controls, and use of widgets.
- Load, organize, and manage bioimaging data
- Import various image formats (e.g., TIFF, OME-TIFF, CZI, JPG, PNG) and understand file format extensions via plugins.
- Organize and manipulate multiple image layers, including merging, splitting, projecting, and re-slicing stacks.
- Perform essential image processing and annotation tasks
- Apply basic visualization controls (colormap, opacity, blending, contrast, interpolation) to enhance image inspection.
- Annotate images with points, shapes, and label layers for manual marking and quantification of regions of interest.
- Execute key bioimage preprocessing operations using Napari plugins
- Crop images using the Napari Crop plugin, including defining regions of interest with shape layers and saving results.
- Add, adjust, and export scale bars as overlays, and perform manual or plugin-based measurements (including correcting axis scaling).
- Apply image denoising (e.g., spatial filters: mean, median, Gaussian) and background subtraction techniques using plugins, and understand their mathematical principles and application contexts.
- Apply domain-specific corrections and processing
- Correct for photo-bleaching in time-lapse fluorescence data using appropriate Napari plugins (e.g., histogram matching, exponential curve fitting, ratio method), and evaluate which method is most suitable for a given dataset.
- Perform spectral unmixing to reduce fluorescence bleed-through (crosstalk) in multi-channel images using the PICASSO plugin, understanding both the rationale and practical workflow.
- Register image stacks to correct for sample drift, motion, or instrument artifacts using automated (pyStackReg) or manual (Assistant) workflows, and understand the types of spatial transformations involved (translation, rotation, scaling, affine, projective).
- Automate and streamline analysis using the Napari Assistant
- Use the Napari Assistant plugin to design and execute multi-step image processing workflows, including chaining tasks, saving/loading workflows, and exporting as scripts or notebooks for reproducibility.
- Critically evaluate and troubleshoot bioimage analysis workflows
- Understand the implications of non-destructive processing in Napari (layer-based workflow).
- Save, document, and reproduce analysis steps, including handling and exporting annotated and processed image data.
- Apply and compare multiple approaches for image segmentation
- Understand and execute global thresholding and binarization methods (e.g., Otsu, Triangle, Li, Mean, Minimum, Isodata, Yen) for segmenting cells or structures in 2D and 3D bioimages.
- Perform post-processing (e.g., hole filling, connected component labeling, watershed) and extract quantitative features from segmented objects, saving results for further analysis.
- Utilize deep-learning-based segmentation tools in Napari
- Employ Cellpose for pixel-wise semantic segmentation of cells and nuclei in 2D/3D images, adjust relevant model parameters, and extract object-wise quantitative properties.
- Apply StarDist for precise segmentation of nuclei and fine cell structures, particularly in crowded or overlapping samples, and critically compare performance with Cellpose and traditional thresholding methods.
- Manipulate and correct segmented label data
- Select, modify, and reassign labels within segmented images using Napari’s tools (e.g., paint bucket, color picker), and systematically merge, split, or correct regions in 2D and 3D datasets.
- Inspect, verify, and document assigned labels through the Napari console and feature tables.
- Perform and interpret colocalization analyses
- Conceptually understand the principles of cell/molecule colocalization in microscopy images.
- Use segmentation outputs and Napari Assistant operations to quantify and visualize spatial overlap (colocalization) between different structures or signals, and extract results for further quantification.
- Track cell migration in time-lapse microscopy data
- Prepare image and segmentation data for tracking in Napari, including format conversion and segmentation using prior methods.
- Use the LapTrack plugin for centroid-based tracking of labeled objects (cells, particles) in 2D+t or 3D+t, interpret resulting tracks and ID mappings, and export quantitative tracking tables for downstream analysis.
- Trace filamentous structures in 2D and 3D
- Apply and distinguish between semi-automated approaches for filament tracing in Napari, using the dedicated plugins for 2D and 3D data (e.g., manual annotation, spline fitting, length measurement, exporting annotations for analysis).
- Understand the typical targets for filament tracing (e.g., neurons, blood vessels, cytoskeletal elements) and the limitations of current tools.
- Perform exploratory data analysis, dimensionality reduction, and clustering within Napari
- Visualize and explore extracted quantitative features from segmentation and tracking using parametric maps and interactive scatter plots.
- Apply dimensionality reduction techniques (e.g., PCA) and clustering algorithms (e.g., k-means) to identify patterns, classes, or subpopulations within cell feature data directly inside Napari.
- Interpret and export analysis results for further study or hypothesis generation.
Past courses
- Neuronal Circuit Dysfunction of CNS diseases (WPM31), July 8, 2025
- Neuronal Circuit Dysfunction of CNS diseases (WPM31), June 24, 2024
- Neuronal Circuit Dysfunction of CNS diseases (WPM31), June 30 and July 5 and 6, 2023
This course material is under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License (CC BY-NC-SA 4.0).
comments