How do I edit this website?

Cellpose-Appose

This plugin install and run cellpose on an image (2D/3D/multi-colors/time) in Fiji. Two version of cellpose are available:

This plugin is based on Appose, that automatically install python environment and allows python script execution with shared objects with Fiji.

Installation

You can install the plugin for the unliste update site Appose-Playground:

  • In Fiji, go to Help>Update...
  • Select Manage Update Sites in the window that opens.
  • Click Add unliste update site, name it Appose-Playground and write its address https://sites.imagej.net/Appose-Playground.
  • Select the Appose-Cellpose .jar file to install only this plugin, or keep all proposed plugins.
  • Press Apply changes and restart Fiji when it’s done.

You should have a recent version of Fiji, based on Java 21 or more. Download a new version if you’re current installation is too old.

Usage

The plugin handles images or movies that are 2D or 3D, that contains or not multiple channels. It can also have a temporal dimension. First open an image and then run the plugin. If you have several images opened when you launch the plgin, it will run on the active one.

From Fiji:

  • Open the image that you want to process.
  • Launch one of the cellpose version available in the plugin:
    • Plugins>Segmentation>Cellpose-Appose>Cellpose... This option allows to run CellPose v3. The full official Cellpose 3 documentation is available here.
    • Plugins>Segmentation>Cellpose-Appose>Cellpose-SAM... This option allows to run CellPose v4 with SAM. The full official Cellpose 4 documentation is available here.
  • Configure your Cellpose run through the Graphic Interface. see here for documentation
  • Press “Ok” and Enjoy!

The first time you run each option of this plugin, a python environment with the requested Cellpose version will be automatically installed in your home .local\shared\appose directory, which will take some time. The next time you use the same option, the environment will be directly activated from the plugin when needed so it will be much faster.

Cellpose-SAM relies on a much bigger neural network than Cellpose3. Thus computation with this version takes longer and it is advised to have a GPU available.

Parameters

After you selected a version of Cellpose, a graphical interface will pop-up to let you choose the parameters to run cellpose. See the Cellpose documentation for full description of the parameters.

Cellpose parameters

  • Cellpose model (Cellpose v3 only): Select a pretrained model from Cellpose website. These models have been trained on dataset with specific biological objects, as for example nuclei for nuclei model. Select the model that corresponds the best to your data.

  • Path to custom model: if you have fine-tuned or trained your own cellpose model, write here the full path to the directory containing the model files.

  • Diameter: The prediction is sensitive to the size of the objects to detect, so you need to indicate the average diameter of the objects (cell or nuclei), in pixels. This parameter strongly affects the segmentation results for Cellpose v3, while Cellpose-SAM can handle a much bigger range of object sizes. Cellpose will resize your image(s) to have an average object size compatible to the one of the training data (30 pixels for most models), and resize back the results to your initial image size. Default value is 30 pixel.

  • Channel selection: Choose the color channel on the image to do the segmentation on (that contain the staining of your objects). The number of the channel to select are the same one as in the Fiji interface, starting at one for the first channel.
    • For Cellpose 3: you can select one or two channels, one for the main object to segment (Cytoplasmic channel) and an optional one for the nuclei staining (Nuclei chanel). When you have both stainings, selecting also the nuclei channel can help the segmentation of the contour of the cell by giving more information.
    • For Cellpose-SAM: Cellpose-SAM can use information from up to 3 channels to segment the objects. So select the number of channels that are relevant to segment your objects of interest.
  • Minimum Object Size: At the end of the segmentation process, objects that are smaller in size (total area in pixel) from this parameter will be removed. This allows to get rid off small errors segmentation of only a few pixel. Default value is 15 pixels^2.

  • Normalize Channel Intensity: whether to use Cellpose’s normalization or not. The normalization allows to put the images in the same range of pixel values than the one used for training to get better results. This is recommended, except if you perform your own normalization before. Default to True (checked).

  • Resample Segmentation: This allows to have more accurate boundaries when your object size is bigger than the model’s size (usual 30 pixels, see diameter parameter), but will be slower to compute. Indeed, when this option is selected the “dynamics”, i.e. the post-processing specific from cellpose to reconstruct the cells from the network’s output, will be run at your original image size (at full resolution then). If it’s not checked, these “dynamics” will be run on the resized image, which will be smaller if your diameter parameter is bigger than 30 pixels. Default value to True (checked).

  • return ROIs (only for 2D or 2D+time images): the default output (segmentation) that you get is a label image: each object is assigned a unique identity (label), displayed in different color. If you check this option, you will also have a Region Of Interest for each object, added to the ROIManager. Unselected by default

Advanced options parameters

  • Cell probability threshold: Cellpose runs a neural network to predict the probability of a pixel to be part of an object and the direction from this pixel to the center of this object (the flows). This threshold allows to tune which pixels to keep in the final segmentation: increasing the threshold will reduce the size of detected objects, keeping only most probable pixels, while decreasing it allows to find larger and more objects. This parameter range from -6 to 6 and is 0 by default.

3D Options