Three-Dimensional Discrete Wavelet Analysis

This section demonstrates the features of three-dimensional discrete wavelet analysis using the Wavelet Toolbox™ software. The toolbox provides these functions for 3-D data analysis. (You use the Wavelet 3-D GUI to perform all tasks except the first task.

  • Getting information on the command line functions

  • Loading 3-D data

  • Analyzing a 3-D data

  • Selecting and displaying slices

  • Creating a slice movie

  • Creating true 3-D display

  • Importing and exporting information

Performing Three-Dimensional Analysis Using the Command Line

The example wavelet3ddemo and the documentation of the Analysis-Decomposition and Synthesis-Reconstruction functions show how you can analyze 3-D arrays efficiently using command line functions dedicated to the three-dimensional wavelet analysis. For more information, see the function reference pages.

Analysis-Decomposition Functions

Function Name

Purpose

dwt3

Single-level decomposition

wavedec3

Decomposition

Synthesis-Reconstruction Functions

Function Name

Purpose

idwt3

Single-level reconstruction

waverec3

Full reconstruction

Performing Three-Dimensional Analysis Using the Graphical Interface

In this section you explore the same 3-D-data as in the wavelet3ddemo example, but you use the graphical interface tools.

  1. Start the 3-D Wavelet Analysis Tool.

    From the MATLAB® prompt, type

    wavemenu
    

    The Wavelet Tool Main Menu appears.

    Click the Wavelet 3-D menu item. The discrete wavelet analysis tool for three-dimensional data opens.

  2. Load a 3-D array.

    From the File menu, choose Load > Data.

    When the Load Data dialog box appears, select the MAT-file wmri.mat, which is in the MATLAB folder toolbox/wavelet/wavelet. Click OK to load the 3-D data into the Wavelet 3-D tool.

  3. Analyze the 3-D array. Using the Wavelet and Level menus located in the upper part of the tool, specify:

  • The wavelet familes (one per direction X, Y and Z)

  • The decomposition level and the wavelet extension mode to be used for the analysis

    For this analysis, accept the defaults: db1 wavelet for each direction, decomposition at level 2 and symmetric extension mode (sym).

    Click Decompose. After a pause for computation, the Wavelet 3-D tool displays its analysis.

    Review the slices of data and wavelet components in the graphical display. These slices are orthogonal to the z-direction as indicated by Slice Orientation in the command part of the window. This option lets you choose the desired slice orientation.

    The first row of the graphical display area displays from left to right and for Z = 1:

  • The original data slice

  • The approximation at level 2 slice (low-pass component APP2)

  • The slice which is the sum of all the components from level 1 to level 2, different from the low-pass one.

    The x-labels of the three axes give you the name and the size of the displayed data.

The next two lines of axes, display the wavelet coefficients at level 2, which is the desired level of the analysis. In the first line, the first graph contains the coefficients of approximation at level 2. The remaining seven axes display the seven types of wavelet coefficients at level 2. These coefficients contain the x-labels of the eight axes and display the name, type and size of the displayed data.

For example, in the third graphic of the bottom line, you can see the Cfs-DAD coefficients at level 2, which correspond to an array of size 32 x 32 x 7. The name of the DAD coefficients group indicates that it is obtained using

  • The high-pass filter in x direction (D for detail)

  • The low-pass filter in y direction (A for approximation)

  • The high-pass filter in Z direction (D again for detail), leading to the DAD component

    You use the Displayed Level in the command part of the window to choose the level of the displayed component, from 1 to the decomposition level.

    You can modify characteristics of the display using the options in the command part of the window. Each pair of sliders controls part of graphical array, the original and the reconstructed slices with the first pair or the coefficients slices with the second pair. Above each slider you can see the number of slices in the current slice orientation.

    Using the slider (or by directly editing the values) of Rec. Z-Slice, choose slice number twelve. Similarly, choose slice number two using Cfs. Z-Slice.

    The Slice Movie button lets you see a movie of all the slices, first for the reconstructed slices and then for the coefficients slices. In this case, the movie contains 27 reconstructed images and 7 coefficients images.

    3D Display lets you examine the original data and the wavelet components in true 3-D mode. Click 3D Display and select APP1.

    A rotated 3-D view of the approximation at level 1 opens in a new window. Use the sliders in the 3-D tool to examine the 3-D data.

Importing and Exporting Information from the Graphical Interface

You can import information from and export information either to disk or to the workspace using the Wavelet 3-D graphical tool.

Loading Information into the Wavelet 3-D Tool

To load 3-D data you have constructed in your MATLAB workspace into the Wavelet 3-D tool, save the 3-D data in a MAT-file, using

M = magic(8); 
X = repmat(M,[1 1 8]); 
save magic3d X  
whos

where M and X are

NameSizeBytesClass
M8x8512double
X8x8x84096double

To load this 3-D data into the Wavelet 3-D tool, use the menu option File > Load Data. You then select the MAT-file to load.

Similarly, you can load information from the workspace using File > Import Data. You then select the variable to load.

Saving Information to a File

You can save decompositions and approximations from the Wavelet 3-D tool to a file or to the workspace.

Saving Decompositions.  The Wavelet 3-D tool lets you save the entire set of data from a discrete wavelet analysis to a file. The toolbox creates a MAT-file in the current folder with a name you choose.

  1. Open the Wavelet 3-D tool with File > Load Data, and select magic3d to load the 3-D data file.

  2. After analyzing your data, save it by using File > Save > Decomposition.

  3. In the dialog box that appears, specify a folder and file name for storing the decomposition data. Type the name dec_magic3d.

  4. After saving the decomposition data to the file dec_magic3d.mat, load the variables into your workspace.

    load dec_magic3d 
    whos 
    

where wdec is

NameSizeBytesClass
wdec1x19182struct

The variable wdec contains the wavelet decomposition structure.

wdec = 
     sizeINI: [8 8 8] 
       level: 2   
     filters: [1x1 struct] 
      mode: 'sym' 
       dec: {15x1 cell}   
     sizes: [3x3 double]

Saving Approximations.  You can process a 3-D data in the Wavelet 3-D tool and then save any desired approximation, depending on the level chosen for the decomposition.

  1. Open the Wavelet 3-D tool and load the file containing the 3-D data to analyze by using File > Load Data

  2. Select magic3d.

  3. Select the File > Save > Approximations > Approximation at level 2 menu option.

  4. In the dialog box that appears, select a folder and file name for the MAT-file. For this example, choose the name App2_magic3D.

  5. Load the image data into your workspace.

    load App2_magic3D 
    whos
    

where x is

NameSizeBytesClass
x8x8x84096double

Was this topic helpful?