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.
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
- 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
. - Go to the
Plugins
menu and select thenapari-seedseg: SeedSeg
. - 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 theConfirm
buttom is disabled, it means the dimention of image is not eqaul to 2. - Now, you can move your mouse over the image to visualize the segments. Note: You should be in the
Segmentation Layer
. - Double click on each segment to add it to the
Segmentation Layer
. - To refine the segmentation, repeat step 3 and adjust the tolerance level as needed.
In this project, we have used these packages:
numpy
magicgui
qtpy
opencv-python-headless
scikit-image>=0.19.3
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.
Distributed under the terms of the BSD-3 license, "napari-seedseg" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.