napari-cellseg3d

plugin for cell segmentation


cellseg3d logo

Code style: black License: MIT PyPI Python Version codecov napari hub

A napari plugin for 3D cell segmentation: training, inference, and data review. In particular, this project was developed for analysis of mesoSPIM-acquired (cleared tissue + lightsheet) datasets.


News

June 2022: This is an alpha version, please expect bugs and issues, and help us make the code better by reporting them as an issue!

Installation

Note : we recommend using conda to create a new environment for the plugin.

conda create --name python=3.8 napari-cellseg3d
conda activate napari-cellseg3d

You can install napari-cellseg3d via pip:

pip install napari-cellseg3d

OR directly via napari-hub:

  • Install napari from pip with pip install "napari[all]", then from the “Plugins” menu within the napari application, select “Install/Uninstall Package(s)...”
  • Copy napari-cellseg3d and paste it where it says “Install by name/url…”
  • Click “Install”

Documentation

Available at https://AdaptiveMotorControlLab.github.io/CellSeg3d

You can also generate docs by running make html in the docs folder.

Usage

To use the plugin, please run:

napari

Then go into Plugins > napari-cellseg3d, and choose which tool to use.

  • Review: This module allows you to review your labels, from predictions or manual labeling, and correct them if needed. It then saves the status of each file in a csv, for easier monitoring.
  • Inference: This module allows you to use pre-trained segmentation algorithms on volumes to automatically label cells and compute statistics.
  • Train: This module allows you to train segmentation algorithms from labeled volumes.
  • Utilities: This module allows you to perform several actions like cropping your volumes and labels dynamically, by selecting a fixed size volume and moving it around the image; computing prediction scores from ground truth and predicition labels; or converting labels from instance to segmentation and the opposite.

Requirements

Python >= 3.8 required

Requires pytorch and MONAI. For PyTorch, please see PyTorch's website for installation instructions. A CUDA-capable GPU is not needed but very strongly recommended, especially for training. If you get errors from MONAI regarding missing readers, please see MONAI's optional dependencies page for instructions on getting the readers required by your images.

Issues

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

Testing

To run tests locally:

  • Locally : run pytest in the plugin folder
  • Locally with coverage : In the plugin folder, run coverage run --source=napari_cellseg3d -m pytest then coverage xml to generate a .xml coverage file.
  • With tox : run tox in the plugin folder (will simulate tests with several python and OS configs, requires substantial storage space)

Contributing

Contributions are very welcome.

Please ensure the coverage at least stays the same before you submit a pull request.

For local installation from Github cloning, please run:

pip install -e .

License

Distributed under the terms of the MIT license.

"napari-cellseg3d" is free and open source software.

Acknowledgements

This plugin was developed by Cyril Achard, Maxime Vidal, Mackenzie Mathis. This work was funded, in part, from the Wyss Center to the Mathis Laboratory of Adaptive Motor Control.

Plugin base

This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Version:

  • 0.0.1rc3

Release date:

  • 21 July 2022

First released:

  • 25 June 2022

License:

  • MIT

Supported data:

GitHub activity:

  • Stars: 21
  • Forks: 1
  • Issues + PRs: 8

Python versions supported:

Operating system:

Requirements:

  • numpy
  • napari[all] (>=0.4.14)
  • QtPy
  • opencv-python (>=4.5.5)
  • dask-image (>=0.6.0)
  • scikit-image (>=0.19.2)
  • matplotlib (>=3.4.1)
  • tifffile (>=2022.2.9)
  • imageio-ffmpeg (>=0.4.5)
  • torch (>=1.11)
  • monai (>=0.9.0)
  • nibabel
  • scikit-image
  • pillow
  • itk (>=5.2.0)
  • matplotlib
  • vispy (>=0.9.6)

Sign up to receive updates