Skip to content

szablowskilab/cellpose-counter

Repository files navigation

cellpose-counter

License BSD-3 PyPI Python Version napari hub

A Napari plugin for cell/nuclei counting from a region or interest using cellpose models.


Quick Start

Installation

Below is a minimally working example of setting up a new virtual environment and installing the counter module with uv on Unix based systems.

uv init
uv add "napari[all]" cellpose-counter
uv run napari -w cellpose-counter

For more options and details, please see the installation guide.

Usage

To open Napari with the cellpose counter loaded, run napari -w cellpose-counter.

A dock widget will be open on the right side of the Napari interface. There you can view options for restoring images (using the cellpose denoise module), and counting cells/nuclei in a region of interest (ROI).

A few important notes:

  1. Images in TIFF or CZI file formats may be used.
  2. Images must be grayscale or single channel. RGB images may be loaded, but should be split. You can do this by right clicking on the image and select split rgb or split stack.
  3. ROIs can be drawn using the shape layer tools. Only a single ROI can be drawn per shape layer (otherwise only the first draw ROI will be used).
  4. ROIs should be square or rectangular. You can draw ROIs as polygons or other shapes, but a bounding box will be made from these shapes anyway.
  5. For long running processes such as image restoration or counting, it may seem like Napari is not doing anything. Notifications are shown in the viewer to display import information and a small activity indicator can be seen in the bottom right hand corner. If this indicator is spinning, then work is being done even if it doesn't look like it.
  6. In case of a large number of uncounted nuclei, consider modifying the segmentation parameters, or use the Continue Counting option to re-run the segmentation on uncounted nuclei.

See the usage guide for more details.

Contributing

All contributions are welcome. Please submit an issue for feedback or bugs.

Citations

This plugin is built on top of the Cellpose segmentation and denoising models. If you use this plugin, please cite the following papers:

  1. Stringer, C., Wang, T., Michaelos, M., & Pachitariu, M. (2021). Cellpose: a generalist algorithm for cellular segmentation. Nature methods, 18(1), 100-106.
  2. Stringer, C. & Pachitariu, M. (2024). Cellpose3: one-click image restoration for improved segmentation. bioRxiv.

License

BSD-3

About

nuclei counter using cellpose segmentation models

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors