Skip to content

Watershed Segmentation

Back to MIB | User interface | Menu | Tools

Semi-automated image segmentation using the Watershed method in Microscopy Image Browser.


Overview

Watershed segmentation interface

The Watershed segmentation tool in MIB provides semi-automated segmentation using the Watershed method, ideal for separating objects with distinct boundaries, such as membrane-enclosed organelles.

Note

For better interactivity and performance consider using the Graphcut segmentation tool instead.


Mode panel

The Mode panel lets you select the segmentation scope.

Mode panel options

  • segments only the current slice in the Image View panel
  • applies 2D segmentation to each slice individually
  • performs 3D segmentation on the entire dataset or a subarea (see Subarea panel below)
  • Aspect ratio for 3D... displays the dataset’s aspect ratio, derived from voxel sizes in (Menu → Dataset → Parameters). this is used when Watershed relies on a distance map (see Image segmentation settings below)

Subarea panel

The Subarea panel defines a dataset subset for processing, useful for large datasets or binning.

Subarea panel settings

  • X:... sets the width range (e.g., 1:512)
  • Y:... sets the height range
  • Z:... sets the z-slice range
  • from Selection fills X, Y, and Z with coordinates from the Selection layer’s bounding box
  • Current View limits X and Y to the visible area in the Image View panel
  • Reset restores full dataset dimensions
  • Bin x times... applies a binning factor to reduce detail for faster processing

Image segmentation settings

The Watershed workflow uses labeled areas (Background and Object) for segmentation, contrasting with the Graphcut workflow. It’s less interactive, slower per execution, and best for objects with distinct boundaries. Graphcut, with its preprocessing focus, is faster for repeated interactions and handles both boundaries and intensity contrast, making it preferable for most cases.

Segmentation settings

  • Color channel selects the channel for segmentation
  • Background selects the model material labeling background areas
  • Object selects the model material labeling objects
  • Type of signal chooses black-on-white (dark boundaries) or white-on-black (bright boundaries)
  • Update lists refreshes material lists
Optional pre-processing (Watershed only):
  • applies a gradient filter to enhance object borders
  • preprocesses data for improved Watershed results; adjust with Sigma fields
  • sends preprocessed data to the MATLAB workspace
  • displays preprocessing results in the Image View panel
  • Pre-process starts preprocessing (turns green when data is ready)
  • Import from MATLAB loads a dataset from the MATLAB workspace for segmentation
  • Clear removes preprocessed data from memory

Image segmentation example

Follow these steps to segment mitochondria using Watershed:

  • Load a sample dataset: Menu → File → Import image from → URL, enter
    http://mib.helsinki.fi/tutorials/WatershedDemo/watershed_demo1.tif
  • Add a material named Background in the Segmentation panel with + (right-click to rename)
  • Use the Brush tool to label cytoplasm, then press A to add it to Background
Snapshot

Labeling Background

  • Add another material named Seeds with +
  • Label mitochondria interiors, then press A to add to Seeds
Snapshot

Labeling Seeds

  • Start Watershed via Menu → Tools → Semi-automatic segmentation → Watershed
  • Ensure Background and Seeds are set in Image segmentation settings
  • Click Segment to segment mitochondria
  • Add more seeds to refine, then re-segment with Segment
  • Results appear in the Mask layer
  • Optionally smooth the mask: Menu → Mask → Smooth Mask
Snapshot

Segmented mitochondria


Algorithm for image segmentation with watershed

Watershed algorithm workflow

The diagram illustrates the step-by-step process of the Watershed segmentation algorithm, transforming labeled input into segmented objects.


References


Back to MIB | User interface | Menu | Tools