Nuclei Watershed Separation

Revision as of 05:21, 16 July 2009 by White (talk | contribs) (reformatted headings etc.)

Watershed Segmenation of touching DAPI stained nuclei images -Tutorial

  • A very common biological sample for microscopy is DAPI stained DNA in cell nuclei. The staining delineates the nuclei pretty well,

since in a metaphase cell there is DNA all over the nucleus. however, the staining is not homogenous, as there are areas of more or less condensation of the chromosomes. This makes the nuclei appear granular. Worse still, in may tissues that are interesting for developmental biology, the cells are tightly packed, and are composed mostly of nucleus with very little cytoplasm separating them. The nulclei often seem to touch each other, which in reality, of course, they can not. There is a membrane or two at least between them, but an optical microscope cant resolve that. The PSF is much bigger then the width of a membrane! Just to make matters even worse the image is quite noisy, because it was made with a fast scan on a confocal laser scanning microscope, which inherently has a low signal/noise ratio. That gives objects fuzzy edges and adds uncertainty to the intensity vaules of each pixel, making it harder to segment properly.

  • So, we are faced with the probelm of being able to separate apparently touching, noisy, objects :-(
  • Luckily, there is a method for doing exactly that. The Watershed method.
  • Ok, so how can we denoise, segment, watershed (separate touching objects)

and then count / measure the objects in FIJI? Read on...

Open the sample image


  • Run a Gaussian Blur filter on the image to blur out the photon shot noise (the "speckle", actually poisson distributed),

and also to smooth out the inhomogeneity of the nuclear staining. We will use a large sigma vaule of 3 for this task. A value of sigma too small will mean that the segmentation will be disturbed by the noise and staining pattern. Too high a sigma value, and the objects will be too blurred, making it harder to separate them later. Run menu command: Process - Filters - Gaussian Blur, with a sigma value of 3 pixels. You can preview other values to see how they look also. You should get an image that looks like this:


Pixel Intensity Threshold - find the foreground areas

  • Next we need to separate the objects from the background using pixel intensity thresholding . FIJI has a number of built in automatic thresholding methods

that try to distinguish the background from the foreground. In this case the default method works pretty well, but you can see there is a long list of methods, which give slightly different threshold results for this image. You can play with different methods if you like. You might get a different answer in the end!

  • Do menu command Image - Adjust - Threshold. Turn on the check box for "Dark background" . Indeed, in this case the background is dark!

The default method will be perviewed automatically when you launch the menu command, and a threshold will be set, something close to 100 intensity. If you are happy with the automatically calculate threshold, then click "Apply", which will give you a binary image. Black is background, and white is foreground. It should look like this:


  • So far so good... But we still don't have objects... only background and foreground pixels.

Also it is clear that some nuclei are connected to adjacent ones... and we want them to be separated. We will use the watershed method built into FIJI for that:

Watershed algorithm - separate touching objects

  • To run the watershed method choose menu item Process - Binary - Watershed.

This method finds the centre of each object (using a morphological erode operation), then calculates a distance map from the object centre points to the edges of the objects, then fills that "topological map" with imaginary water. Where 2 "Watersheds" meet, it builds a dam to separate them! One could do all these steps manually, but the watershed function automates that for you, which is nice. Your watershed image should look like this:


  • Notice how the nuclei have been split away from each other.

This method only works robustly for roughly circular objects. Why?

Analyze the segmented objects

  • Now you have a set of white foreground patches of white pixels, surrounded by black background pixel areas,

and we have separated touching objects wit a watershed, which put "dams" one pixel wide between the objects.

  • Next we must run the Analyze Particles tool in FIJI to locate patches of white pixels and count them.

But... that tool needs a threshold to be set on the image, so again, do Image - Adjust - Threshold. Since the image now contains only 0 and 255 intensities, the threshold default is of course correct, and the objects appear in thresholded red (for black background again of course).

  • Now choose menu item Analyze - Analyze Particles,

using the settings in the screen shot below:


  • You can filter out different sizes of particles. for example, you might only be interested in large objecxt,

like nuclei. So you can exclude small objects that you know are junk. Change the area number rage in the Size field and see what happens.

  • You can only choose to count objects that are very circular by changing the Circularity range numbers

to say 0.8-1. Play with it, see what it does.

  • Use show outlines, or test the other options there if you like. Exclude on edges is very smart.

It means you don't get nonsense results from objects that are chopped off ast the edges of the image, and as such are of course smaller than they really are.

  • You can add all the objects to the ROI manager, by turning on Add to Manager.

Then you could use those ROIs to measure the intensities of the signal in the objects of the original image. Can you figure out how to do that?

  • It also spits out lots of useful statistics: