ImageMath

A multipurpose function, ImageMath produces a greyscale or black-and-white output image where every pixel is the result of an arithmetic operation, such as addition, subtraction, or averaging, performed between two input images.

ImageMath Example

In this example, the goal is to produce an output file of only the holes in a gasket. Later, the holes are referenced by another tool so that decisions can be made regarding the holes.

  1. Acquire an image of the complete gasket.

  2. Create an Image 2 to be a copy of Image 1, but with all the white holes filled. To produce this, insert the Filter function into the spreadsheet.

  3. Maximize the ROI in the property sheet by selecting the word Region and clicking the Maximize Region button in the toolbar of the property sheet. Maximizing the ROI ensures that the ROIs of Image 1 and Images 2 are the same size.

  4. Select Fill Light Holes from the Operation dropdown menu.

  5. Accept the default settings of the other parameters and click OK in the Filter property sheet to complete the configuration and apply the function to the input image.

  6. Insert the ImageMath function into the spreadsheet.

  7. Accept A0 as Image 1 in the property sheet. Now, the Filter output image must be referenced as the source for Image 2.

  8. Double-click on Image 2 in the property sheet, which disappears to reveal the In-Sight Spreadsheet spreadsheet.

  9. Click the Image data structure returned by Filter.

  10. Click the OK button on the Job Edit toolbar to confirm the selection and return to the ImageMath property sheet. (The selection can also be confirmed by pressing the Enter key or by double-clicking on the Image data structure.)

  11. Select Differences from the Operation dropdown menu.

  12. Accept the default settings of the other parameters and click OK in the property sheet to complete the configuration for this example and apply the function to the input image. The result is an output image of only the holes in the gasket.