Watershed segmentation

Watershed is the term that commonly refers to a mathematical morphology operation that treats a grayscale image as a topographic map and segments the image. The segmentation is performed by a succesive 'flooding' operation from minima in the image starting from different points and separates the image in different catchment basins.|Needs a comment about the relation between the Watershed and Region growing.

Watershed transformation
Watershed-based segmentation

The interactive Watershed Fiji plugin provides an interactive way to explore local maxima and threshold values while a resulting label map is updated on the fly.

After the user has found a reliable parameter configuration, it is possible to apply the same parameters to other images in a headless mode, for example via ImageJ macro scripting.



In this workflow, you can use MorphoLibJ to generate accurate morphometric measurements

  • First the fibers are segmented by mathematical morphology:
    • for example by using MorphoLibJ:
      • Create a marker image by creating a rough mask with extended regional maxima (similar to Find Max), such that you have one max per fiber
      • Use the marker controlled watershed (in MorpholLibJ/ Segmentation/ marker controlled watershed) : indicate the original grayscale image as the input, Marker will be your maxima image, select None for mask
      • it will create a label mask of your fibers
  •  In MorphoLibJ /analyze/ select Region Morphometry: this will compute different shape factors which are more robust than the ones implemented by default in ImageJ
  • Export the result table created to a csv file
  • Then for example in Matlab or R, you can apply a PCA analysis (Principal component analysis) followed by a k-means with the number of class (clusters) (different fibers type) you want to separate.
  • You can then add this class as a new feature to your csv file.
  • From this you can sort your labelled fibers into these clusters for a visual feedback or further spatial analysis
has topic
hemp analysis

MorphoLibJ is a library of plugin for ImageJ with functionalities for image processing such as filtering, reconstructing, segmenting, etc... Tools are based on Mathematical morphology with more rigorous mathematical approach than in the standard tools of ImageJ in particular for surface (or perimeter) measurements which are usually based on voxel counting.  


Among the features:

Morphological operations :  Dilation, Erosion, Opening,  Closing , Top hat (white and black), Morphological gradient (aka Beucher Gradient), Morphological Laplacian, Morphological reconstruction, Maxima/Minima , Extended Maxima/Minima -Watershed (classic or controlled) -Image overlay -Image labelling -Geodesic diameter -Region Adjacency Graph -Granulometry curves, morphological image analysis.


several steps of morphological segmentation of plant tissue using MorphoLibJ.

Adiposoft is an automated Open Source software for the analysis of adipose tissue cellularity in histological sections.

Example data can be found on the plugin description page in ImageJ wiki (download link). There is also a link to a MATLAB version of the workflow.

has topic