This Java plugin is able to segment an image using the watershed algorithm by directly flooding graylevel images. This implementation is in contrast with the classical approach working on the distance map image obtaining after thresholding. The grayscale watershed segmentation is useful to segment particles in contact when the model of shape is unknown a priori.
This plugin works with graylevel images containing bright particles on dark background or dark particles on bright background. It accepts stack of images, but the processing is alwasy done slice-by-slice (2D).
To prevent oversegmentation due to the noise, it is better to denoise first the image with appropriate denoising programs: Median filter or Gaussian blurring are the simple way to do it, more sophisticated filters like Bilateral Filter or edge-perserving filters can give better results. This plugin includes a Gaussian blur filter.
This plugin applies the watershed flooding algorithm which can be interrupted to a user-specified level. Each particle should have a local maximum (or local minimum when the objects are dark) to define a catchment basin. It has various kind of outputs to display the "dams" of the watershed or the "catchment basins" of the watershed. It also includes a fancy colorized animation which helps to understand the flooding process.
Note on the 3D implementation: The watershed alogrithm can be also implemented for isotropic 3D dataset. An example of application for granulometry is shown in the paper of Tsukahara and al. (2009). Nevertheless, the 3D version of the watershed is not provided in this plugin. It is very slow and requires a huge amount of memory.
The software provided here is a plugin for ImageJ, a general purpose image-processing and image-analysis package. It runs also on the image-processing package Fiji. ImageJ has a public domain licence; it runs on several plateforms: Unix, Linux, Windows, and Mac OS X. It doesn't take more than a couple of minutes to install.
We have also a demonstration of this algorithm running on any browser that supports Java.
Patchwork of results obtain with the plugin