5.C. Combining multiple images of the same area to select features
5.C.1. Boolean logic to apply multiple criteria
Several of the preceding sections have made incidental use of Boolean combinations of images. For different color channels, or images thresholded and processed differently, Boolean logic can combine the information and isolate the structures of interest. The Boolean functions are AND, OR, Exclusive-OR and NOT (equivalent to inverting an image so that black becomes white, and vice versa), which can be combined in many ways. The examples shown illustrate a few of the ways that these operations can be combined. Note that the IP•Math–>General Boolean plug-in treats white (background) pixels as “off” and any non-white value as “on.”
Image A Image B A AND B A OR B A Ex-OR B
A AND (NOT B) NOT (A AND B) (NOT A) AND B (NOT A) OR B NOT (A OR B)
A typical use for these operations is to combine images thresholded from different color channels to select specific regions. The example shows the similar combination of different elemental maps from SEM X-ray images. The thresholded images were cleaned with a morphological closing using a coefficient of 6.
Original Mica_Al image Thresholded for high Al content
Original Mica_Si image Thresholded for high Si content
Silicon AND (NOT Aluminum)
Boolean operations are also useful when the same original image has been processed in multiple ways to isolate different types of information, which are then combined. In the example, two structures (the organelles and the gold particles) are isolated separately, but only those gold particles that lie on organelles are of interest, and are selected with a Boolean AND.
Original Gold2 image Grey scale opening removes gold particles
Original divided by background isolates gold particles, which are then thresholded
Thresholded organelles AND selects gold particles on organelles
The Boolean AND operation is frequently used to combine various types of grids with thresholded binary images as a precursor to measurement. Many of the stereological techniques in Section 6.B use grids as a way to obtain concise and meaningful information about structure. But the use of grids is even more general than that. In the example shown, a vertical section through a coating is prepared for measurement. The most straightforward and efficient way to perform this measurement is to create a grid of vertical lines ( IP•Lines and Points–>Parallel Lines–>Vertical ) with an spacing appropriate to the desired density of measurements, AND it with the coating image, and measure the length of the lines.
Original Coating image Thresholded layer cross-section
Vertical line grid ANDed with layer
As an illustration of the various Boolean operations used in combination, and the way they can be used in conjunction with other binary processes, the multi-step example below addresses a situation in which the watershed segmentation method does not work: features that are hollow and irregular (non-convex) in shape. The image was thresholded to show the sheaths around nerve fibers. The goal is to separate them for individual measurement. One step (F) in the procedure uses a Feature-based AND rather than the Pixel-based AND used in the other examples. The IP•Math–>Select Features by 2nd routine is discussed below. The selection of the feature-crossing lines in step F can also be accomplished by measurement, keeping the longer lines.
This sequence may at first appear to be long and complex, but these Boolean operations are very fast and the entire process is easily automated using an Action. Understanding this sequence is a good test for having an understanding of Boolean operations that lie at the heart of many binary image processing sequences.
A-Original Separate image B-Holes filled
C-Watershed D-Lines (B Ex-OR C)
E- Holes (A Ex-OR B) F- Lines in D selected by features in E
G- Breaks restored (C OR F) H- Features separated (G AND A)