/napari-seedseg

A simple interactive segmentation plugin for napari.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

License BSD-3 PyPI Python Version tests codecov napari hub

napari-seedseg

A simple plugin for 2D medical image segmentation. In this project, we are trying to use Flood method for segmentation. Flood segmentation, also known as flood fill or region growing, is an image segmentation technique that starts from a seed point and expands to neighboring pixels with similar properties (e.g., intensity, color). In our project, you only can segment one label at the time. Also, please open 2D greyscale image. Below is a description of the repository's structure and the purpose of each file:

.
├── setup.cfg              # package metadata
├── pyproject.toml         # use setuptools
├── src/napari_seedseg     
│   ├── napari.yaml        # Load and stress tests
│   ├── __init.py__        # Python package metadata files
|   ├── _widget.py         # Widget contributions
│   ├── _layers.py         # Layers contributions
│   ├── _method.py         # Method contributions
│   └── _test              # Test cases
└── ...

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

Demo

Demo

Installation

First, install napari:

pip install "napari[all]"

You can install napari-seedseg via pip:

pip install napari-seedseg

Alternatively, to install latest development version:

pip install git+https://github.com/rezaakb/napari-seedseg.git

Quick Start

  1. Launch napari and open the image you want to segment. Please note that the plugin only supports 2D Greyscale images. You can select sample images in this path File -> Open Sample -> napari -> Cell.
  2. Go to the Plugins menu and select the napari-seedseg: SeedSeg.
  3. In the segmentation plugin window, after selecting image layer, please select the desired tolerance level and click Confirm to initialize contour and segmentation layers, and the method with given tolerance. Note: If the Confirm buttom is disabled, it means the dimention of image is not eqaul to 2.
  4. Now, you can move your mouse over the image to visualize the segments. Note: You should be in the Segmentation Layer.
  5. Double click on each segment to add it to the Segmentation Layer.
  6. To refine the segmentation, repeat step 3 and adjust the tolerance level as needed.

Packages

In this project, we have used these packages:

numpy
magicgui
qtpy
opencv-python-headless
scikit-image>=0.19.3

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-seedseg" is free and open source software

Issues

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