
The file type buttons can be set to read either normal data (i.e. 2d data values), sorted/truncated 2d wavelet coefficients (see section 4.2.7 on reading compressed data files), or raw images (1-byte/pixel gray-scale). The data type buttons can be set to read either text data (normal ASCII text delimited by tabs, commas, spaces, or returns) or binary data.
Text files must be of type 'TEXT', and must contain the following data:
Number of rows in data: ASCII value
Number of cols in data: ASCII value
Each row of data: ASCII values
Binary files must be of type
'WBIN'. Binary files can be created with Fortran, C, or other programs. The
format for binary files is as follows:
Number of rows in data: 4-byte integer value
Number of cols in data: 4-byte integer value
Each row of data: 4-byte real values
Binary files are much smaller than text, and read and write much faster.Raw image files are simply a stream of (row-ordered) bytes (value 0-255) which represent the gray-scale value of each point in the image. Raw images can be produced with a C, Fortran, etc..., program, or by saving a gray-scale image in the "Raw" format from Photoshop. To read in a raw image, you must supply the number of X-points (cols) and Y-points (rows) in the image. Raw images are binary images.
After you have selected the file type and data type, click on OK. You will then be presented with a standard file dialog from which you can select the file to read. The data from this file will be displayed in the current window.
To perform a wavelet transform, first read (or create) data into an Image window. Then, select the Perform DWT item from the Wavelets menu. This item will display a submenu of wavelet filter choices:

Select one of the submenu choices (e.g. Daubechies 4) to perform a wavelet transform using that set of filter coefficients. A 2d DWT of a 256x256 image takes about 20-sec on my Centris 650.
In order to perform a transform, the x-length and y-length of your input data must be a power of 2. If your data is not a power of 2 in length, it will either be truncated to the next lowest power of 2 length, or padded to the next highest power of 2 length, depending on the Settings... item dialog in the Edit menu.
Once you have selected a filter type, the transform will be performed, and the result displayed in the current window, or in a new window, depending on the Settings... item dialog in the Edit menu. The discrete wavelet transform is a multi-step process. Each step is performed along the x-axis (cols) and then the y-axis (rows) of the input data. The total number of levels of analysis performed during this transform is also determined by the Settings... dialog.
Here is an example of the result of a wavelet transform:

Each resulting wavelet coefficient is displayed as one element of a 2-d array.
Once you have chosen a filter to use, you will see the following dialog:

Type in the number of X and Y points you would like in the resulting image, and the X-order and Y-order of the wavelet you wish to generate (from 1 to the number of X or Y points). The default for this order is the number of coefficients in the corresponding filter (e.g. 4 for the Daubechies 4 filter). The wavelet shape will be generated by creating an array which is equal to 1 at the (X-element, Y-element) numbers of the orders you entered, and which is zero everywhere else, and then performing an inverse wavelet transform on this array. Click on OK to generate the wavelet shape.
Here is an example of the wavelet shape for the Daubechies 4 filter, with an X-order and Y-order of 4:


Select the Normal data-Sorted/truncated coeffs button to write a text or binary image or set of wavelet coefficients. Select the Raw image button to write a set of raw byte values (0-255) for each point in the image. The raw format does not contain any size information, and all data values will be rescaled to between 0 and 255. This format can be used for importing the image into Photoshop for further processing.
Select the Text button to write an ASCII file (comma and return delimited), or select the Binary button to write a binary file. The format of a text file is as follows:
Number of rows in data: ASCII value
Number of cols in data: ASCII value
Each row of data: ASCII values
The format of a binary file is
as follows:
Number of rows in data: 4-byte integer value
Number of cols in data: 4-byte integer value
Each row of data: 4-byte real values
A raw file is simply a stream of bytes, with no header.Click on OK. You will then see a standard Macintosh file dialog from which you can name your data file. Text files are written as type 'TEXT', and binary files are written as type 'WBIN'. Binary files can be read by the MacWavelets program, or from Fortran, C, or other programs. Raw files can be read with C, Fortran, etc..., programs, or by Photoshop.
Contents | Previous Section | Next Section
MacWavelets 2.00 User's Manual.
"MacWavelets" is a trademark of Intergalactic Reality.
© Copyright Intergalactic Reality, 1996.
All rights reserved.
Photoshop is a trademark of Adobe, Inc.