Particle analysis

A potentially useful task in many imaging fields, especially in microscopy, is the automatic detection and measurement of the particles present in a given image. Consider the following one, taken from the original set of tuberculosis images that we have presented previously (tuberculosis_full.tif):

Particle analysis

Note that the zoom level has been reduced to show the whole image on the page. If you open that image on ImageJ, you can see that there are many small green objects: those are the Mycobacterium tuberculosis bacilli, and we want to count them. How many of them are there in the image? One way of accomplishing that task is to count them manually. That can be hard even for a single image, and think about having to count hundreds of them. So, let's see if we can get ImageJ to do the job for us.

In the first place, note that this is an RGB color image. When we run the cursor over the image, a triplet of values is shown on the status bar on the main window (one for each Red, Green, and Blue values, with 8 bit to encode each one). As the bacilli are very bright in the green dimension, it would be good to analyze only that channel. We can do this in the following two ways:

  • Navigating to Image | Color | Split channels takes the original color image and creates three new grayscale images, each one with the intensity value corresponding to each color in the original one
  • Navigating to the Image | Type | RGB stack accomplishes the same but creates a single stack with three slices, one for each color

We will be using the second method in this exercise, but you can try replicating what we did with the first one. If you try it and move through the slices, you can see how the different colors are codified. The bacilli are much brighter in the second slice, which, as is to be expected, belongs to the intensity of the green color.

We now stick to this slice and remove the image background. That is done by navigating to the Process | Subtract Background... menu option. We have selected the following parameters:

Particle analysis

What this command does is that it removes all the background elements and sets the background pixels to a value as close to 0 as possible, while leaving intact the brightest particles. When we click on OK, the following dialog will show up:

Particle analysis

It is common for many ImageJ commands to ask the user whether the selected operation must be applied to the whole stack or only to the active slice. In this case, we do not really want to apply the operation to the red and blue slices, so we click on No. If we click on Yes, the operation will take a bit longer, but there will be no difference in the final result.

So now we have the green intensity of the image clear, without the background elements that might mislead us. Now we need to threshold the image to use the automatic particle analyzer. We have chosen the "Moments" automatic method by navigating to Image | Adjust | Threshold (Ctrl + Shift + T), as it yields a very good result for this particular case. Do not use the Stack histogram option, as we want to use only the green color's information for thresholding. We close the image (check that the threshold has been applied) and then navigate to Analyze | Analyze Particles with the following options:

Particle analysis

This tool will automatically count all the elements in the image that have a size and shape within the given range. The Size (pixel^2) label allows the user to introduce a range of pixel areas in the form (minimum-maximum, and maximum can be infinity). The Circularity label asks for the shape of the object, with 0.0 being a line, and 1.0 a circle. We have made preliminary measurements using the wand tool on different bacilli and we have seen that those ranges are appropriate for detecting most of them.

After clicking on OK, you will get the following screenshot:

Particle analysis

You can see the thresholded slice (using the Red scheme), and every detected particle has been added as an enumerated overlay. Also, you will have a Results window that displays the measured parameters as follows:

Particle analysis

So, how many particles are there in the image? Answer: 101 (more or less, considering the bacilli that are not detected by our method and some false positives for particles that are detected but should not, that are inevitable with any automatic method).

As you can see, this analysis, though faster than the manual method, took us a while. However, ImageJ offers some tools that allow more task automation. Let's advance to the next chapter for some macro programming (even if you are not a programmer).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset