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.

MMV-playground

MMV-playground

Napari plugin for 2D microscopy segmentation

Workflow step:
Image annotation
Image segmentation

License BSD-3 PyPI Python Version tests codecov napari hub

This plugin is aimed at researchers in biology and medicine who want to segment and analyze 2D microscopy images. It offers intuitive tools for common pre-processing and analysis tasks.


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

Installation

You can install MMV-playground via pip:

pip install MMV-playground

To install latest development version :

pip install git+https://github.com/MMV-Lab/MMV-playground.git

Documentation

This plugin for the graphics software Napari is designed to analyze two-dimensional microscopy images. Images should be provided in grayscale format, as colored images are not supported. The plugin includes seven core functions for image analysis:

  1. Intensity normalization
  2. Smoothing
  3. Background correction
  4. Spot-shape filter
  5. Filament-shape filter
  6. Thresholding
  7. Topology-preserving thinning

We provide an introduction to explain the different functions of this plugin.

How to Start and Use the Plugin

To start the plugin, open Napari, go to the "Plugins" menu, and select "MMV-playground (MMV-playground)." The MMV-playground interface will appear on the right-hand side of the Napari window, displaying seven buttons, each corresponding to one of the available functions. Clicking a button opens a dialog box where you can select an image, adjust the parameters for the chosen function, and execute it by pressing the "Run" button. Clicking the function button again collapses the dialog box.

Screenshot

Here is a preview of the MMV-playground plugin in action:

MMV-playground Plugin Screenshot


Intensity Normalization

This function adjusts the image intensity to enhance contrast and improve uniformity. Two percentage values are required:

  • Lower percentage (0–5%): Defines the darkest portion of the image to ignore as background noise, which is set to a fixed value.
  • Upper percentage (95–100%): Specifies the brightest portion of the image to be capped, preventing overexposure.

The plugin calculates the respective percentiles based on these values. Intensities below the lower percentile are clipped, and those above the upper percentile are also capped. Finally, all pixel intensities are rescaled to the range [0, 1].


Smoothing

This function reduces noise to enhance image clarity. Two methods are available:

  • Gaussian smoothing
  • Edge-preserving smoothing: Retains edges (e.g., cell boundaries) while reducing noise.

Background Correction

This function removes uneven illumination or background artifacts using a filter. The key parameter is:

  • Kernel size (1–100): Determines the spatial scale of the background correction. Smaller kernel sizes remove local noise, while larger sizes correct for broader illumination variations.

The scipy.ndimage.white_tophat function is used to perform the correction, making this method effective for images with dark backgrounds.


Spot-Shape Filter

This filter detects circular structures, such as cell nuclei or fluorescent spots. It is based on the scipy.ndimage.gaussian_laplace function and requires:

  • Sigma (σ): Controls the size of the spots to detect. Smaller sigma values target smaller spots, while larger values focus on larger structures.

Filament-Shape Filter

This filter highlights elongated structures like cytoskeletal fibers or blood vessels. Using the aicssegmentation.core.vessel.vesselness2D function, the key parameter is:

  • Sigma (σ): Specifies the width of the detected filaments. Lower values detect thinner structures, while higher values identify thicker ones.

Thresholding

This function segments the image into binary regions by separating the signal from the background. Users can choose one of four thresholding methods:

  • Otsu: Best for images with clear separation between background and signal intensities.
  • Li: Suitable for uniformly illuminated images.
  • Triangle: Effective for asymmetrical intensity distributions.
  • Sauvola: Ideal for images with uneven illumination.

The result is a binary image where pixels above the threshold are set to 1 (signal), and all others are set to 0 (background).


Topology-Preserving Thinning

This function extracts the skeleton of structures while maintaining their connectivity. Two parameters are required:

  • Minimum thickness (0.5–5): Defines the smallest allowable thickness of structures before thinning.
  • Thin (1–5): Controls the degree of thinning, reducing structure width while preserving topology (e.g., network connections).

This is particularly useful for analyzing vascular or cellular networks.


What Is Missing?

Currently, unit tests are not implemented, and internal documentation of the source code is still in progress.

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, "MMV-playground" is free and open source software

Issues

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

Version:

  • 0.1.4

Last updated:

  • 31 January 2025

First released:

  • 30 January 2025

License:

Supported data:

  • Information not submitted

Plugin type:

GitHub activity:

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

Python versions supported:

Operating system:

Requirements:

  • aicssegmentation
  • itk
  • napari
  • numpy
  • qtpy
  • scikit-image
  • scipy