{"name":"napari-nuclephaser","display_name":"NuclePhaser","visibility":"public","icon":"","categories":["Annotation","Segmentation","Acquisition"],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-nuclephaser.make_points","title":"Mark cells with points","python_name":"napari_nuclephaser.predict_on_single:make_points","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.directorypicker","title":"Pick working directory","python_name":"napari_nuclephaser._widget:directorypicker","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.give_num_points","title":"Count up the points","python_name":"napari_nuclephaser.count_points:give_num_points","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.calibrate_with_known_number","title":"Find best threshold for model with known number of object on image","python_name":"napari_nuclephaser.calibrate_known_number:calibrate_with_known_number","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.predict_on_stack","title":"Predict on stack of images","python_name":"napari_nuclephaser.predict_one_stack:predict_on_stack","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.convert_points_to_labels","title":"Convert detection on stack from points to labels for tracking","python_name":"napari_nuclephaser.convert_points_to_labels:convert_points_to_labels","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.calibrate_with_dapi_image","title":"Calibrate model and calculate accuracy using Phase-DAPI image pair","python_name":"napari_nuclephaser.calibrate_dapi:calibrate_with_dapi_image","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.calibrate_with_points","title":"Calibrate model and calculate accuracy using ground truth points layer","python_name":"napari_nuclephaser.calibrate_points:calibrate_with_points","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-nuclephaser.predict_on_two_stack","title":"Predict on 2-dimensional stack of images","python_name":"napari_nuclephaser.predict_two_stack:predict_on_two_stack","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"napari-nuclephaser.make_points","display_name":"Predict on single image","autogenerate":false},{"command":"napari-nuclephaser.predict_on_stack","display_name":"Predict on 1-stack","autogenerate":false},{"command":"napari-nuclephaser.predict_on_two_stack","display_name":"Predict on 2-stack","autogenerate":false},{"command":"napari-nuclephaser.calibrate_with_known_number","display_name":"Calibrate with known number","autogenerate":false},{"command":"napari-nuclephaser.calibrate_with_dapi_image","display_name":"Calibrate with DAPI image","autogenerate":false},{"command":"napari-nuclephaser.calibrate_with_points","display_name":"Calibrate with points","autogenerate":false},{"command":"napari-nuclephaser.convert_points_to_labels","display_name":"Convert points to labels","autogenerate":false},{"command":"napari-nuclephaser.give_num_points","display_name":"Count points on single image","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"napari-nuclephaser","version":"0.2.4","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"A Napari plugin to detect and count nuclei on phase contrast images","description":"# NuclePhaser: Cell Proliferation Measurement & Cell Tracking Assistant Plugin for Timelapse Images\n\n[![License MIT](https://img.shields.io/pypi/l/napari-nuclephaser.svg?color=green)](https://github.com/nikvo1/napari-nuclephaser/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-nuclephaser.svg?color=green)](https://pypi.org/project/napari-nuclephaser)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-nuclephaser.svg?color=green)](https://python.org)\n[![tests](https://github.com/nikvo1/napari-nuclephaser/workflows/tests/badge.svg)](https://github.com/nikvo1/napari-nuclephaser/actions)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-nuclephaser)](https://napari-hub.org/plugins/napari-nuclephaser)\n[![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)\n[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)\n\nA Napari plugin for automated cell nuclei detection, proliferation and population growth analysis, and single-cell tracking in brightfield and fluorescent nuclei timelapse microscopy images.\n\nWARNING!!! Further description isn't displayed correctly at Napari Hub. For correctly displayed description, visit our [GITHUB PAGE](https://github.com/nikvo1/napari-nuclephaser).\n\nnapari-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](https://docs.ultralytics.com/) YOLO object detection models and [obss/sahi](https://github.com/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](https://napari-nuclephaser.readthedocs.io/en/latest/index.html) and [paper](https://www.biorxiv.org/content/10.1101/2025.05.13.653705v1).\n\nNEW! 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](https://colab.research.google.com/drive/1hKMVQqYS0I_GrkYvdz23tPc8FCv2oJvh?usp=sharing). It is specifically designed for users without coding experience. \n\n## Nuclei detection\n\nWe trained a series of [YOLOv5](https://github.com/ultralytics/yolov5) and [YOLOv11](https://github.com/ultralytics/ultralytics) 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:\n- Napari-nuclephaser plugin includes [obss/sahi](https://github.com/obss/sahi) functionality, allowing detection on images of arbitrary sizes.\n\n<p align=\"center\">\n\t<picture>\n\t  <source media=\"(prefers-color-scheme: dark)\" srcset=https://github.com/user-attachments/assets/aa321f17-b0e2-4161-8a69-cb732d7065a7 height=400>\n\t  <img alt=\"Image didn't load\" src=https://github.com/user-attachments/assets/fe4d6436-3490-4c06-8ddd-7c797976f407 height=400>\n\t</picture>\n</p>\n\n- YOLO models are fast, providing reasonable inference speed even with CPU.\n- Ability to predict and automatically count nuclei on stacks of images, making it convenient for cell population growth studies and individual cell tracking.\n\n<p align=\"center\">\n\t<picture>\n\t  <source media=\"(prefers-color-scheme: dark)\" srcset=https://github.com/user-attachments/assets/feba9a99-1d37-4962-a2e6-175052aa4925>\n\t  <img alt=\"Image didn't load\" src=\"https://github.com/user-attachments/assets/c7e4d0e6-44c1-4268-aae5-6bb78500d928\">\n\t</picture>\n </p>\n\n- Calibration algorithm that allows measuring accuracy for each specific use case.\n\n## Calibration algorithm\n\nResult of object detection model inference is highly dependent on _confidence threshold_ parameter.\n\n<p align=\"center\">\n  <picture>\n  \t<source media=\"(prefers-color-scheme: dark)\" srcset=https://github.com/user-attachments/assets/8a13085f-c7ea-45f0-8931-6851f21b68a0 height=\"300\">\n  \t<img alt=\"Image didn't load\" src=https://github.com/user-attachments/assets/89f76cd7-2db7-4241-bc35-36d23332b2b5 height=\"300\">\n  </picture>\n</p>\n\nWe created several calibration (finding optimal confidence threshold) algorithms that allow adjusting models to specific use cases (cell types, magnifications, illumination settings, cameras etc.):\n- Calibration using known number of objects on an image. Doesn't produce accuracy metrics.\n- Calibration using fluorescent nuclei stain image (for example, DAPI image). Produces accuracy metrics.\n- Calibration using manual annotation of nuclei. Produces accuracy metrics.\n\nApart 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.\nAccuracy metrics are [Mean Absolute Percentage Error (MAPE)](https://en.wikipedia.org/wiki/Mean_absolute_percentage_error) and prediction-ground truth scatterplot, which shows how well model performs with different densities of cells.\n\nNEW! 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](https://colab.research.google.com/drive/1hKMVQqYS0I_GrkYvdz23tPc8FCv2oJvh?usp=sharing). It is specifically designed for users without coding experience. \n\nLearn more about calibration in [documentation](https://napari-nuclephaser.readthedocs.io/en/latest/Biological%20tasks%20guidelines/Individual%20cells%20tracking.html).\n\n<p align=\"center\">\n  <picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=https://github.com/user-attachments/assets/6d89e22b-2728-40fb-839d-3c6681e29c97>\n  <img alt=\"Image didn't load\" src=https://github.com/user-attachments/assets/6a574845-4ad2-4802-b0f8-f1d908aa585a>\n  </picture>\n</p>\n\n## Cell Proliferation Measurement & Population Growth Analysis\n\nWith 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:\n\n- 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).\n- [Accuracy measurement for each specific use case](https://napari-nuclephaser.readthedocs.io/en/latest/General%20information/Confidence%20threshold%20calibration.html), so you will be sure the tool is working with appropriate precision.\n- Measuring the number of cells, not the area occupied by cells, which can be significantly influenced by spreading/narrowing of cells. \n- Complete reproducibility of results with metadata.txt files saved for each experiment.\n\n<p align=\"center\">\n  <picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=https://github.com/user-attachments/assets/47b6cee0-7f4a-440f-84ed-de2a5aa2aa36>\n  <img alt=\"Image didn't load\" src=https://github.com/user-attachments/assets/5a084f1a-f977-41fa-b4be-55f37bdf9996>\n  </picture>\n</p>\n\nFor more detailed information about how NuclePhaser can be used for cell proliferation measurement & population growth analysis, visit our [documentation](https://napari-nuclephaser.readthedocs.io/en/latest/Biological%20tasks%20guidelines/Population%20growth%20curves.html#).\n\n## Individual cell tracking\n\nNuclePhaser 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](https://napari-nuclephaser.readthedocs.io/en/latest/Biological%20tasks%20guidelines/Individual%20cells%20tracking.html).\n\n## Models\n\nCurrently 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:\n\n<div align=\"center\">\n\nFluorescent nuclei detectors\n| Model                    | Link |\n| :----------------------: | :-----: |\n| Fluorescence_v5n         | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v5n.pt?download=1) |\n| Fluorescence_v5s         | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v5s.pt?download=1) |\n| Fluorescence_v5m         | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v5m.pt?download=1) |\n| Fluorescence_v5l         | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v5l.pt?download=1) |\n| Fluorescence_v5x         | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v5x.pt?download=1) |\n| Fluorescence_v11n        | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v11n.pt?download=1)|\n| Fluorescence_v11s        | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v11s.pt?download=1)|\n| Fluorescence_v11m        | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v11m.pt?download=1)|\n| Fluorescence_v11l        | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v11l.pt?download=1)|\n| Fluorescence_v11x        | [Donwload](https://zenodo.org/records/15388030/files/Fluorescence_v11x.pt?download=1)|\n\nBrighfield nuclei detectors\n| Model                    | Link |\n| :----------------------: | :-----: |\n| Brightfield_v5n          | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v5n.pt?download=1)  |\n| Brightfield_v5s          | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v5s.pt?download=1)  |\n| Brightfield_v5m          | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v5m.pt?download=1)  |\n| Brightfield_v5l          | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v5l.pt?download=1)  |\n| Brightfield_v5x          | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v5x.pt?download=1)  |\n| Brightfield_v11n         | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v11n.pt?download=1) |\n| Brightfield_v11s         | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v11s.pt?download=1) |\n| Brightfield_v11m         | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v11m.pt?download=1) |\n| Brightfield_v11l         | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v11l.pt?download=1) |\n| Brightfield_v11x         | [Donwload](https://zenodo.org/records/15388030/files/Brightfield_v11x.pt?download=1) |\n\n</div>\n\n> [!NOTE]\n> Feel free to use the models published here without the plugin!\n\n# Plugin functionality\nnapari-nuclephaser plugin offers following widgets:\n- 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.\n- Widget for inference on stack of images. Optionally can create .csv or .xlsx file at given location with counting results.\n- Widget for calibration using known number of cells.\n- Widget for calibration using fluorescent nuclei image (fluorescent nuclei detection model is used as a perfect predictor).\n- Widget for calibration using manual annotations.\n- Widget for transforming Napari Points layer into Labels layer, which allows turning detection in tracking algorithms-digestible form (in particular, [btrack](https://github.com/quantumjot/btrack)).\n- Widget for counting number of points in Points layer.\n\nLearn more about widgets and their functionality at [documentation](https://napari-nuclephaser.readthedocs.io/en/latest/index.html).\n\n## Citation\nIf you use NuclePhaser in your work, please cite our preprint:\n```bibtex\n@article {Voloshin2025.05.13.653705,\n\tauthor = {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},\n\ttitle = {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},\n\tyear = {2025},\n\tdoi = {10.1101/2025.05.13.653705},\n\tURL = {https://www.biorxiv.org/content/early/2025/05/16/2025.05.13.653705},\n\teprint = {https://www.biorxiv.org/content/early/2025/05/16/2025.05.13.653705.full.pdf},\n\tjournal = {bioRxiv}\n}\n```\n\n## Installation\n\nFor detailed installation instructions, visit our [documentation](https://napari-nuclephaser.readthedocs.io/en/latest/Installation/Installation.html).\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [MIT] license,\n\"napari-nuclephaser\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[copier]: https://copier.readthedocs.io/en/stable/\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[napari-plugin-template]: https://github.com/napari/napari-plugin-template\n\n[file an issue]: https://github.com/nikvo1/napari-nuclephaser/issues\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n\nThis [napari] plugin was generated with [copier] using the [napari-plugin-template].\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":"Nikita Voloshin","author_email":"nikita.voloshin.98@gmail.com","maintainer":null,"maintainer_email":null,"license":"MIT License\n\nCopyright (c) 2025 nikvo1\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: MIT License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Programming Language :: Python :: 3.13","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["setuptools","wheel","napari","ultralytics==8.3.141","yolov5","magicgui","sahi","scikit-image","torch==2.8.0","pathlib","numpy","typing","pandas","openpyxl","seaborn","opencv-python","imagecodecs","tox; extra == \"testing\"","pytest; extra == \"testing\"","pytest-cov; extra == \"testing\"","pytest-qt; extra == \"testing\"","pytest-mock; extra == \"testing\"","napari; extra == \"testing\"","pyqt5; extra == \"testing\"","opencv-python-headless; extra == \"testing\""],"requires_python":">=3.10","requires_external":null,"project_url":["Bug Tracker, https://github.com/nikvo1/napari-nuclephaser/issues","Documentation, https://github.com/nikvo1/napari-nuclephaser#README.md","Source Code, https://github.com/nikvo1/napari-nuclephaser","User Support, https://github.com/nikvo1/napari-nuclephaser/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}