Skip to main content

napari-filter-labels-by-prop

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

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.

Pixel/Voxel size are read from the napari layer scale attribute (defaults to 1 if not specified when adding the layer). You can manually enter the size and press the Set button, which will set the layer scale, and measure the shape properties with calibrated units

The "Measure projected shape properties" option is only available for 3D images. It measures additional properties of Z-projected labels (including: "area", "convex_area", "circularity" and "perimeter").

The "Measure cytoplasm and cell compartments" is intended for label images that represent nuclei. With this option selected, cytoplasm and cell masks will be created by a dilation of 5 units (pixels or calibrated). Measurement in those compartments will be made and be used to filter on. Create labels will also add the respective cytoplasm and cell mask layers to the napari viewer.

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.

Metadata

Release files for napari-filter-labels-by-prop 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-filter-labels-by-prop 0.1.0
File Size Uploaded Provenance
napari_filter_labels_by_prop-0.1.0.tar.gz 24.2 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-filter-labels-by-prop 0.1.0
File Interpreter ABI Platform
napari_filter_labels_by_prop-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.2 MB

Release files / napari_filter_labels_by_prop-0.1.0.tar.gz

Download URL napari_filter_labels_by_prop-0.1.0.tar.gz
Size 24.2 MB
Tags Source
SHA-256 checksum
How to use checksums
6ca2ad4632aa8c9d47e9cbf93c868fea5f84ac956758672d54a3012b2ba1b911
BLAKE2b-256 checksum
How to use checksums
721703b556c73833016b64708a4c7cb59679065250f388774e9b2cdc09bc0930
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / napari_filter_labels_by_prop-0.1.0-py3-none-any.whl

Download URL napari_filter_labels_by_prop-0.1.0-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df9e5287dcd2e880bfb1c10760aeb910301811dd1fcac1c8e01cb9ca5484ad5c
BLAKE2b-256 checksum
How to use checksums
571cc7a33b252aa491bf52b235d0c233daf4b74a8edcf12e34c5ce8ec1898d20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Security for napari-filter-labels-by-prop 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page