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.

Filter labels by properties

napari-filter-labels-by-prop

A simple plugin to filter labels by properites.

Workflow step:
Image annotation
Image segmentation

License BSD-3 PyPI Python Version tests codecov napari hub

A simple plugin to filter labels by properties.


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

Description

This plugin provides the possibility to filter segmentation objects by measurements (shape and intensity). E.g. you segmented your cells, and you want to exclude segmentation objects that have a mean intensity below a certain value.

It is intended for 2D and 3D images.

You can interactively set minimum and maximum thresholds on measurement properties, and napari will show a preview of the selection.

Measurements are based on scikit-image regionprops. However, not all properties are implemented, and they are more restricted for 3D images.

Usage: Quick start

  1. Start napari
  2. Start the plugin from the menu: Plugins > Filter labels by properties
  3. Add a label image
  4. (optionally) Add a corresponding intensity image with the same (Z)YX shape
  5. In the widget, select the property you want to filter on
  6. Adjust the min/max sliders
  7. When you are ready to create a new label layer click the Create labels button in the widget
    • depending on the number of labels and image size, this may take longer -> check the napari activity

Usage notes:

When dealing with more than 100 label objects in an image, the filtering view update is triggered only once you release the sliders.

Another similar plugin you could consider checking out: napari-skimage-regionprops.

Installation

You can install napari-filter-labels-by-prop via pip:

pip install napari-filter-labels-by-prop

To install latest development version :

pip install git+https://github.com/loicsauteur/napari-filter-labels-by-prop.git

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-filter-labels-by-prop" is free and open source software

Issues

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

Version:

  • 0.0.1

Last updated:

  • 24 January 2025

First released:

  • 24 January 2025

License:

Supported data:

  • Information not submitted

Plugin type:

GitHub activity:

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

Python versions supported:

Operating system:

Requirements:

  • numpy
  • magicgui
  • qtpy
  • scikit-image
  • matplotlib