Summary and Schedule
This lesson provides a brief overview of Napari, a flexible, extendable software platform for visualising many different types of bioscience and medical imaging data. This session in particular is aimed at all researchers who are interested in working with light microscopy imaging data and how AI could help in such tasks like cell segmentation/tracking.
Prerequisites
Some prior experience with acquiring/working with light microscopy data would be useful, but isn’t necessary. This course is aimed at anyone who is looking to work with light microscopy imaging data in their research projects.
No python experience is necessary or assumed, but you will get more out of the course if you know some basics e.g. from the online Software Carpentry python course.
Please bring a laptop (Windows, Mac or Linux) to the lesson. Before the start of the course, please follow the setup instructions so that your laptop is ready to run the material in the lessons.
| Setup Instructions | Download files required for the lesson | |
| Duration: 00h 00m | 1. Imaging Software for microscopy | What are the different software options for viewing microscopy images? |
| Duration: 00h 10m | 2. Getting Started With Napari |
How can Napari be used to view images? How can I interact Napari through the console or via Jupyter Lab? |
| Duration: 00h 20m | 3. What is an image? | How are images represented in the computer? |
| Duration: 00h 35m | 4. Using Napari through Jupyter |
How can you interact with Napari in a notebook? How are images represented in the computer? What are the main structures that Napari uses to represent imaging data? How can we get basic measurements out from this |
| Duration: 00h 45m | 5. Image Segmentation: Basic Concepts |
How do we perform instance segmentation in Napari? How do we measure cell size with Napari? |
| Duration: 01h 05m | 6. Segment Anything for Microscopy (μSAM) |
What is μSAM and how does it differ from classical
image‑processing? When do traditional image analysis methods fail, and how can AI models help in those cases? |
| Duration: 01h 55m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
Data Sets
No datasets will be required to download for this taster session. All images will be pre-loaded examples that are already part of Napari. Provided Napari software is loaded correctly, you are all set!
Software Setup
Opening a Terminal
You will need a terminal to run some of the setup instructions and commands for this workshop:
- Windows: Open PowerShell
- macOS: Launchpad > Other Application > Terminal
- Linux: Open a terminal window
Install uv
uv is a Python package manager and environment tool. Use
the uv
installation guide to install uv if it is not already
installed.
Ensure no environment is active before you start
If any environment auto‑activates when you open PowerShell (Windows)
or a terminal (MacOS / Linux), deactivate it. Otherwise uv
may not behave correctly.
See the official documentation of your package manager (e.g. conda) for details.
For conda, the relevant section is Deactivating an environment
Create an environment with the required Python packages
Run the commands below in PowerShell. Lines starting with # are comments and will not be run.
BASH
# Create a project folder (e.g. napari-ai-workshop) and move into it
mkdir napari-ai-workshop
cd napari-ai-workshop
# Update uv
uv self update
# Create a virtual environment
uv venv
# Activate the environment
.venv\Scripts\activate
# Install required Python packages
uv pip install micro-sam napari-matplotlib napari-skimage-regionprops jupyterlab ipywidgets git+https://github.com/ChaoningZhang/MobileSAM.git
Run the commands below in the terminal. Lines starting with
# are comments that will not be run.
You can run the commands by copy pasting them into the terminal and pressing the Enter key.
BASH
# Create a project folder (e.g. napari-ai-workshop) and move into it
mkdir napari-ai-workshop
cd napari-ai-workshop
# Update uv
uv self update
# Create a virtual environment
uv venv
# Activate the environment
source .venv/bin/activate
# Install required Python packages
uv pip install micro-sam napari-matplotlib napari-skimage-regionprops jupyterlab ipywidgets git+https://github.com/ChaoningZhang/MobileSAM.git
Run the commands below in the terminal. Lines starting with # are comments and will not be executed.
BASH
# Create a project folder (e.g. napari-ai-workshop) and move into it
mkdir napari-ai-workshop
cd napari-ai-workshop
# Update uv
uv self update
# Create a virtual environment
uv venv
# Activate the environment
source .venv/bin/activate
# Install required Python packages
uv pip install micro-sam napari-matplotlib napari-skimage-regionprops jupyterlab ipywidgets git+https://github.com/ChaoningZhang/MobileSAM.git
Testing the installation
After installing the packages and activating your
napari-ai-workshop environment, you should be able to
launch napari and JupyterLab.
To test whether napari opens, run:
An empty image viewer window titled napari should
appear. This can take a few moments, especially the first time.
To check that JupyterLab launches correctly, run:
Your default web browser should open JupyterLab. It may open in a new tab or a new window, depending on your browser settings.
We are providing an optional environment for people who want to explore other napari plugins outside of this workshop. You do not need to create this environment for the workshop, and none of the course materials or website use this environment.
The reason: installing micro_sam plugin may disable the
ability to search for plugins using the napari GUI. So if you want to
explore other plugins, it is be best to do so in a separate environment
without micro_sam.
To create a seperate environment, navigate outside of the
napari-ai-workshop folder. You can do this by moving up one
directory.
Next, follow the instructions below.