Skip to main content

Napari plugin for the segmentation of regions by flood

Project description

mmv-regionseg

License BSD-3 PyPI Python Version tests codecov napari hub

This README is in English. A German version is available here: README.de.md

A Napari plugin for region segmentation using 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 sufficient 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.

A widget will appear on the right-hand side of the Napari window, containing buttons, labels, and a slider.


Screenshot

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

Use the slider below the image loading button to set the gray-value tolerance (0%–100% of the dynamic range):

  • Low tolerance → risk of incomplete region filling.
  • High tolerance → risk of including undesired regions.

⚠️ The optimal tolerance often requires some experimentation.


Definition of the Footprint

Use the dropdown list to select the footprint for skimage.segmentation.flood. See also: Flood Fill.

  • 6 neighbors → Only voxels directly adjacent in X, Y, and Z are considered.
  • 18 neighbors → Includes voxels diagonally adjacent along faces and edges.
  • 26 neighbors → All neighboring voxels are included.

Selecting Seed Points

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

  • Each seed point is visualized.
  • Multiple seed points defined in one step are treated as one 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 for additional classes by selecting new seed points. Each class receives its own label layer.

Growth

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


Resetting for New Segmentation

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


Contributing

Contributions are welcome!

Tests can be run with tox; please ensure that coverage does not decrease before submiting 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmv_regionseg-0.4.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmv_regionseg-0.4.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file mmv_regionseg-0.4.0.tar.gz.

File metadata

  • Download URL: mmv_regionseg-0.4.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mmv_regionseg-0.4.0.tar.gz
Algorithm Hash digest
SHA256 db1526b67f6cf94e6895c79f0302d22ecbc440fd7283d99114e45d62de3e27b3
MD5 2453d832eb715df53111e41a591f8208
BLAKE2b-256 5ac759ddf582998ea6daf8363d73e5e95e8d1e61b233eb887789a5dd50ebc096

See more details on using hashes here.

Provenance

The following attestation bundles were made for mmv_regionseg-0.4.0.tar.gz:

Publisher: test_and_deploy.yml on MMV-Lab/MMV-RegionSeg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mmv_regionseg-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mmv_regionseg-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mmv_regionseg-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81641132c51d2c3b437aefe44c84fbadb696213feff7fdeddc66b428f318144c
MD5 ba6caf9b94fd677310f2a41fbbc1139f
BLAKE2b-256 173cb3da1df602d7285cd932ad479f1293fc320f01fefa8346c32d46e879f330

See more details on using hashes here.

Provenance

The following attestation bundles were made for mmv_regionseg-0.4.0-py3-none-any.whl:

Publisher: test_and_deploy.yml on MMV-Lab/MMV-RegionSeg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page