Marker-controlled Watershed

Marker-controlled Watershed (IJPB-plugins)
Author Ignacio Arganda-Carreras, David Legland
Maintainer Ignacio Arganda-Carreras
Source on GitHub
Initial release July 3rd, 2014
Latest version September 28th, 2016 (MorphoLibJ v1.3.1)
Development status stable, active
Category Segmentation, Mathematical morphology
Marker-controlled flooding on the gradient image of the blobs sample.


Marker-controlled Watershed is an ImageJ/Fiji plugin to segment grayscale images of any type (8, 16 and 32-bit) in 2D and 3D based on the marker-controlled watershed algorithm (Meyer and Beucher, 1990). This algorithm considers the input image as a topographic surface (where higher pixel values mean higher altitude) and simulates its flooding from specific seed points or markers. A common choice for the markers are the local minima of the gradient of the image, but the method works on any specific marker, either selected manually by the user or determined automatically by another algorithm.


Main dialog of the Marker-controlled Watershed plugin

Marker-controlled Watershed needs at least two images to run:

  • The Input image: a 2D or 3D grayscale image to flood, usually the gradient of an image.
  • The Marker image: an image of the same dimensions as the input containing the seed points or markers as connected regions of voxels, each of them with a different label. They correspond usually to the local minima of the input image, but they can be set arbitrarily.

And it can optionally admit a third image:

  • The Mask image: a binary image of the same dimensions as input and marker which can be used to restrict the areas of application of the algorithm. Set to "None" to run the method on the whole input image.

Rest of parameters:

  • Binary markers: select to specify that markers are binary and need to be labeled.
  • Calculate dams: select to enable the calculation of watershed lines.
  • Use diagonal connectivity: select to allow the flooding in diagonal directions.


  • Labeled image containing the catchment basins and (optionally) watershed lines (dams).
Example of marker-controlled watershed segmentation on nucleus of Arabidopsis thaliana (image courtesy of Kaori Sakai and Javier Arpon, INRA-Versailles)


The Marker-controlled Watershed plugin is part of the MorphoLibJ library. To install it, you just need to add the IJPB-plugins update site:

1) Select Help  ▶ Update... from the Fiji menu to start the updater.

2) Click on Manage update sites. This brings up a dialog where you can activate additional update sites.

3) Activate the IJPB-plugins update site and close the dialog. Now you should see an additional jar file for download.

4) Click Apply changes and restart Fiji.

You should now find the plugin under the sub-menu Plugins  ▶ MorphoLibJ  ▶ Segmentation.

Note: Marker-controlled Watershed is only one of the plugins included in the MorphoLibJ suite. By following these installation steps, you will be installing as well the rest of plugins in the suite.


  1. Fernand Meyer and Serge Beucher. "Morphological segmentation." Journal of visual communication and image representation 1.1 (1990): 21-46.
  2. Soille, P., "Morphological Image Analysis: Principles and Applications", Springer-Verlag, 1999, pp. 170-171.
  3. David Legland, Ignacio Arganda-Carreras, Philippe Andrey; MorphoLibJ: integrated library and plugins for mathematical morphology with ImageJ. Bioinformatics 2016; 32 (22): 3532-3534. doi: 10.1093/bioinformatics/btw413

See also


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.