Counting Nuclei (or other features) in an image is a common analysis problem.
File -> Open…
Here’s one I will use:
It’s an image I took of DAPI stained nuclei on the SP5 confocal microscope. Notice it’s not the best image you’ve ever seen of DAPI stained nuclei. It was purposely taken with low laser power and high-ish gain on the PMT to produce an image with higher “noise” than would typically be taken.
2 – Filter to remove the noise.
Process -> Filters -> Gaussian Blur…
Pay with the Sigma(Radius), maybe start with 2 or 3. The idea is to blur out the background “salt and pepper” noise which is actually Poisson distributed, statistical “photon shot noise”, and also to smooth out the inhomogeneity of the nuclear staining. Mouse cells will require higher sigma values as the DNA within the nucleus is much less homogeneous than other mammalian cell types.
Here’s our image after Gaussian blur:
3 – Subtract the background. (Optional, may or may not be required)
Process -> Subtract Background…
Make sure the box marked “Light Background” is unticked. You may have to play around with the “rolling ball” size depending on the size of the features in your image. Essentially you are trying to subtract the background and make it near zero everywhere. The rolling ball method takes into account uneven background due to illumination, detector problems, etc.
Once again, here’s the result of subtracting the background from the previous image:
4 – Set the measurements we will use later for filtering the nuclei.
Analyse -> Set Measurements …
Tick the boxes marked “Area” and “Shape Descriptors”. Then click on the “OK” button
In this step, you’re telling FIJI what measurements to make when, later on in the workflow you choose to “filter” which features to include/exclude in the counting.
5 – Threshold your image.
Image -> Adjust -> Threshold…
In this case, make sure that the box labelled “Dark Background” is ticked. Adjust the sliders so that your features are red coloured, but the rest of the image is not. This is often not possible to achieve perfectly. Don’t worry, we can change this if things go wrong, or adjust other parameters later in the analysis to take this into account. Click on the “Apply” button. This will replace your grayscale image with an “8-bit binary image”. All the “red” pixels will be converted to a value of “255” while all the non red pixels will be given a value of “0”.
6 – Fill in any holes in the nuclei.
Proess -> Binary -> Fill Holes
The next step will not work properly unless your nuclei are without any holes. A few of mine had areas which were below the threshold and so were not counted as part of the “object”, i.e. the nucleus. We can easily get rid of these holes by performing a binary operation to fill the holes in.
6 – Separate “Touching” nuclei.
Proess -> Binary -> Watershed
Here is where things get interesting. Your image should contain segmented nuclei. There may be small ones and large ones (some of the small ones may not be nuclei). One common challenge is that the nuclei are touching. How can we separate them? Use the “watershed” algorithm.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 nuclei should now be separated by lines that are one pixel wide.
7- Now perform the analysis. Here’s where we actually count the nuclei,
Analyze -> Analyze Particles…
In this dialogue box we start to include and exclude our nuclei or features based on their attributes. For example if we set the “Size” to be larger than 1 square pixel (or microns if you’re using a calibrated image), then no particles that are less than 1 square pixel will be counted in the particle analysis. As we’re interested in nuclei, set this parameter to discard the junk particles that are small. Similarly, as nuclei are quite round, we can filter the results to only include those particles which are nearly round (calculated as 4∏*area/perimeter^2 – a perfect circle = 1). To get an idea of what size and how circular the nuclei in your image are, perform the analysis a couple of times and look at the results table. It will show you the measurements you set in step 4. Also – the first column in the results table is the metric that you want, i.e. the number of each particle and the total number of particles in your analysis.
It may not work the first time, but as you change the parameters of each step in this image processing workflow you can tweak the parameters in each step to optimise the results for your particular problem.