Thresholding, Smoothing and Counting Particles
Discrete objects such as particles, cells, filter pores, etc. can be sized and
counted with NIH Image. Start with the original test image, or restore it with
the Revert to Saved
command. To count and size the pores in the filter, enable the bi-level thresholding
mode using Options - Density Slice
(or double-click on the LUT tool) and set the threshold limits in the LUT window
with the LUT tool to 243-254. Do this by double clicking on the LUT tool. A red
band will appear in the color bar, and the corresponding pixels in the image will
appear red. Drag the top of the red band in the color bar with the LUT tool to the top
of the LUT window. Practically all of the image will appear red. Drag the bottom
of the red band with the LUT tool to value 243 - read the values in the Info window.
Now the red areas are associated mostly with the pores of the filter. (Fig. 9)
- Figure 9-- Filter image with pores selected using thresholding (see text).
Note that intensity levels of 0 and 255 are not accessable for thresholding. I.e.,
zero and 255 can't be within the density slice because those entries in the lookup
table can never be colored red. 0 is always white and 255 is always black. This
is intentional, to prevent loosing the mouse, tools, etc. due to thresholding. If an image shows
saturation, either in the black or white, then pixels with values of 0 or 255 might
likely appear within the areas of interest, but not be selectable via thresholding.
If the image has values of 0 that need to be selected, for example, they may be changed to value 1 using the Process - Arithmetic command
twice: 1) Arithmetic - subtract
, then use 1 as the constant to subtract. NIH Image clips results of arithmetic
so that they lie within the range 0-255, so this subtraction results in all pixels
being lowered by one intensity unit, except for the zero valued pixels which are
still zero. Note that this affects the internal pixel values - if the Invert Pixel Values
box is checked, then the values to read are in the parentheses to the right in the
Value: line of the Info window. 2). Arithmetic - add
, then use 1 as the constant to add. This results in all pixel values being restored,
except for the old zero valued pixels, which now have the value 1, along with the
pixels which used to have the value 1. Use the reverse arithmetic sequence to
lower pixels with value 255 down to 254. (Note 1. This can also be done using Process - Fix Colors
.)
Noise in the image causes lots of little red selected areas and some holes in the
red dots representing the pores. Most of the noise in this case can be ignored
by the Analyze - Analyze Particles
command by setting the 'Min Particle Size' to something greater than the area of
the small red dots (such as 10 pixels), and by checking the 'Include Interior Holes'
box. Alternatively, smoothing the image will get rid of a lot of the dots (Fig.
10). Do this with the Process - Smooth
command.
- Figure 10-- Pores in smoothed TEM Filter image selected by thresholding.
When using the LUT tool, holding the option key down will temporarily turn the
red highlights off, allowing for closer inspection of what is being selected.
Double-clicking the LUT tool will toggle the red highlights on and off. The zoom
tool (the magnifying glass) and the scroll tool (the hand) can also aid inspection.
To count the holes, first choose the parameters to be measured by clicking the
appropriate boxes shown in the Analyze - Options
dialog box if desired. The defaults - Area, Mean Density, X-Y Center, and Include
Interior Holes were used here. Invoking the Analyze - Analyze Particles
command and then checking all of its boxes, results in Fig. 11. The numbers by
the pores correspond to the numbers in the table of results, viewed using the Analyze - Show Results
command (Fig. 12). There are various ways to save this table, using the File - _Export...
command (see About NIH Image), for example it can be exported as a text file for
importing into other applications or incorporating into a report
- Figure 11-- Result of Analyze Particles command. Pores are outlined and
numbered.
- Figure 12-- Table of results corresponding to Fig. 11 (only first 25 rows shown),
shown with Show Results command.
Figure 13 shows the thresholded particles rather than the pores. The threshold
levels were set at 1 and 216. Fig. 14 shows the outlined particles. This time, the 'Label Particles' box was not checked.
- Figure 13-- Particles in smoothed TEM Filter image selected by thresholding.
- Figure 14-- Result of Analyze Particles command. Particles are outlined, except
for the one touching the edge at the lower right.
[Index]
[Next]