Table of Contents

NAME

QccWAVSubbandPyramid3DInt - data structure for an integer-valued three-dimensional dyadic or wavelet-packet subband decomposition of an image cube

SYNOPSIS

#include "libQccPack.h"

int QccWAVSubbandPyramid3DIntInitialize(QccWAVSubbandPyramid3DInt *subband_pyramid);
int QccWAVSubbandPyramid3DIntAlloc(QccWAVSubbandPyramid3DInt *subband_pyramid);
void QccWAVSubbandPyramid3DIntFree(QccWAVSubbandPyramid3DInt *subband_pyramid);
int QccWAVSubbandPyramid3DIntNumLevelsToNumSubbandsDyadic(int num_levels);
int QccWAVSubbandPyramid3DIntNumLevelsToNumSubbandsPacket(int temporal_num_levels, int spatial_num_levels);
int QccWAVSubbandPyramid3DIntNumSubbandsToNumLevelsDyadic(int num_subbands);
int QccWAVSubbandPyramid3DIntCalcLevelFromSubbandDyadic(int subband, int num_levels);
int QccWAVSubbandPyramid3DIntCalcLevelFromSubbandPacket(int subband, int temporal_num_levels, int spatial_num_levels, int *temporal_level, int *spatial_level);
int QccWAVSubbandPyramid3DIntSubbandSize(const QccWAVSubbandPyramid3DInt *subband_pyramid, int subband, int *subband_num_frames, int *subband_num_rows, int *subband_num_cols);
int QccWAVSubbandPyramid3DIntSubbandOffsets(const QccWAVSubbandPyramid3DInt *subband_pyramid, int subband, int *frame_offset, int *row_offset, int *col_offset);
int QccWAVSubbandPyramid3DIntPrint(const QccWAVSubbandPyramid3DInt *subband_pyramid);

DESCRIPTION

QccPack provides data structure QccWAVSubbandPyramid3DInt for representing integer-valued three-dimensional subband decompositions of image cubes. This subband-pyramid structure can be read from and written to SBPTI-format files, or a QccWAVSubbandPyramid3DInt structure can be used without file input or output.

DATA STRUCTURE

The QccWAVSubbandPyramid3DInt data structure is defined as:

typedef struct
{
QccString filename;
QccString magic_num;
int major_version;
int minor_version;
int transform_type;
int temporal_num_levels;
int spatial_num_levels;
int num_frames;
int num_rows;
int num_cols;
int origin_frame;
int origin_row;
int origin_col;
int subsample_pattern_frame;
int subsample_pattern_row;
int subsample_pattern_col;
QccVolumeInt volume;
} QccWAVSubbandPyramid3DInt;

The fields of QccWAVSubbandPyramid3DInt are as follows:

filename
The name of the file.
magic_num, major_version, minor_version
The magic number and version of the file.
transform_type
The type of transform (dyadic or wavelet-packet); this will be either QCCWAVSUBBANDPYRAMID3DINT_DYADIC or QCCWAVSUBBANDPYRAMID3DINT_PACKET.
temporal_num_levels
The number of levels of temporal decomposition in the subband pyramid.
spatial_num_levels
The number of levels of spatial decomposition in the subband pyramid. For a wavelet-packet transform, spatial_num_levels will be equal to temporal_num_levels.
num_frames, num_rows, num_cols
The overall size of the volume of coefficients.
origin_frame, origin_row, origin_col
Indicates the frame, row, and column indices of the upper corner of the volume of coefficients.
subsample_pattern_row, subsample_pattern_col
Indicates the subsampling decomposition pattern along the rows and columns.
volume
The volume of coefficients.

FILE FORMAT

For reading and writing structures of type QccWAVSubbandPyramid3DInt, QccPack provides the SBPTI file format. This file format starts with an ASCII header followed by binary data. The ASCII header consists of magic-number/revision information followed by any amount of white space (space, `\t' (tab), `\n' (newline), `\r' (carriage return)) and/or comments lines (lines starting with `#'). Following this white space, additional ASCII header information is given, separated by blanks and newlines. Binary data follows this ASCII header information. Note: one (and only one) newline must immediately follow the last component of ASCII header information before the start of the binary data.

The SBPTI file format consists of the following information:

SBPTIX.X
<white space>
T
[L] S
C R F
i111 i112...
i121 i122...
i211 i212...
.
.
.

where PTI is the magic number, X.X is the version number, <white space> is white space and/or comment lines, T is the transform type (either QCCWAVSUBBANDPYRAMID3DINT_DYADIC or QCCWAVSUBBANDPYRAMID3DINT_PACKET), L is the number of levels of temporal decomposition (not present if T is QCCWAVSUBBANDPYRAMID3DINT_PACKET), S is the number of levels of spatial decomposition, C is the number of columns of the subband-pyramid image cube, R is the number of rows, F is the number of frames, and ikmn is the coefficient for the kth frame, mth row, nth column of the subband-pyramid image cube. T, L, S, C, R, and F are stored in ASCII. The image cube itself, ikmn, is stored as binary int numbers (4 bytes each, MSB first, see QccFileWriteInt(3) ). The values of L and S give the number of decompositions in the volume of coefficients. If S = 0, (and L = 0 for a wavelet-packet decomposition), the image cube has not been decomposed.

ROUTINES

QccWAVSubbandPyramid3DIntInitialize() should be called before any use of a QccWAVSubbandPyramid3DInt structure. QccWAVSubbandPyramid3DIntInitialize() initializes the fields of subband_pyramid to the following values:

filename: NULL string
magic_num: QCCSUBBANDPYRAMID3DINT_MAGICNUM
major_version, minor_version: initialized to output of QccGetQccPackVersion(3)
transform_type: QCCWAVSUBBANDPYRAMID3DINT_PACKET
temporal_num_levels: 0
spatial_num_levels: 0
num_frames: 0
num_rows: 0
num_cols: 0
origin_frame 0
origin_row 0
origin_col 0
subsample_pattern_frame: 0
subsample_pattern_row: 0
subsample_pattern_col: 0
volume: NULL

QccWAVSubbandPyramid3DIntAlloc() allocates storage space for subband_pyramid->volume. If subband_pyramid->volume is not NULL, QccWAVSubbandPyramid3DIntAlloc() returns immediately without changing the state of any memory allocation. Otherwise, the subband_pyramid->volume array is allocated. The fields subband_pyramid->num_frames, subband_pyramid->num_rows, and subband_pyramid->num_cols must be set prior to calling QccWAVSubbandPyramid3DIntAlloc().

QccWAVSubbandPyramid3DIntFree() frees the subband_pyramid->volume array previously allocated by QccWAVSubbandPyramid3DIntAlloc().

QccWAVSubbandPyramid3DIntNumLevelsToNumSubbandsDyadic() calculates the number of subbands in a dyadic subband pyramid with num_levels levels. This value is num_levels * 7 + 1.

QccWAVSubbandPyramid3DIntNumLevelsToNumSubbandsPacket() calculates the number of subbands in a wavelet-packet subband pyramid with temporal_num_levels temporal levels and spatial_num_levels spatial levels. This value is QccWAVSubbandPyramidNumLevelsToNumSubbands( spatial_num_levels) * temporal_num_levels + 1.

QccWAVSubbandPyramid3DIntNumSubbandsToNumLevelsDyadic() calculates the number of levels in a dyadic subband pyramid with num_subbands subbands.

QccWAVSubbandPyramid3DIntCalcLevelFromSubbandDyadic() calculates the level of the specified subband in a dyadic subband pyramid with num_levels levels. Here, subband gives the subband number of the subband in the pyramid.

QccWAVSubbandPyramid3DIntCalcLevelFromSubbandPacket() calculates the levels of the specified subband in a wavelet-packet subband pyramid with temporal_num_levels temporal levels and spatial_num_levels spatial levels. Here, subband gives the subband number of the subband in the pyramid. The temporal level of the specified subband is returned in temporal_level while the spatial level of the subband is returned in spatial_level.

QccWAVSubbandPyramid3DIntSubbandSize() calculates the size of the specified subband in subband_pyramid. The size of the subband is returned in subband_num_frames, subband_num_rows, and subband_num_cols, which must be allocated prior to calling QccWAVSubbandPyramid3DIntSubbandSize().

QccWAVSubbandPyramid3DIntSubbandOffsets() calculates the location in subband_pyramid->volume of the specified subband. The frame, row, and column offsets are returned in frame_offset, row_offset, and col_offset, respectively, which must be allocated prior to calling QccWAVSubbandPyramid3DIntSubbandOffsets().

QccWAVSubbandPyramid3DIntPrint() prints the contents of subband_pyramid to stdout.

RETURN VALUE

These routines return 0 on success, and 1 on failure.

SEE ALSO

QccWAVSubbandPyramid3DIntDWT(3) , QccWAVSubbandPyramid3DIntInverseDWT(3) , QccPackWAV(3) , QccPack(3)

A. R. Calderbank, I. Daubechies, W. Sweldens, B.-L. Yeo, "Lossless Image Compression Using Integer to Integer Wavelet Transforms", in Proceedings of the International Conference on Image Processing, Lausanne, Switzerland, pp. 596-599, September 1997.

Z. Xiong, X. Wu, S. Cheng, J. Hua, "Lossy-to-Lossless Compression of Medical Volumetric Data Using Three-Dimensional Integer Wavelet Transforms," IEEE Transactions on Medical Imaging, vol. 22, pp. 459-470, March 2003.

B.-J. Kim, Z. Xiong, and W. A. Pearlman, "Low Bit-Rate Scalable Video Coding with 3-D Set Partitioning in Hierarchical Trees (3-D SPIHT)," IEEE Transactions on Circuits and Systems for Video Technology, vol. 10, no. 8, pp. 1374-1387, December 2000.

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads