Skip to content

Object Separation with Watershed

Tools for separating touching or overlapping objects stored in the Selection, Mask, or Model layer.

Overview

Overview of the Object Separation tool

The Object separation tool uses watershed transformation to divide connected objects into smaller, distinct units. Objects can originate from the Selection, Mask, or Model layer, making the tool useful for refining segmentation results where objects are fused or touching.

Launch via Ribbon → Tools → Object separation.


Mode panel

The Mode panel controls the segmentation scope.

Mode panel for watershed segmentation

  • 2D, current slice only — applies watershed only to the currently displayed slice in the Image View panel
  • 2D, slice-by-slice — applies 2D watershed to each slice individually
  • 3D, volume — performs 3D watershed across the entire dataset or a selected subvolume (see Subarea panel below)
  • Aspect ratio — voxel aspect ratio used for 3D distance-transform watershed, expressed as three space-separated values (e.g., 1.00 1.00 3.50). Computed automatically from the pixel sizes in Dataset → Parameters.

Subarea panel

The Subarea panel limits processing to a portion of the dataset.

Subarea panel

  • X — pixel width range, e.g. 1:512
  • Y — pixel height range
  • Z — slice range
  • from Selection — fills X, Y, and Z from the bounding box of the Selection layer
  • Current View — limits X and Y to the visible area in the Image View panel
  • Bin, xtimes: — binning factor XY; Z to downsample before processing (e.g., 2; 1 halves XY resolution)
  • Reset — restores all fields to the full dataset dimensions

Warning

Binning in Object separation mode may produce unpredictable results.


Objects to separate panel

Defines the source layer and separation options.

Objects to separate panel

Source layer (radio buttons):

  • Selection — use the Selection layer as the object source
  • Mask — use the Mask layer
  • Model, select material — use a specific material from the Model layer; choose the material from the dropdown that appears below the radio buttons

Options:

  • — enables seeded watershed; when checked, the Layer with seeds and Watershed source panels appear and Reduce oversegmentation is hidden
  • — (standard watershed only, hidden when Use seeds is checked) applies extended minima suppression to reduce excessive fragmentation
  • Update materials — refreshes the material dropdown lists from the current model

Layer with seeds panel

Layer with seeds panel

(Visible only when is checked)

Specifies the layer that contains the seed markers used to guide the seeded watershed.

  • Selection — use the Selection layer as seeds
  • Mask — use the Mask layer as seeds
  • Model, select material — use a specific material from the Model layer; choose the material from the dropdown below

Watershed source panel

Layer with seeds panel

(Visible only when is checked)

Controls which data the watershed algorithm uses to define catchment basins.

  • Distance map — watershed runs on the Euclidean distance transform of the object mask (default; shape-based separation)
  • Image intensity — watershed runs on the raw image grey values (intensity-based separation; requires seeds). See Steve Eddins's blog on cell segmentation. When Image intensity is selected, two additional controls appear:
    • Color channel — color channel used for intensity-based watershed
    • Signal — polarity of the image signal: white-on-black, signal is bright (fluorescence, light microscopy) or black-on-white, signal is dark (transmitted light, electron microscopy)

Object separation example

The following example separates fused mitochondria using unseeded watershed:

  1. Open Ribbon → Tools → Object separation
  2. Select Mask in the Objects to separate panel
  3. Click Separate objects
Snapshot

Result of unseeded watershed separation

Unseeded watershed can over-segment long objects. To address this, switch to seeded watershed:

  1. Check
  2. In the Layer with seeds panel, select Model, select material and choose the Seeds material
  3. Click Separate objects

Each object with a single seed label is extracted individually (highlighted in green).

Snapshot

Result of seeded watershed separation


Algorithm

Workflow of the object separation algorithm

The diagram above illustrates the step-by-step process of the watershed-based object separation algorithm.


Batch scripting

This tool supports batch scripting for automation.

Example
BatchOpt.Mode          = {'mode3dRadio', {'mode2dCurrentRadio','mode2dRadio','mode3dRadio'}};
BatchOpt.ObjectSource  = {'Mask', {'Selection','Mask','Model'}};
BatchOpt.UseSeeds      = false;
BatchOpt.ReduceOversegmentation = false;
BatchOpt.XSubarea      = '1:512';
BatchOpt.YSubarea      = '1:512';
BatchOpt.ZSubarea      = '1:100';
BatchOpt.Binning       = '1; 1';

obj.mibController.startController('controllers.ObjectSeparator', [], BatchOpt);

References


Back to MIB | User interface | Ribbon | Tools