Mantis-seg is a Python package for 3D image segmentation and label-image processing, developed as part of the Mantis ecosystem for high-content, multiplexed, and volumetric microscopy image analysis.
Mantis-seg provides Fractal tasks for intensity-based segmentation, label-image generation, and post-processing of segmented objects. It operates on OME-Zarr datasets and supports region-of-interest (ROI)-based processing.
The segment_by_intensity_threshold task segments microscopy images based on intensity thresholds, generating labeled regions from selected image channels. The resulting segmentations can be manually corrected to generate ground-truth annotations for training segmentation models, such as RDCNet.
- Input: 3D microscopy image from an OME-Zarr dataset, with channel and intensity threshold parameters.
- Output: Segmentation label image and ROI table written to the OME-Zarr dataset.
The expand_labels task isotropically expands segmented objects in the XY plane or in all three dimensions (XYZ) into neighboring unlabeled regions, enabling the generation of expanded object masks.
- Input: Segmentation label image and expansion parameters.
- Output: Expanded label image and ROI table written to the OME-Zarr dataset.
The fuse_touching_labels task merges touching segmented objects to generate fused regions.
- Input: Segmentation label image containing touching objects.
- Output: Label image with fused objects and ROI table written to the OME-Zarr dataset.
The cleanup_3d_child_labels task post-processes 3D segmentation labels to remove small-volume debris among child objects within a parent object (e.g., an organoid or tissue) using a volume filter.
- Input: 3D segmentation label image.
- Output: Cleaned 3D label image and ROI table written to the OME-Zarr dataset.
The convert_3d_to_mip task projects 3D segmentation labels into 2D for downstream analysis and visualization in 2D.
- Input: 3D label image (ZYX).
- Output: 2D projected label image (YX) and ROI table written to the corresponding 2D OME-Zarr dataset.
The build_label_image task constructs the multiscale image pyramid and corresponding ROI table from an existing level-0 segmentation label image in an OME-Zarr dataset. This is useful when a segmentation task fails before completing pyramid generation and ROI table creation.
- Input: Existing level-0 segmentation label image.
- Output: Multiscale label-image pyramid and ROI table written to the OME-Zarr dataset.
🚧 RDCNet segmentation is under development. The current implementation is available in the ISIT repository. We are working on integrating and refactoring this functionality into Mantis-seg.
Mantis-seg requires Python 3.11 or newer.
A Conda-based installation workflow is:
conda create -n mantis-seg python=3.11
conda activate mantis-seg
git clone https://github.com/fmi-basel/Mantis-seg.git
cd Mantis-seg
pip install -e .BSD 3-Clause License.