GC Image Users' Guide

Pattern Recognition

GC Image has tools for creating and using templates of blob patterns observed in previous image(s) so that similar patterns of blobs in subsequent image(s) can be recognized. Once recognized, the metadata (including chemical name, group name, and internal standard association) for the blobs in the target image can be set from the template.

The template matching process proceeds in three steps:

  1. Create (or load) a template. This step defines the pattern of peaks and graphical objects, with associated metadata, that will be matched.
  2. Match a template to the blobs in an image. This step illustrates the result of matching the template peaks to the blobs in the image, but the blobs in target image are not changed in any way. This step just provides a visualization of the matching. If the matching is not satisfactory, it is possible to re-configure the parameters of the pattern matching algorithm or to return to the previous step and edit the template, and then to repeat the matching step.
  3. Apply a template to the blobs in an image. Once a satisfactory match is achieved, the metadata from the blob is applied to the image. Note that even after this step, it is possible to modify the metadata of the target image. GC Image has tools that facilitate such changes.

Creating and Viewing Templates

A template consists of peaks and graphics, each with essential metadata. Initially, an image has no template. A template can be instantiated in an image either by interactive operations to create a template or by loading a template. This section describes several tools in GC Image for interactively creating and editing templates. The next section describes how a template, once created, can be exported and then later imported to be used with other images. So, although the process of creating a template can be time-consuming if many chemicals require identification, a user may re-use a template for many images.

Templates consist of two types of objects: peak objects and graphics objects. Peak objects consist of: the retention time for each separation dimension, the chemical name, the group name, the constellation name, the inclusion flag, the internal standard flag, and the exclusion flag. Graphics objects consist of: the specification of the graphic object in the separation plane, the display color, the graphic name, and the inclusion flag. (An exclusion flag will be added soon.)

Selected peaks in an image can be added to the template of the image. First, select blob mode from the palette and select the blobs whose peaks are to be added to the template. (Metadata such as chemical name, etc., also should be set, as desired.) Then, click the Add to template button. Template peaks must have unique retention times, so if a template has an existing peak at the same retention times, then the new peak will not be added and a message will be displayed in a popup.

Selected graphics in an image can be added to the template of the image. First, select graphics mode from the palette and select the graphics to be added to the template. (Metadata such as graphic name, etc., also should be set, as desired.) Then, click the Add to template button. Template graphics must have unique retention times, so if a template has an existing graphic with the same specification in the separation plane, then the new graphic will not be added and a message will be displayed in a popup.

The Image Viewer palette has a button to set the cursor mode to template mode. Next to the template cursor-mode button, there is a pull-down template mode selector. The selectable template cursor modes, illustrated in Figure 1, are:

The user actions for selecting and drawing template objects are the same as for the corresponding graphics objects, as described in chapter Graphics. The Draw Template Peak is performed as drawing a point.

Figure 1: Template cursor modes.

Template peaks and template graphics are displayed in template mode. Template blobs are displayed as unfilled circles and are color coded by class (included, internal standard, etc.). Template graphics are displayed with color-coded lines that are dashed, so they can be distinguished easily from image graphics if image graphics are displayed in template mode. The Template Matching panel, which is accessible from the Configure->Configure Settings interface, allows setting of visibility options and default colors for template objects. Figure 2 illustrates the graphical display for template objects. As is typical, the template peak locations in this example are slightly different than the locations of the blob peaks.

Figure 2: Graphical display of an example template.

Selecting and Editing Templates

By default, the template cursor mode is Select template object. In this mode, when the cursor is positioned over an existing template object (either template blob or template graphic) and the left mouse-button is clicked, the indicated graphic is selected. When selected, a template object is highlighted with handles at the knots (e.g., vertices of polygons and the locations of peaks). Multiple template objects can be selected with successive control-clicks with the left mouse-button. All template objects can be selected by choosing "Edit->Select All" in template mode. The Delete / Exclude Object button on the palette deletes selected template objects, if it is pressed while in template mode.

The handles of selected template objects can be used to relocate knots by using click-and-drag with the left mouse-button. A selected template object can be translated in-full by click-and-drag with the left mouse-button, beginning in the interior of the object. Multiple selected template objects also can be relocated using click-and-drag with the left mouse-button.

When a template object is selected, clicking the right mouse-button brings up a template object metadata popup, in which metadata, such as the name, can be assigned. When multiple template peaks or multiple graphics are selected, clicking the right mouse-button brings up a popup for shared metadata. These metadata popups resemble the metadata popups for blobs and graphics. (No shared metadata popup is available if both peak and graphic objects are selected.)

Saving and Loading Templates

To save blob template, select the Save Template option from the File menu. The template is stored as a text file tagged using an eXtensible Markup Language (XML) schema. A saved template will contain all of the objects in the template, with metadata.

To load a template, select the Load Template option from the Filter menu or click the Load Template button. The Load Template dialog provides access to a browser that allows the user to view the template before loading (i.e., without modifying the image template). The Load Template dialog also allows the user to specify whether the selected template file is to be used to over-write the current template or is to be added to the current template. Template peaks and graphics must be unique, so any conflicting objects will not be added and a message will be displayed in a popup. Figure 3 illustrates the Load Template dialog.

Figure 3: The Load Template dialog.

Matching and Applying Templates

GC Image can match template peaks to detected blobs in the image. Match Template is initiated from the Filter menu on the Image Viewer or with the Match Template button. The template peaks are matched by a search algorithm that attempts to establish geometrically consistent correspondences between peaks in the template and blobs in the image. The template matching algorithm searches for a translation (i.e., horizontal and vertical shift) and scale (i.e., horizontal and vertical resizing) of the template that aligns it with target peaks. Then, only target peaks within a set distance threshold of each template peak are matched. The algorithm can be parameterized via Configure->Configure Settings on the Image Viewer menu bar. The parameters are the half-width and half-height of the translation search window (about 0.0), the half-width and half-height of the scale search window (about 1.0), and the horizontal and vertical distance thresholds for matching a template peak and target peak. Figure 4 illustrates the Template panel in Configure Settings.

Figure 4: The Template configuration panel.

Match Template provides a visualization of the matching, but the image is not updated (e.g., blob metadata are not changed). Figure 5 illustrates the result of matching the template peaks to the image peaks. Template peak matches are shown as color-filled circles at the matched location.

Figure 5: The matching algorithm matches the template peaks to the image peaks and graphically highlights the matched locations with filled circles.

If the algorithm failed to match all peaks, a popup reports the number of the total template elements applied to the image and the names of the template elements that were not applied. If the template matching algorithm does not yield satisfactory results, the user has two options:

A largely correct, but imperfect match can be corrected interactively after the template is applied.

Once a satisfactory match is achieved, the metadata from the blob is applied to the image with the Apply Template option from the Filter menu or with the Apply Template button. Applying the template causes the metadata from the template peaks to be copied into the corresponding blobs (as determined by template matching). Also, template graphics are translated as determined by template matching and are copied with their metadata into the image. Figure 6 illustrates the result of applying the template metadata to the matched image blobs. Figure 6: After the template is applied to the image, the metadata of the matched peaks is set with the template metadata.

Note that even after applying the template, it is possible to modify the metadata of the blobs in the target image and the graphics objects in the target image. GC Image has tools that facilitate such changes. GC Image has tools that are especially useful for correcting mismatched blobs. The Image Viewer menu and tool bar provide access to Cut Metadata, Copy Metadata, and Paste Metadata. These allow the user to quickly transfer metadata from a misidentified blob to the correct blob. The blob must be selected with a blob selection tool before the blob metadata can be cut, copied, or pasted. Also, blob metadata can be set directly as described in chapter Detection and Analysis and graphics can be edited as described in chapter Graphics.

Contents       Previous: Detection and Analysis       Next: Configuration Files

GC Image™ Users' Guide © 2001–2004 by GC Image, LLC, and the University of Nebraska.