A Napari plugin for cell/nuclei counting from a region or interest using cellpose models.
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-counterFor more options and details, please see the installation guide.
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:
- Images in TIFF or CZI file formats may be used.
- 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 rgborsplit stack. - 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).
- 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.
- 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.
- In case of a large number of uncounted nuclei, consider modifying the
segmentation parameters, or use the
Continue Countingoption to re-run the segmentation on uncounted nuclei.
See the usage guide for more details.
All contributions are welcome. Please submit an issue for feedback or bugs.
This plugin is built on top of the Cellpose segmentation and denoising models. If you use this plugin, please cite the following papers:
- Stringer, C., Wang, T., Michaelos, M., & Pachitariu, M. (2021). Cellpose: a generalist algorithm for cellular segmentation. Nature methods, 18(1), 100-106.
- Stringer, C. & Pachitariu, M. (2024). Cellpose3: one-click image restoration for improved segmentation. bioRxiv.