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.

WARNING!!! Further description isn't displayed correctly at Napari Hub. For correctly displayed description, visit our GITHUB PAGE.

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.

NEW! If default NuclePhaser models aren't accurate enough on your specific use case, you can finetune them for free with cloud GPU using Google Colab NuclePhaser finetuning notebook. It is specifically designed for users without coding experience.

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.

NEW! If default NuclePhaser models aren't accurate enough on your specific use case, you can finetune them for free with cloud GPU using Google Colab NuclePhaser finetuning notebook. It is specifically designed for users without coding experience.

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.3.tar.gz (42.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for napari_nuclephaser-0.2.3.tar.gz
Algorithm Hash digest
SHA256 48315380252c06fe1c3c4b25aa75be6c1d9e22e9295ae9a20aafea2219e244ef
MD5 f5c75f069879bfd7c574a2ed404b1550
BLAKE2b-256 c23a93d4320e431b4c465ae2c7dd682a775aca41082f2ab8a185b4c8d4211218

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for napari_nuclephaser-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 675802c936b6d5da84032499a32a853980db81522624f7df22a8f674c7080649
MD5 d06f2c44b13784e0e898dc320bda1e1e
BLAKE2b-256 eaa93cfce6afa8b6798a90e7aacd66e2e01e748c1fc6a85bae541444dfa58ddf

See more details on using hashes here.

Supported by

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