Histogram Operations

Histogram operations

The range of pixel intensities in an image can be viewed and manipulated using the Histogram function in image processing programs. In an image the total range of pixel intensity values represents the dynamic range of the detection device and contrast of that image. By mapping the intensity values as a histogram, you can expand or contract the values in the image (for example) to fall within a limited range of intensities, or expand a low-contrast image intensity range to the full 0-255, thus increasing the overall contrast of the image.

Figure 3. Histogram of a medium contrast image. The grayscale value range of 10-119 includes the range of values of the dark inclusions in Figure 5.

Figure 4. Histogram operation to increase the range of grayscale values in a low-contrast image.

Modifying the image intensity histogram can result in a similar image as when the LUT is changed. However, this process of normalization expands the grayscale range linearly whereas modifying the LUT can weight different intensity values as a non-linear function (cf. Figure 2 and Figure 3).

Thresholding and the Region of Interest

In order to measure a morphometric parameter within an image (area or counting for example), the computer program needs to distinguish wanted from unwanted areas. This 'Region of Interest' or ROI usually is determined on the basis of pixel intensity values or user-determined areas (by drawing and subsequent masking). The process of separating objects of interest from uninteresting objects is called segmentation. When images are segmented on the basis of intensity the user defines a range of pixel intensity values that encompasses interesting objects. When the user defines a gray-scale intensity value, above which the object(s) lie and below which encompasses the background, the image is said to be thresholded, and the process is referred to as thresholding. If the objects of interest have a median range of intensity values, defining a slice of possible intensity values between 0 (black) and 255 (white) can segment the image and separate the objects from background. The range of ROI intensity values is often referred to as a Density Slice.

A segmented image based on thresholded intensity is literally separated into uninteresting from interesting pixels. Once segmented, the pixels of the image can be reassigned the intensity values of either 0 (uninteresting) or 1 (interesting). In this operation geometry within the remains the same, however the grayscale image is transformed into a binary image consisting of only intensity 1 or 0. Determining morphometrics is a process of counting adjacent pixels with a value of 1 and ignoring those with a value of 0. If intensity values are required, then the binary image can be used as a mask to overlay the original image exposing only the ROI pixels. Once masked, the image intensity values underneath can be obtained.

Morphometrics

Gathering spatial information from an image is called morphometrics; examples of which are length, width, and counting. Obtaining these measurements from analog images can be as tedious as cutting out the image and weighing it. In this case the ratio between the sample and a standard yields the area. In a digital image morphometrics can be obtained by instructing the computer (through an image analysis program) to count pixels between structures (for linear measurements) or the number of pixels within a structure (for area measurements).

Figure 5. Segmented image based on threshold.

Figure 6. Area of ROIs determined using segmentation.

ROI
Area
Mean density
1.
1072.00
200.55
2.
83.00
163.71
3.
505.00
180.29
4.
11.00
155.27
5.
12.00
151.17
6.
93.00
179.27
7.
176.00
170.55
8.
14765.00
172.20
9.
1558.00
184.09
10.
163.00
167.73

 

Procedure using NIH Image

  1. Double-click on the LUT Tool (or choose 'Density Slice' from the Options menu to enable thresholding.
  2. Use the LUT tool to move the upper and/or lower threshold boundary until the regions are segmented (highlighted in red).
  3. Select Analyze:Options and put a check in Area, Wand Auto Measure, and Headings.
  4. Select Analyze:Analyze Particles. Check the options as per the following image. Increase the number in the min particle size field to remove background noise.

  5. Click OK and NIH Image will analyze the segmented image and return the image shown in Figure 6 above.