Difference between revisions of "Nuclei Watershed Separation"

(added screen shot for segmentation results.)
(reformatted headings etc.)
Line 1: Line 1:
A very common biological sample for microscopy is DAPI stained DNA in cell nuclei. The staining delineates the nuclei pretty well,  
+
=== 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,
 
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.
 
as there are areas of more or less condensation of the chromosomes.
Line 11: Line 14:
 
making it harder to segment properly.  
 
making it harder to segment properly.  
  
So, we are faced with the probelm of being able to separate apparently touching, noisy, objects :-(
+
* 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.  
+
* Luckily, there is a method for doing exactly that. The Watershed method.  
  
Ok, so how can we denoise, segment, watershed (separate touching objects)
+
* Ok, so how can we denoise, segment, watershed (separate touching objects)
 
and then count / measure the objects in FIJI? Read on...
 
and then count / measure the objects in FIJI? Read on...
 +
 +
=== Open the sample image ===
  
 
* open the [http://pacific.mpi-cbg.de/wiki/images/8/83/NucleiDAPIconfocal.png sample image of DAPI stained nuclei from a confocal laser scanning microscope]:
 
* open the [http://pacific.mpi-cbg.de/wiki/images/8/83/NucleiDAPIconfocal.png sample image of DAPI stained nuclei from a confocal laser scanning microscope]:
Line 24: Line 29:
 
and also to smooth out the inhomogeneity of the nuclear staining. We will use a large sigma vaule of 3 for this task.  
 
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.
 
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 object will be too blurred, making ti harder to separate them later.  
+
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.
 
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:
 
You should get an image that looks like this:
Line 30: Line 35:
 
[[Image:NucleiDAPIconfocalGauss3pxSigma.png | 250px]]
 
[[Image:NucleiDAPIconfocalGauss3pxSigma.png | 250px]]
  
* Next we need to segment the objects from the background. FIJI has a number of built in automatic thresholding methods
+
=== 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,  
 
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.  
 
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!
 
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!
+
* 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.
 
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.  
 
If you are happy with the automatically calculate threshold, then click "Apply", which will give you a binary image.  
Line 42: Line 49:
 
[[Image:NucleiDAPIconfocalAutoDefaultThresh.png | 250px]]
 
[[Image:NucleiDAPIconfocalAutoDefaultThresh.png | 250px]]
  
So far so good... But we still don't have objects... only background and foreground pixels.  
+
* 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.  
 
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:
 
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.
 
* To run the watershed method choose menu item Process - Binary - Watershed.
Line 55: Line 65:
 
[[Image:NucleiDAPIconfocalWatershed.png | 250 px]]
 
[[Image:NucleiDAPIconfocalWatershed.png | 250 px]]
  
Notice how the nuclei have been split away from each other.  
+
* Notice how the nuclei have been split away from each other.  
 
This method only works robustly for roughly circular objects. Why?
 
This method only works robustly for roughly circular objects. Why?
  
* Analyse the segmented objects.
+
 
Now you have a set of white foreground patches of white pixels, surrounded by black background pixel areas,  
+
=== 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.  
 
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.
+
* Next we must run the Analyze Particles tool in FIJI to locate patches of white pixels and count them.
that tool needs a threshold to be set on the image, so again, do Image - Adjust - Threshold.
+
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,  
 
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).  
 
and the objects appear in thresholded red (for black background again of course).  
  
Now choose menu item Analyze - Analyze Particles,  
+
* Now choose menu item Analyze - Analyze Particles,  
 
using the settings in the screen shot below:
 
using the settings in the screen shot below:
  
 
[[Image:NulceiDAPIconfocalAnalyzeParticles.png | 500px]]
 
[[Image:NulceiDAPIconfocalAnalyzeParticles.png | 500px]]
  
You can filter out different sizes of particles. for example, you might only be interested in large objecxt,  
+
* 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.  
 
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.  
 
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
+
* 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.  
 
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.
+
* 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,
 
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.
 
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.  
+
* 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.  
 
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?
 
Can you figure out how to do that?
  
It also spits out lots of useful statistics:  
+
* It also spits out lots of useful statistics:  
  
 
[[Image:NulceiDAPIconfocalSegmentationResults.png]]
 
[[Image:NulceiDAPIconfocalSegmentationResults.png]]

Revision as of 04:21, 16 July 2009

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

NucleiDAPIconfocal.png

  • 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:

NucleiDAPIconfocalGauss3pxSigma.png

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:

NucleiDAPIconfocalAutoDefaultThresh.png

  • 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:

NucleiDAPIconfocalWatershed.png

  • 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:

NulceiDAPIconfocalAnalyzeParticles.png

  • 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:

NulceiDAPIconfocalSegmentationResults.png