2.31 FAQ-462 What is the difference between data matrix and image matrix?

Last Update: 6/28/2016

A matrix window can have multiple sheets and each sheet can have multiple matrix objects. Each matrix object in turn can contain an image, or data.

When an image file is imported into a matrix object, Origin by default sets the matrix object to be of type image. This is indicated by the "image" icon Matrix object image button.png displayed at the top right corner of the matrix window.

When a matrix object is filled with numerical values, by importing data, using a Set Values formula, or when the user converts an image to data, the matrix object type will be data, and this will be indicated in the top right corner of the matrix window with the "data" icon Matrix object data button.png.

Whether the matrix contains an image or data, you can toggle the window view between Image Mode and Data Mode using the View menu.

If the matrix contains an image

The Data Mode view will display in each cell, a number or a set of numbers that correspond to each pixel of the image. Thus, for example, if an RGB image was imported, each cell will contain three numbers such as 70 123 25. If a grayscale image was imported, each cell will contain a single number such as 25186 or 210.

The Image Mode view will simply display the image similar to viewing the image in an external application.

With image matrices, one can perform simple image processing and transformation operations, which are available from the Image menu. Most numerical operations such as 2D FFT are however not available until the image is converted to data. The Image:Conversion:Convert to Data... menu item can be used to convert image to data.

If matrix contains data

The Data Mode view will display the numeric values in each cell.

The Image Mode view will display a 256-level grayscale image representation of the data in the matrix. The minimum data value is assigned the color black and the maximum data value is assigned the color white, and all other values are assigned gray colors in between, using a linear mapping of values. Note that the data values can be any range of numbers such as fractional numbers from the results of a computation, and are not limited to positive integers.

The minimum and maximum values used for the grayscale map can be changed using the system variables z1 and z2. Thus one could open the Script Window and type commands such as below to change the grayscale map.

z1=10;
z2=35;

Changing z1 and z2 values allows the user to view the data matrix with the desired contrast. Thus, for example if a 16-bit grayscale TIFF image with very small intensity values in each pixel is imported into a matrix, it may appear as black/blank, as by default the matrix is in image type. But if the user converts the image to data type, then user can set z1 and z2 to desired values to view the available data in more detail.

Changing Display Palette

If a matrix contains Data or an 8bit gray scale image and is in Image Mode view, you can apply a different display palette. Select Matrix: Apply Palette to Color Map and use the browse button in the dialog to select a different Palette file.


Keywords:matrix, object, layer, view, bitmap, grayscale, black, blank, TIF, I, D