Skip to main content

A Napari plugin to detect and count nuclei on phase contrast images

Project description

NuclePhaser: Cell Proliferation Measurement & Cell Tracking Assistant Plugin for Timelapse Images

License MIT PyPI Python Version tests napari hub npe2 Copier

A Napari plugin for automated cell nuclei detection, proliferation and population growth analysis, and single-cell tracking in brightfield and fluorescent nuclei timelapse microscopy images.

napari-nuclephaser is an open-source Napari plugin designed for scientists who need to measure cell proliferation rates, analyze population growth, and perform individual cell tracking on timelapse microscopy images. It utilizes Ultralytics YOLO object detection models and obss/sahi sliced inference methods to detect cell nuclei on brightfield and fluorescent images of any size, including large whole slide ones. Learn more with documentation and paper.

Nuclei detection

We trained a series of YOLOv5 and YOLOv11 models to detect nuclei on phase contrast images. It can be used for counting cells or for individual cell tracking (using nuclei detections as tracking markers). Prominent features of this approach are:

  • Napari-nuclephaser plugin includes obss/sahi functionality, allowing detection on images of arbitrary sizes.

Image didn't load

  • YOLO models are fast, providing reasonable inference speed even with CPU.
  • Ability to predict and automatically count nuclei on stacks of images, making it convenient for cell population growth studies and individual cell tracking.
Image didn't load
  • Calibration algorithm that allows measuring accuracy for each specific use case.

Calibration algorithm

Result of object detection model inference is highly dependent on confidence threshold parameter.

Image didn't load

We created several calibration (finding optimal confidence threshold) algorithms that allow adjusting models to specific use cases (cell types, magnifications, illumination settings, cameras etc.):

  • Calibration using known number of objects on an image. Doesn't produce accuracy metrics.
  • Calibration using fluorescent nuclei stain image (for example, DAPI image). Produces accuracy metrics.
  • Calibration using manual annotation of nuclei. Produces accuracy metrics.

Apart from optimal confidence threshold search, these algorithms return accuracy metrics for specific use cases. Given that the calibration image is large, only part of it is used for search of threshold, while the second part is used for evaluation model's accuracy. Accuracy metrics are Mean Absolute Percentage Error (MAPE) and prediction-ground truth scatterplot, which shows how well model performs with different densities of cells.

Learn more about calibration in documentation.

Image didn't load

Cell Proliferation Measurement & Population Growth Analysis

With NuclePhaser you can reconstruct population growth curves from timelapse images of growing cell population by counting number of nuclei on each image. Key features of this approach are:

  • No special equipment, reagents or dyes required, only regular culture plastic and cell growth medium, microscope with mechanical stage and a PC (even without GPU).
  • Accuracy measurement for each specific use case, so you will be sure the tool is working with appropriate precision.
  • Measuring the number of cells, not the area occupied by cells, which can be significantly influenced by spreading/narrowing of cells.
  • Complete reproducibility of results with metadata.txt files saved for each experiment.

Image didn't load

For more detailed information about how NuclePhaser can be used for cell proliferation measurement & population growth analysis, visit our documentation.

Individual cell tracking

NuclePhaser can be used as an assistant for individual cells tracking. This task is extremely difficult, and manual tracking is still the only method with 100% proof against false tracks. With NuclePhaser, you can significantly simplify manual tracking: instead of marking each cell on each image, you can predict nuclei location with NuclePhaser and then correct the result, which is much faster. Learn more in documentation.

Models

Currently only YOLOv5n, YOLOv5s, YOLOv11n and YOLOv11s models, as well as fluorescent nuclei detector YOLOv5n are downloaded automatically with pip install napari-nuclephaser. To use larger models, download them with these links:

Fluorescent nuclei detectors

Model Link
Fluorescence_v5n Donwload
Fluorescence_v5s Donwload
Fluorescence_v5m Donwload
Fluorescence_v5l Donwload
Fluorescence_v5x Donwload
Fluorescence_v11n Donwload
Fluorescence_v11s Donwload
Fluorescence_v11m Donwload
Fluorescence_v11l Donwload
Fluorescence_v11x Donwload

Brighfield nuclei detectors

Model Link
Brightfield_v5n Donwload
Brightfield_v5s Donwload
Brightfield_v5m Donwload
Brightfield_v5l Donwload
Brightfield_v5x Donwload
Brightfield_v11n Donwload
Brightfield_v11s Donwload
Brightfield_v11m Donwload
Brightfield_v11l Donwload
Brightfield_v11x Donwload

[!NOTE] Feel free to use the models published here without the plugin!

Plugin functionality

napari-nuclephaser plugin offers following widgets:

  • Widget for inference on single image. Result can be in the form of points or boxes with or without confidence scores. Automatically returns number of cells in the name of result layer.
  • Widget for inference on stack of images. Optionally can create .csv or .xlsx file at given location with counting results.
  • Widget for calibration using known number of cells.
  • Widget for calibration using fluorescent nuclei image (fluorescent nuclei detection model is used as a perfect predictor).
  • Widget for calibration using manual annotations.
  • Widget for transforming Napari Points layer into Labels layer, which allows turning detection in tracking algorithms-digestible form (in particular, btrack).
  • Widget for counting number of points in Points layer.

Learn more about widgets and their functionality at documentation.

Citation

If you use NuclePhaser in your work, please cite our preprint:

@article {Voloshin2025.05.13.653705,
	author = {Voloshin, Nikita and Putlyaev, Egor and Chechekhina, Elizaveta and Usachev, Vladimir and Karagyaur, Maxim and Bozov, Kirill and Grigorieva, Olga and Tyurin-Kuzmin, Pyotr and Kulebyakin, Konstantin},
	title = {NuclePhaser: a YOLO-based framework for cell nuclei detection and counting in phase contrast images of arbitrary size with support of fast calibration and testing on specific use cases},
	year = {2025},
	doi = {10.1101/2025.05.13.653705},
	URL = {https://www.biorxiv.org/content/early/2025/05/16/2025.05.13.653705},
	eprint = {https://www.biorxiv.org/content/early/2025/05/16/2025.05.13.653705.full.pdf},
	journal = {bioRxiv}
}

Installation

For detailed installation instructions, visit our documentation.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "napari-nuclephaser" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

This napari plugin was generated with copier using the napari-plugin-template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napari_nuclephaser-0.2.2.tar.gz (42.5 MB view details)

Uploaded Source

Built Distribution

napari_nuclephaser-0.2.2-py3-none-any.whl (42.5 MB view details)

Uploaded Python 3

File details

Details for the file napari_nuclephaser-0.2.2.tar.gz.

File metadata

  • Download URL: napari_nuclephaser-0.2.2.tar.gz
  • Upload date:
  • Size: 42.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for napari_nuclephaser-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ca80b12d710bd9296f58286b0412a69a41c4e62faf930bef6460f7bc224b9f75
MD5 013ca7fe0d76051ab0428aa4ad44c2f2
BLAKE2b-256 fbf9a8a26b3c4ba182057cbf00a581c747b060c286345fbe88ac48966a974bc9

See more details on using hashes here.

File details

Details for the file napari_nuclephaser-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_nuclephaser-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c70b0793f8af50c77d4f814859c6aedb06f89963b9761a8d774d8d3fb7c17fd
MD5 abc9426dab9cf8141623acb83742d3fb
BLAKE2b-256 53b35948fdba9feb43d1ca4d8441d5cddc81ccabd174c7a0cd25d9cd83bea47b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page