Skip to content

A basis for a napari plugin for manually correcting cell segmentation in 3D (z, y, x) or 4D (t, z, y, x) (virtual) arrays.

License

Notifications You must be signed in to change notification settings

AnniekStok/napari-segmentation-correction

Repository files navigation

napari-segmentation-correction

License BSD-3 PyPI Python Version tests codecov napari hub

Toolbox for viewing, analyzing and correcting (cell) segmentation in 2D, 3D or 4D (t, z, y, x) (virtual) arrays.

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

Installation

You can install napari-segmentation-correction via pip:

To install latest development version :

pip install git+https://github.com/AnniekStok/napari-segmentation-correction.git

Usage

This plugin serves as a toolbox aiming to help with correcting segmentation results. Functionalities:

  • Orthogonal views for 3D data based on the MultipleViewerWidget and 3D plane and clipping plane sliders.
  • explore label properties (scikit-image regionprops) in a table widget (based on napari-skimage-regionprops) and a Matplotlib plot.
  • select/delete labels using a points layer
  • copy labels from a 2-5 dimensional array with multiple segmentation options to your current 2-4 dimensional label layer.
  • label connected components (scikit-image)
  • filter labels by number of pixels
  • smooth labels (using a median filter)
  • erode/dilate labels (scipy.ndimage and scikit-image)
  • binarize an image or labels layer by applying an intensity threshold
  • image calculator for mathematical operations on two images
  • selecting/deleting labels that overlap with a binary mask

3D viewing

Copy labels between different labels layers

To copy 2D or 3D labels from one layer to another, follow these steps:

  1. Select the labels layer from which you want to copy, and click 'Convert current label layer to label options layer'
  2. Make sure the labels layer to which you want to copy is your new current label layer (clicking on it will activate it, or select it from the dropdown at the top of the Editing tab).
  3. With the layer named 'labels options' selected, Shift+Click on the main view or any of the orthogonal views to copy the label you clicked on to the target layer. Alternatively, right-mouse click will copy only the 2D label from the current view (yx for the main view, xz and yz for the orthogonal views) to the corresponding position in target layer.

Select / delete labels that overlap with a binary mask

All labels that share any pixel overlap with the mask are selected.

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 BSD-3 license, "napari-segmentation-correction" is free and open source software

Issues

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

About

A basis for a napari plugin for manually correcting cell segmentation in 3D (z, y, x) or 4D (t, z, y, x) (virtual) arrays.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages