Samples of images segmented by Cellpose Cellpose-napari + FIJI#

By Frederic Bonnet 🔬

Learning Objectives#

In this lesson, you’ll learn how to use the Cellpose napari plugin in conjunction with FIJI to complete a segmentation workflow.

  1. Loading an image correctly in Cellpose-napari

  2. Understanding and adjusting parameters in Cellpose

  3. Segmenting and exporting your image’s mask in FIJI

  • Time to learn: 1 hour

Prerequisites#

Napari version and plugins

Importance

Notes

napari v 0.4.17

Mandatory

In the napari viewer, verify your version of napari by clicking on the Help menu, then napari info.

cellpose v 0.1.5

Mandatory

Install this plugin from within the napari viewer, by going to the Plugin menu, then clicking on Install/uninstall plugins. Search for Cellpose-napari and click install.

FIJI

Mandatory

Bio Formats for Image J/FIJI

Mandatory

Allows us to open our image’s mask in FIJI.

Image inputs

tiffs, JPEGs or PNGs

Mandatory

Any of these three file types will be supported

Single plane images

Optional

Channels can be read as: (nY x nX x) or (x nY x nX)

Multiplane images

Optional

Required image shape: (nZ x nY x nX)

Multichannel images, like multi-Z tiffs

Optional

The expected format: (nZ x nC x nY x nX)

Sample data

2D data used in lesson

Optional

Because this is 2D data, only 2D segmentation may be applied to it.

What does this plugin do?#

Cellpose-napari utilizes a generalist algorithm for cell and nucleus segmentation. It allows you to perform segmentation workflows on cell bodies, membranes and nuclei in images. It also has deep-learning built-in, allowing it to segment many types of cells without requiring parameter adjustments, new training data, or further model retraining. Because of its versatility, it supports a wide variety of microscopy modalities and fluorescent markers.

Demo of Cellpose-napari#

Here are a few recommendations before you watch the video:

  • Use full screen view

  • Slow the video down by clicking the gear wheel or cog wheel in the lower right corner of the video. Click speed and select a slower speed.

  • Review the parameter setting explanations here. In the video the following parameters and features are used:

    • In napari:

      • contrast limits

      • loading a plugin

    • In the cellpose-napari plugin:

      • model type

      • channel to segment

      • diameter

      • computer diameter from image

      • average 4 nets

      • resample dynamics

      • clear previous results

      • output flows and cellprob

      • output outlines

      • run segmentation

      • cellprob threshold

      • recompute last masks with new cellprob + model match

      Hint

      When any of the buttons are clicked, it may take a few seconds for napari to respond with the new information. Please be patient.


The above video demonstrates how to open the Cellpose-napari plugin, segment your image, and adjust its parameters. If you would like a more detailed explanation of each parameter, proceed to the next part of this lesson.

Note

Because napari can’t export an image’s mask at this time, we must use FIJI for this. The final part of this lesson covers segmenting your image with cellpose-napari, then using FIJI to export and analyze your image’s mask.

Supporting materials#