Skip to main content

A simple plugin to filter labels by properites.

Project description

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.

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

napari_filter_labels_by_prop-0.1.0rc1.tar.gz (24.2 MB view details)

Uploaded Source

Built Distribution

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

napari_filter_labels_by_prop-0.1.0rc1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file napari_filter_labels_by_prop-0.1.0rc1.tar.gz.

File metadata

File hashes

Hashes for napari_filter_labels_by_prop-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 0d387c567a01cbf0ba88b957570bac6ae2de50f381b1c86f0272f7e7b45a3a73
MD5 960a736157a6597e21e1be3eeaf251c4
BLAKE2b-256 528aca38525cebb6ab74b08c2b1efe40736f629d794a83143e5cf99bbb3d2022

See more details on using hashes here.

File details

Details for the file napari_filter_labels_by_prop-0.1.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_filter_labels_by_prop-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 b63477e194162c56f5c1192bee63f6a42e42d67831d8ee251198ca88ecc2f5b0
MD5 d19a04c6f14a55dbdac2a12aa5b6cb76
BLAKE2b-256 7dab21fb0dc2c189899c599eb05909eeb85415abb486906c91962e41ba1dda91

See more details on using hashes here.

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