Display and Contrast Enhancement

Problem: The image in Figure 1 has low contrast except for the dark particles. When images are not pre-scaled for display, the contrast and brightness need to be adjusted, much as on any electron microscope. This can be done in a variety of ways, such as dragging the dots or sliders in the Map window, or invoking the Process - Enhance Contrast or Process - Equalize commands. (Note that the Process menu was named Enhance in versions of NIH Image earlier than 1.56.) Invoke the Enhance Contrast command, which works on the front image window (there is only one image window activated so far in this session) by selecting the Enhance Contrast command from the Process menu and letting up on the mouse. The result is Fig. 2 -- the ordinary linear contrast enhancement, which uses the full available brightness range (0 - 255) to display the image. Note that when the enhancement was done, the LUT and Map windows changed also.

Contrast enhancement can also be done by using the mouse to move the B (brightness) and C (contrast) sliders in the Map window, by moving any of the three dots on the graph in the Map window, or by selecting the LUT tool and manipulating the color bar in the LUT window.

fig-2

Figure 2-- TEM filter sample image in Fig. 1 with linear contrast enhancement as done by the Process - Enhance Contrast command. Note that the slope of the line in the Map window has increased, the black to white region in the color bar (LUT window) is shortened, and that more of the particles with less contrast and more of the filter substrate can be seen.
The actual pixel values of the image have not been changed at this point - only the LUT values which are used to display them. The other option is to change the pixel values, and use the original linear LUT. This can be done using the Process - Apply LUT command and is necessary if the image is to be combined with another image with a different LUT. The appearance of the image will not change after using Apply LUT , but the color bar in the LUT window will change back to the original ramp, and the graph in the Map window will change back to the diagonal straight line.

A more severe enhancement is performed using the Process - Equalize command. This can be done immediately (if you have not just used Process - Apply LUT ) because the image pixels are unaffected, and only the look up table is changed. It is not necessary to revert to the original image (with the Revert To Saved command). Equalization divides the pixels of the image as evenly as possible among all the brightness intervals. In other words, each gray level is used to display about the same number of pixels. This has the effect of bringing out detail in the background or larger areas of the image, while loosing contrast in the small features (Fig. 3). Now the thinner particles are evident, the pores of the filter are obvious, but detail is lost inside the particles. Note from the Map window that this enhancement (for this particular image) can be approximated with linear contrast enhancement by noting the position of the curve, clicking in the Map window, and then moving the line to about the same position.

fig-3

Figure 3-- Filter sample image with histogram equalization.
The LUT can be shaped by hand with NIH Image - hold down the option key and move the cursor around the Map window, holding the mouse button down. A example is shown in Fig. 4, where the image was first contrast enhanced with the Process - Enhance Contrast and the Process - Apply LUT commands. The option key was then held down while drawing the curve in the Map window with the mouse.

fig-4

Figure 4-- Filter sample image with hand drawn LUT.
To restore the image, use either File - Revert to Saved , which will read in the original file again, completely restoring the image, or Options - Gray Scale , which resets the LUT only .

Another enhancement procedure that works well on this image is to take the logarithm of it using the Process - Arithmetic - Log command, then switch to a false color LUT using Options - Color Tables - Fire-1 command. The Log operation does affect the image pixels, which is what is desired because the Fire-1 LUT is applied next to the new values. This LUT is also called a thermal scale (Fig. 5), and is one of the most intuitive false color scales.

fig-5

Figure 5-- Thermal scale enhancement. Logarithm of filter image (Process -Arithmetic - Log command) false colored with the thermal scale (Options - Color Tables - Fire-1 command).
fig-6
Figure 6-- a) Histogram of original image. Observe using the Revert To Saved command and then the Analyze - Show Histogram command. b) Histogram of Logarithm image. Observe using the Process -Arithmetic - Log command and then the Analyze - Show Histogram command.

The changes in the pixel values can be seen easily by looking at the histogram before (Fig. 6a) and after (Fig. 6b) the log operation, using Analyze - Show Histogram . The changes in pixel values will also be seen in the Info window, as the cursor is moved around the image, but they will be less obvious because the logarithms have been rescaled to integer values (actually 8 bit byte values) between 0 and 255, which is the same value range that the original image had.

An additional comment on color scales: after switching to the finder or another application, especially with the 'Load System LUT when Switching' preference checked, the LUT might look as it does in Fig. 7. This LUT, the system LUT, renders the current image meaningless, but it is used to display color photographs and drawings with images designed to use it. Generally, the limitation of 256 colors means that images are displayed with proper colors, or the finder icons and menus are displayed with proper colors, but not both. This behavior is affected by the "Load System LUT when Switching" box which is accessed by the Options - Preferences... command. When the box is checked, then the image and color bar will assume crazy colors (due to the system palette) when in the finder, but the icons of the finder will appear normally. If the box is not checked, then the image will appear correctly, the LUT may have a few scattered colors, and the finder icons will be black and white. The image and color bar are restored to their original appearance when switching from the finder back to NIH Image. When the monitor is set to other color settings, such as millions of colors, the image and color bar may not be automatically restored. If the grayscale image is not restored on switching back to Image, or if you have modified the color scale in some way, do it manually with the Options - Grayscale command.

fig-7

Figure 7-- Filter image shown with system LUT. This is rarely useful for analysis, but sometimes occurs upon switching to and from the Finder.

[Index] [Next]