23 Oct 2025

CellPose Segmentation

Use pre-trained CellPose models for prediction of instance-level segmentation and labeling in both 2D and 3D data, applicable to a variety of generalized objects.

CellPoseAvizoImage-2

Functionality:

This module take a 2D image or 3D volume containing objects and creates a label image, where each detected object is segmented and assigned a different number label.

Cellpose Segmentation includes several pretrained models that use different architectures and were trained using different sets of data depending on the original intended use case.

The current version of the module has only been implemented for single-channel/greyscale images.
For models that utilize multiple channels, the input image is duplicated into the 3rd dimension to artificially simulate a multi-channel input.



Parameters:

Slices/Volume:

When given a stack of data with a z-dimension greater than 1, the data can either be interpreted as a list of individual slices or a single volume with object continuity through z.
Selecting "Slices" will predict each slice individually with independent labeling.
Selecting "Volume" will conduct prediction in 3D and return 3D object labeling.

Model:

This selects the pretrained model and architecture to use for prediction.
CPSam is the newest model built on the Segment Anything backbone.
cyto3 is the second newest model that was trained with a large variety of datasets
The rest of the models were trained on specific datasets but have still proven to be generalizable
More information regarding the models can be found in the CellPose official documentation for Cellpose3 and CellposeSAM

Diameter:

The model was trained to detect objects of a specific size, so it uses your input size to try and adapt the image to better match what it expects.

Flow Threshold:

CellPose calculates the shapes of objects using the “flows” of the shape. The Flow Threshold parameter is the maximum allowed error of the flows for each mask.
Increase this threshold if cellpose is not returning as many ROIs as you’d expect. Similarly, decrease this threshold if cellpose is returning too many ill-shaped ROIs.
One possible workflow is to set this value to 1 to get as many detections as possible, and see if it is even working with the current parameterization, then you can lower the threshold to remove out any errors.

CellProb Treshold:

For each pixel, the model predicts a probability that it belongs to an object (not background) which ranges from -6 to 6. Anything above the threshold will be considered positive.
Decrease this threshold if CellPose is not returning as many ROIs as you’d expect. Similarly, increase this threshold if cellpose is returning too ROIs particularly from dim areas.

Min Size:

This is the minimum area (in square pixels) for an object. Objects below this size will be removed from the final prediction.

Max Size Fraction:

This is the maximum object size as a ratio of the full image size. So the default 0.4 means that any object larger than 40% of the image will be removed from the final prediction.

Example Applications:

Although CellPose was initially developed for and is a gold standard for cell and nuclei segmentation, it has proven to be a powerful model for general segmentation.
It is still recommended for objects that have a vaguely "cellular" appearance with distinct edges for better results.

Example Usage on Plated Cells

Example Usage on Battery Particles


Example Usage on 3D NAND

Declarations:

This is an experimental module from the Xtra Library: https://xtras.amira-avizo.com.

This is a module that adapts the work of Cellpose3 and CellposeSAM prediction models for use in Avizo/Amira tools.

More detailed information regarding the method development and validation can be found in the publications for Cellpose3 and CellposeSAM.

Usage of CellPose code is covered under the BSD-3-Clause license:

Copyright © 2020 Howard Hughes Medical Institute
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of HHMI nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.