Wavelet Toolbox Previous page   Next Page

Loading Information into the Graphical Tools

You can load signals, images, or one- and two-dimensional wavelet packet decompositions into the graphical interface tools. The information you load may have been previously exported from the graphical interface, and then manipulated in the workspace, or it may have been information you generated initially from the command line.

In either case, you must observe the strict file formats and data structures used by the graphical tools, or else errors will result when you try to load information.

Loading Signals

To load a signal you've constructed in your MATLAB workspace into the Wavelet Packet 1-D tool, save the signal in a MAT-file (with extension mat or other).

For instance, suppose you've designed a signal called warma and want to analyze it in the Wavelet Packet 1-D tool.

The workspace variable warma must be a vector.

To load this signal into the Wavelet Packet 1-D tool, use the menu option FileLoad Signal.

A dialog box appears that lets you select the appropriate MAT-file to be loaded.

Loading Images

This toolbox supports only indexed images. An indexed image is a matrix containing only integers from 1 to n, where n is the number of colors in the image.

This image may optionally be accompanied by a n-by-3 matrix called map. This is the colormap associated with the image. When MATLAB displays such an image, it uses the values of the matrix to look up the desired color in this colormap. If the colormap is not given, the Wavelet Packet 2-D graphical tool uses a monotonic colormap with max(max(X))-min(min(X))+1 colors.

To load an image you've constructed in your MATLAB workspace into the Wavelet Packet 2-D tool, save the image (and optionally, the variable map) in a MAT-file (with extension mat or other).

For instance, suppose you've created an image called brain and want to analyze it in the Wavelet Packet 2-D tool. Type

To load this image into the Wavelet Packet 2-D tool, use the menu option FileLoad Image.

A dialog box appears that lets you select the appropriate MAT-file to be loaded.

Caution The graphical tools allow you to load an image that does not contain integers from 1 to n. The computations will be correct since they act directly on the matrix, but the display of the image will be strange. The values less than 1 will be evaluated as 1, the values greater than n will be evaluated as n, and a real value within the interval [1,n] will be evaluated as the closest integer.

Note that the coefficients, approximations, and details produced by wavelet packets decomposition are not indexed image matrices. To display these images in a suitable way, the Wavelet Packet 2-D tool follows these rules:

Loading Wavelet Packet Decomposition Structures

You can load one- and two-dimensional wavelet packet decompositions into the graphical tools providing you have previously saved the decomposition data in a MAT-file of the appropriate format.

While it is possible to edit data originally created using the graphical tools and then exported, you must be careful about doing so. Wavelet packet data structures are complex, and the graphical tools do not do any consistency checking. This can lead to errors if you try to load improperly formatted data.

One-dimensional data file contains the following variables:

Variable
Status
Description
tree_struct
Required
Object specifying the tree structure
data_name
Optional
String specifying the name of the decomposition
valTHR
Optional
Global threshold (can be empty if neither compression nor de-noising has been done)

These variables must be saved in a MAT-file (with extension wp1 or other).

Two-dimensional data file contains the following variables:

Variable
Status
Description
tree_struct
Required
Object specifying the tree structure
data_name
Optional
String specifying the name of the decomposition
map
Optional
Image map
valTHR
Optional
Global threshold (can be empty if neither compression nor de-noising has been done)

These variables must be saved in a MAT-file (with extension wp2 or other).

To load the properly formatted data, use the menu option FileLoad Decomposition Structure from the appropriate tool, and then select the desired MAT-file from the dialog box that appears.

The Wavelet Packet 1-D or 2-D graphical tool then automatically updates its display to show the new analysis.


Previous page  Saving Information to Disk Advanced Concepts Next page

© 1994-2005 The MathWorks, Inc.