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.

PartSeg

PartSeg

PartSeg is python GUI and set of napari plugins for bio imaging analysis especially nucleus analysis,

PartSeg is a specialized GUI for feature extraction from multichannel light microscopy images, but also most of its features are available as napari Widgets. Information about PartSeg as standalone program or library are here

Who is This For?

This plugin is for 2D and 3D segmentation of distinct objects from images and measuring various parameters of these objects.

This plugin process everything in memory, so it may not work with images stored in dask arrays. Currently, this plugin does not support the processing of Time data.

How-to Guide

The example data is stored here.

The above video presents simple segmentation and measurement of various parameters of this segmentation (ROI).

As below described, algorithms are the result of porting PartSeg utilities to napari then detailed description could be found in PartSeg documentation/

ROI Extraction (Segmentation, pixel labeling)

The PartSeg is focused on the reproducible ROI Extraction process and offers two groups of algorithms:

  • ROI Mask Extraction set of algorithms (from PartSeg ROI Analysis) to work on a whole stack and mainly used for extracting nucleus or cell from a stack.

  • ROI Analysis Extraction set of algorithms (from PartSeg ROI Mask) for detailed segmentation on the level of a single nucleus. If possible, they use an inner caching mechanism to improve performance while adjusting parameters.

Algorithms from both groups should support masking. (perform ROI extraction only on the mask layer's area has non-zero values).

Parameters of ROI Extraction could be saved for later reuse (in the program) or exported to JSON and imported in another instance. With an accuracy of up to channel selection, they are identical to PartSeg, so importing should work both ways, but the channel selection step needs to be repeated.

The list of available algorithms could be extensible using the PartSeg plugin mechanism.

Measurement widgets

PartSeg offers two measurement widgets:

Measurement

Interface to PartSeg measurement engine. In this widget, there are two tabs. *Measurement settings that allow to define, delete, import, and export set of measurements

Measurement Settings

and Measurement for performing measures using an already defined set.

Measurement

The list of available measurements could be extensible using the PartSeg plugin mechanism.

Simple Measurement

Simple Measurement

Set of measurements that could be calculated per component respecting data voxel size. In comparison to Measurement list of available measures is limited to ones that do not need Mask information and could be calculated per component.

This widget is equivalent to the PartSeg ROI Mask Simple Measurement window.

Search label

Widget to find the layer with the given number By highlighting it or zooming on it. The highlight widget uses white color, so the highlight may not be visible if the label has a bright color.

Mask create

Transform labels layer into another labels layer with the possibility to dilate, and filling small holes

Mask create widget

Algorithm group widgets

The central concept of PartSeg is the group of algorithms that shares the same interface. This allows to create workflows where author of the workflow does not need to know which algorithm for a given task is the best. The user could select the best one and use it. For example workflow author may specify only that he expect thresholding operator and user could select any of available. (currently used only in PartSeg ROI Extraction)

Currently there are five algorithm groups and each of them has its own widget:

Threshold

Threshold widget

Noise filtering

Noise filtering widget

Double threshold

where area of interest is defined by positive value and core objects (start for sprawl) by value 2:

Double threshold widget

Border smooth for smoothing Labels border

Border smooth widget

Watershed for watershed segmentation

Watershed widget

Part of the flow methods require information if the central object is brighter or darker than the area to split. Examples of such methods are MSO and Path.

Helpful widgets

There are also two widgets to simplify work with labels:

Connected component

image

Split core objects

It is for extract core objects returned by double threshold widget

image

Label selector

This is widget that allows to create custom label mapping. It could be useful to prepare publications figures. If image hase more labels that selected label mapping contains it cycle colors. Created mapping will be stored between sessions

This widget will not work with really big labels numbers.

Create labels mapping: Label mapping creation

Apply label mapping: Label mapping apply

More details about usage could be found here

Copy labels

Copy labels widget

Copy selected Labels from current layer along z-axis.

Image Colormap

This widget allows to create custom colormap for image.

Create colormaps will be stored between sessions.

Create new colormap: Create colormap

Apply colormap: Apply colormap

More details about usage could be found here

Reader plugins

In this plugin, there are also all PartSeg readers and writers. The most important readers are this, which allows loading PartSeg projects to napari. The one which could impact a user workflow is tiff reader. In comparison to the napari default one, there are two essential differences. Napari's built-in plugin loads data as they are in a file. PartSeg plugin read file metadata and return data in TZYX order. PartSeg reader returns each channel as a separate layer. PartSeg reader also tries to parse voxel size metadata and set scale parameters to nanometers' size.

Version:

  • 0.15.4

Last updated:

  • 01 October 2024

First released:

  • 14 January 2019

License:

Supported data:

  • Information not submitted

Save extension:

Save layers:

GitHub activity:

  • Stars: 30
  • Forks: 10
  • Issues + PRs: 19

Python versions supported:

Operating system:

Requirements:

  • IPython>=7.7.0
  • PartSegCore-compiled-backend<0.16.0,>=0.13.11
  • PartSegData==0.10.0
  • QtAwesome!=1.2.0,>=1.0.3
  • QtPy>=1.10.0
  • SimpleITK>=2.0.0
  • appdirs>=1.4.4
  • czifile>=2019.5.22
  • defusedxml>=0.6.0
  • fonticon-fontawesome6>=6.1.1
  • h5py>=3.3.0
  • imagecodecs>=2020.5.30
  • imageio>=2.5.0
  • ipykernel>=5.2.0
  • local-migrator>=0.1.7
  • magicgui!=0.5.0,>=0.4.0
  • mahotas>=1.4.10
  • napari>=0.4.14
  • nme>=0.1.7
  • oiffile>=2020.1.18
  • openpyxl>=2.5.7
  • packaging>=20.0
  • pandas>=1.1.0
  • psygnal>=0.3.1
  • pydantic<3,>=1.9.1
  • pygments>=2.12.0
  • qtconsole>=4.7.7
  • requests>=2.25.0
  • scipy>=1.4.1
  • sentry-sdk>=2.4.0
  • six>=1.11.0
  • superqt>=0.3.0
  • sympy>=1.1.1
  • tifffile>=2020.9.30
  • traceback-with-variables>=2.0.4
  • vispy>=0.9.4
  • xlrd>=1.1.0
  • xlsxwriter>=2.0.0
  • numpy<2,>=1.18.5; python_version < "3.10"
  • numpy>=1.18.5; python_version >= "3.10"