5
Chapter 6 (continued): Working with Raster Graphic Images in Origin Importing and Plotting Images 144 Working with Raster Graphic Images in Origin Importing and Plotting Images Origin provides enhanced support for importing, viewing, and plotting raster graphic images. To import a gray scale, 8-bit color or higher resolution color image into the active matrix, select File:Import Image. (Alternatively, drag the desired file from Windows Explorer and drop it into the matrix.) When you first import the image, Origin displays a device independent bitmap (DIB) of the image in the matrix. If you are only interested in a region of the image, you can select a region of the DIB using the Rectangle Tool in "region of interest mode" on the Tools toolbar. The "region of interest mode" is controlled from the Tools:Region of Interest Tools menu command. Selecting a Region of Interest You can also view the image data instead of the image. To do this, select View:Data Mode. Once you view the data in the matrix, you cannot return to the original DIB view. To convert the DIB to data, Origin converts each pixel to an RGB value and then assigns the corresponding matrix cell an index number to a gray scale palette, based on the RGB value of the pixel. To convert back to image view, select View:Image View. The matrix now displays the image by mapping each each cell's index value to a gray scale palette. You can also view the image using a built-in or user supplied color palette. Viewing the image using a specified color palette may clarify regions of the image. To view the image using a color palette, you must first convert the DIB to matrix data. To do this, select Image:Convert to Gray + Data. (You can also switch to View:Data Mode and then back to View:Image Mode.) Origin converts each pixel to an RGB value and then assigns the corresponding matrix cell an index number to a gray scale palette, based on the RGB value of the pixel. To display the image using a palette other than gray scale, select

06a_RasterImages

Embed Size (px)

DESCRIPTION

origin

Citation preview

  • Chapter 6 (continued): Working with Raster Graphic Images in Origin

    Importing and Plotting Images 144

    Working with Raster Graphic Images in Origin Importing and Plotting Images

    Origin provides enhanced support for importing, viewing, and plotting raster graphic images. To import a gray scale, 8-bit color or higher resolution color image into the active matrix, select File:Import Image. (Alternatively, drag the desired file from Windows Explorer and drop it into the matrix.) When you first import the image, Origin displays a device independent bitmap (DIB) of the image in the matrix.

    If you are only interested in a region of the image, you can select a region of the DIB using the Rectangle

    Tool in "region of interest mode" on the Tools toolbar. The "region of interest mode" is controlled from the Tools:Region of Interest Tools menu command.

    Selecting a Region of Interest

    You can also view the image data instead of the image. To do this, select View:Data Mode. Once you view the data in the matrix, you cannot return to the original DIB view. To convert the DIB to data, Origin converts each pixel to an RGB value and then assigns the corresponding matrix cell an index number to a gray scale palette, based on the RGB value of the pixel. To convert back to image view, select View:Image View. The matrix now displays the image by mapping each each cell's index value to a gray scale palette.

    You can also view the image using a built-in or user supplied color palette. Viewing the image using a specified color palette may clarify regions of the image. To view the image using a color palette, you must first convert the DIB to matrix data. To do this, select Image:Convert to Gray + Data. (You can also switch to View:Data Mode and then back to View:Image Mode.) Origin converts each pixel to an RGB value and then assigns the corresponding matrix cell an index number to a gray scale palette, based on the RGB value of the pixel. To display the image using a palette other than gray scale, select

  • Chapter 6 (continued): Working with Raster Graphic Images in Origin

    Importing and Plotting Images 145

    Image:Palette:PaletteSelection. A number of built-in palettes are provided. For information on including your own palettes, see "Adding New Color Palettes to Origin" on page 146.

    Viewing the Image Using a Built-in Palette for Improved Clarity

    When viewing the image from a palette, Origin maps each cell's index value to a color in the selected palette. Thus, the image's full matrix Z value range is mapped to the palette. You can adjust the brightness and the contrast of the image using the Tuning tool. To open this tool, select Image:Tuning. When you adjust the Contrast slider, you are increasing or decreasing the Z value range that is mapped to the palette. When you adjust the Brightness slider, you are shifting the range of Z values that are mapped to the palette.

    Adjusting the Brightness and Contrast of the Image

    To plot the image into a graph window, select Plot:Image Plot. The default X and Y axis range is determined by the coordinate range of the matrix, which is the same as the image's X and Y pixel range.

  • Chapter 6 (continued): Working with Raster Graphic Images in Origin

    Adding New Color Palettes to Origin 146

    Plotting the Image into a Graph

    Adding New Color Palettes to Origin You can add new image palettes that are in Microsoft binary format or JASC ASCII format and that are 256 color. To do this, copy the file to the Origin \Palettes subfolder. The next time you start Origin, these new palettes will display in the Image:Palette submenu.

    You can create new palettes using any external application that writes the palette out in the Microsoft .PAL format. This is the only format that is recognized by Origin.

    Additionally, Origin provides a palette editor project file located in the Origin subfolder:

    \SAMPLES\PROGRAMMING\PALETTE EDITOR\PALEDIT.OPJ

    Entering Image Data Directly into a Matrix In addition to importing images, you can enter image data directly into a matrix. In this case, the values you enter are considered to be 8-bit or higher gray scale intensity values. Before entering values in a matrix, select Matrix:Set Properties to correctly set the internal data type. If you view the image instead of the data you entered (View:Show Image), Origin displays the image by converting each intensity value to an index number from a gray scale palette. The gray scale palette is created based on the internal data type (resolution) of the matrix. As with imported images, you can change the palette by selecting Image:Palette:PaletteSelection.

  • Chapter 6 (continued): Working with Raster Graphic Images in Origin

    Image Processing Example 147

    Image Processing Example Origin provides a basic image processing example that allows you to choose a filter and then apply the filter to the image. The example uses Origin C code to perform the filter operations.

    To review this example, open IMAGE PROCESSING. OPJ located in the Origin \SAMPLES\PROGRAMMING\IMAGE PROCESSING subfolder.

    Plotting an Image Histogram After importing a raster graphic image into a matrix, Origin can create a histogram of the intensity values in the image. To plot a histogram from the image in the matrix, select Plot:Histogram.

    Example Image Histogram

    Viewing the Images X and Y Projections Matrix images can also be plotted using a graph template that includes X and Y projections. To plot to this template, select Plot:Profiles. You can drag the lines to view different X and Y projections. You can also view the projections using an arbitrary line.

  • Chapter 6 (continued): Working with Raster Graphic Images in Origin

    Exporting an Image 148

    Viewing the Images X and Y Projections

    Exporting an Image To export an image in the matrix to a raster graphic image file, the internal data type of the matrix must be set to either short, int, or char. (The internal data type is set in the Matrix Properties dialog box. To open this dialog box, select Matrix:Set Properties.)

    To export an image to a file, select File:Export Image when the matrix is active.

    Working with Raster Graphic Images in OriginImporting and Plotting ImagesAdding New Color Palettes to OriginEntering Image Data Directly into a MatrixImage Processing ExamplePlotting an Image HistogramViewing the Images X and Y ProjectionsExporting an Image