# 5.7 Viewing and Profiling Matrix Data

## Matrix Data: Data Mode and Image Mode

Matrix data can be viewed in Data Mode or Image Mode. You can switch from data mode to image mode by activating the matrix object and selecting View: Data Mode or View: Image Mode from the main menu.

The ability to toggle between these two modes lets you, for instance, perform computations and generate a matrix of data and then switch the view to image mode to view the data as an image. Data in a matrix can also be plotted as an Image Plot. This displays the data as a 2D plot where each matrix cell corresponds to a "pixel" in the graph.

Note that when you are creating a Profile Plot from matrix data, it does not matter whether the matrix is in data view mode or image view mode.

## Image Thumbnails and Slider

• Individual matrix objects can viewed as image thumbnails in the selector region of the matrixsheet.
• Alternately, you can view individual objects in the data portion of the matrix window by enabling and manipulating a slider control. If the matrix is being viewed in data mode, the slider will display objects as data. If viewed in image mode, the slider will display each object as an image.

### In the user interface

The easiest way to show the selector region and toggle between thumbnails or slider control is using Mini Toolbar buttons that are available when you hover on an active matrix window.

To display thumbnails:

1. Right-click on the matrix window title bar and place a check mark beside Show Image Thumbnails.

To replace the thumbnail image view with the slider:

1. Hover in the selector area where the thumbnails display; or in the gray area just to the right of your matrix image. When the pointer displays the Mini Toolbar icon, click to show the toolbar, then click the Slider or Thumbnails button.
2. To revert to display of image thumbnails, click the button again.

Note that you can disable display of both thumbnails and slider by clicking the Image Selector button located just to the left of the Slider or Thumbnails button on the Mini Toolbar.

### In LabTalk script

See documentation of the wbk.selector and wbk.slider object properties.

## Profiling Matrix or Virtual Matrix Data

You can create profile plots from matrix data or from worksheet data that are arranged in a virtual matrix. Once you have created apProfile plot, you can generate cross-sectional profiles of your plot, along vertical lines, horizontal lines or arbitrarily-placed lines:

1. Activate the matrix containing the data to be profiled. If you are working with virtual matrix (worksheet) data, select your data range.
2. Select Plot: Profile: Contour Profile / Image Profile. If the active window is a matrix, a profile plot is created and the Image/Contour Profile dialog box is opened. If the active window is a worksheet (virtual matrix) and you have selected your worksheet data, the plotvm dialog box will open, wherein you will specify how to treat the worksheet data as a virtual matrix. Upon clicking OK, a profile plot is created and the Image/Contour Profile dialog box is opened.
 Note: Your Profile plot may display a "Speed Mode is On" message. This indicates that your data were selectively plotted. You can modify or disable Speed Mode settings. See, Speed Mode, Skip Points if Needed.

## Image/Contour Profile Dialog Controls

The Image/Contour Profile dialog box opens when the Profile plot is created:

• Close the dialog box by clicking the button.
• Open the dialog box by clicking the button in the upper-right corner of the Profile graph page.

### Toolbar Buttons

 Specify whether to delete the profile graphs and data after the Image Profile dialog is closed. Add a vertical profile line. Vertical profile lines are added to the graph layer to the right of the source plot. Add a horizontal profile line. Horizontal profile lines are added to the graph layer above the source plot. Add an arbitrary profile line. Arbitrary profile lines are added to the graph layer above and to the right of the source plot. Places a movable, duplicate line at the position of the active profile. Deletes the active profile. If the profile is the only one in the layer, the layer is simultaneously hidden (see below). Arrange the profile plots and the source plot in a composite graph. Layers without data are not shown this mode. A toggle that Extracts the profile plots to separate graph windows or recombines plots into a single composite. This button is enabled only when the profile plots are plotted to separate graphs. When this button is clicked, the profile graph that corresponds to the active tab will become active. Go to the profile dataset of the active tab. This button opens the Default Settings dialog. Profile Plot Type: Change plot types for vertical, horizontal and arbitrary profiles. Options are line (default), scatter and line+symbol. Legend Preferences: Applies to current and future added profile plots. Choose the profile plot width, position value or profile line name to show in the legend. Profile Line Name will set Legend Custom Format to @LC. Profile Quantity: Choose default statistic used for Profile Quantity (see below). Show VLine, HLine and ALine tab controls (see next).

### Tab Controls

Tab controls differ slightly for matrix data and virtual matrix (worksheet) data. Differences are noted in the table.

 You can rename the tabs by right-clicking on the tab title and choosing Rename from the shortcut menu.
Profile Quantity Choose a quantity to plot. When you are plotting along a single pixel (see Width setting, below), these values have no meaning (i.e Min=Max=Mean, etc). When you are profiling with a range of values, this setting will determine which quantity is plotted within the profiled range. For example, you are profiling along VLine and you have set Width to By Scale and set scale to 20. This will place two vertical lines, centered at X and located at a distance of 20 scale units apart. The Profile Quantity will then be measured across the 20 scale units (between the two vertical lines), at the chosen X value. Min Max Mean Median Sum SD Only available when source data is from a virtual matrix. Same as Source Output profile data at same X/Y values as source data. Uniform Linear Output profile data at uniformly spaced X/Y values according to the X/Y range of source data. Specify the color of profile lines. Specify whether to show the profile line. Specify the width of sample profile. By Pixel Specify the width of the profile in pixels. Use the Pixels edit box to specify number of pixels. By Scale Specify the width of the profile by scale values. Use the Scale edit box to specify width in scale units. Full Range Use full range (X or Y ) as the width. Only available for vertical or horizontal lines. Pixels Use edit box to specify the width of the profile when by Pixel is selected. Units correspond to pixels in the data matrix. Note that the width of the arbitrary profile is fixed at 1 pixel. Scale Use edit box to specify the width of the profile in axis scale units, when By Scale is selected. Notice that the width of arbitrary profile is not visible (only a single line is displayed) but the Scale parameter will be accounted for in the calculated profile. The width of an arbitrary profile is calculated as $(x^2+y^2)$1/2, where $x$ and $y$ are the projections of the lateral width along the X and Y axes, with respect to existing axis scales. Specify the position of the profile. This is available only when the profile is a vertical one and Full Range is not selected. Specify the position of the profile. This is available only when the profile is a horizontal one and Full Range is not selected. These controls are available only when the profile is an arbitrary one. They control the position and length of the arbitrary profile. X1 and Y1 determines the X and Y location of one end of the line while X2 and Y2 determines the location of the other end. A text label is displayed on the axis to show the position of the profile. Using the drop-down list, you can specify the position of this text label. Available options: Top On the top axis. (This is for vertical profiles.) Bottom On the bottom axis. (This is for vertical profiles.) Left On the left axis. (This is for horizontal profiles.) Right On the right axis. (This is for horizontal profiles.) None Apply to vertical and/or horizontal profiles. This may be especially useful when you wish to export the graph without visible labels.

## Deleting Profiles and Hiding Layers

When you delete all profile lines from the layer using the Delete Active Profile button on the Image/Contour Profile, the layer is hidden (but not deleted).

 Note: You can only hide the layer by deleting profiles with the Delete Active Profile button. If you select lines and press the Delete key, this only deletes the line. An empty graph layer remains.

## Accessing Profile Data

• Each Profile plot will have its own workbook, with a worksheet for each profile (horizontal, vertical and arbitrary) that contains at least one profile line.
• Lines added to a profile will add columns in the corresponding sheet.
• Worksheet columns contain XY values of profile data for each profile line separately.
• Column values are dynamically updated as you change Width and X/Y settings.
• Workbooks of profile data are hidden by default but you can view them by clicking the Go to Profile Data button on the Image/Contour Profile dialog toolbar. Alternately, you can locate the hidden workbook in Project Explorer and double-click on the dimmed window icon (named as ProfileDataN).
• Profile data sheets display column label row Long Name, Comments, Width, X or Y Value, and Quantity or Line, by default. Label row Comments, Width, X or Y Value and Quantity or Line display key parameters used to generate the profile data in each column. Label row Quantity shows in horizontal and vertical profile data, while Line shows the line function of the arbitrary profile line.