Skip to main content

A plugin based on scikit-image for segmenting nuclei and cells based on fluorescent microscopy images with high intensity in nuclei and/or membranes

Project description

napari-segment-blobs-and-things-with-membranes (nsbatwm)

License PyPI Python Version tests codecov

A plugin based on scikit-image for segmenting nuclei and cells based on fluorescent microscopy images with high intensity in nuclei and/or membranes. The available functions and their user interface based on magicgui are shown below. You can also call these functions as shown in the demo notebook.


This algorithm uses Otsu's thresholding method in combination with Gaussian blur and a Voronoi-Tesselation approach to label bright objects such as nuclei in an intensity image. The alogrithm has two sigma parameters which allow you to fine-tune where objects should be cut (spot_sigma) and how smooth outlines should be (outline_sigma). This implementation aims to be similar to Voronoi-Otsu-Labeling in clesperanto.


Seeded Watershed

Starting from an image showing high-intensity membranes and a seed-image where objects have been labeled (e.g. using Voronoi-Otsu-Labeling), objects are labeled that are constrained by the membranes.


Seeded Watershed using local minima as starting points

Similar to the Seeded Watershed and Voronoi-Otsu-Labeling explained above, you can use this tool to segment an image showing membranes without an additional image showing nuclei. The two sigma parameters allow to fine tune how close objects can be and how precise their boundaries are detected.


Gaussian blur

Applies a Gaussian blur to an image. This might be useful for denoising, e.g. before applying the Threshold-Otsu method.


Subtract background

Subtracts background using scikit-image's rolling-ball algorithm. This might be useful, for example to make intensity of membranes more similar in different regions of an image.


Threshold Otsu

Binarizes an image using scikit-image's threshold Otsu algorithm, also known as Otsu's method.


Split touching objects (formerly known as binary watershed).

In case objects stick together after thresholding, this tool might help. It aims to deliver similar results as ImageJ's watershed implementation.


Connected component labeling

Takes a binary image and produces a label image with all separated objects labeled differently. Under the hood, it uses scikit-image's label function.


This napari plugin was generated with Cookiecutter using with @napari's cookiecutter-napari-plugin template.


Download, unzip and install napari from its github releases page: img.png

Afterwards, go to the menu Plugins > Install/uninstall plugins... and click on the install button next to napari-segment-blobs-and-things-with-membranes: img.png

You can also install napari-segment-blobs-and-things-with-membranes via pip:

pip install napari-segment-blobs-and-things-with-membranes


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.


Distributed under the terms of the BSD-3 license, "napari-segment-blobs-and-things-with-membranes" is free and open source software


If you encounter any problems, please create a thread on along with a detailed description and tag @haesleinhuepf.

Project details

Download files

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

Files for napari-segment-blobs-and-things-with-membranes, version 0.2.8
Filename, size File type Python version Upload date Hashes
Filename, size napari_segment_blobs_and_things_with_membranes-0.2.8-py3-none-any.whl (9.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size napari-segment-blobs-and-things-with-membranes-0.2.8.tar.gz (10.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page