The napari hub is transitioning to a community-run implementation due to launch in June 2025.
Since October 1, 2024, this version is no longer actively maintained and will not be updated. New plugins and plugin updates will continue to be listed.

MMV-Region Segmentation

mmv-regionseg

Napari plugin for the segmentation of regions by flood

    Workflow step:
    Image segmentation

    License BSD-3 PyPI Python Version tests codecov napari hub

    A Napari plugin for the segmentation of regions by flood_fill


    This napari plugin was generated with copier using the napari-plugin-template.

    Installation

    You can install mmv-regionseg via pip:

    pip install mmv-regionseg

    To install latest development version :

    pip install git+https://github.com/MMV-Lab/mmv-regionseg.git

    Documentation

    MMV-RegionSeg is a Napari plugin designed to segment three-dimensional image data based on the gray value of a selected seed point. Neighboring voxels are assigned to the same class if their intensity is similar to that of the seed point or falls within a defined tolerance range.


    Launching the Plugin

    1. Open Napari.
    2. Go to the Plugins menu.
    3. Select MMV-RegionSeg from the dropdown.

    This opens a widget on the right-hand side of the Napari window, featuring several buttons, labels, and a slider.

    Screenshot

    Here is a preview of the MMV-RegionSeg plugin in action:

    MMV-RegionSeg Plugin Screenshot


    Loading Image Data

    Click the "Read image" button to load a 3D image in TIFF format. A standard OS file dialog will open. Once the image is selected, Napari will display it as an image layer.


    Adjusting Tolerance

    A slider below the image loading button allows you to set the gray value tolerance (range: 1–50):

    • Low tolerance: May result in incomplete region filling.
    • High tolerance: May include undesired regions.

    ⚠️ Choosing the right tolerance often requires trial and error.


    Selecting Seed Points

    Click "Select seed points" to activate a new points layer in Napari. You can then define seed points by clicking directly in the viewer.

    • Each seed point is visualized.
    • Multiple seed points added in one step are treated as a single class.
    • Use Napari’s Layer Controls to move or delete seed points.

    Segmentation Options

    After placing seed points, you can choose between two segmentation methods:

    Flood

    Click "Flood" to perform segmentation using
    skimage.segmentation.flood(...).
    This identifies neighboring voxels within the tolerance range and saves them to a new label layer.

    You can repeat this process for other classes by selecting new seed points. Each class will have its own label layer.

    Growth

    Click "Growth" to visualize the segmentation step by step.
    This simulates the growth of a region, similar to a cell colony expanding in a Petri dish.


    Resetting for New Segmentation

    After a label layer is created for a class, the points layer is removed, allowing you to define new seed points without affecting the existing segmentation results.


    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, "mmv-regionseg" is free and open source software

    Issues

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

    Version:

    • 0.3.0

    Last updated:

    • 10 April 2025

    First released:

    • 21 March 2025

    License:

    Supported data:

    • Information not submitted

    Plugin type:

    GitHub activity:

    • Stars: 1
    • Forks: 0
    • Issues + PRs: 0

    Python versions supported:

    Operating system:

    Requirements:

    • napari
    • numpy
    • qtpy
    • scikit-image
    • tifffile