Main Content

Filters and Compression (H5Z)

Inline data filters, data compression

Description

Use the MATLAB® HDF5 filters and compression interface, H5Z, to access information on filters in the local environment.

Functions

H5Z.filter_avail

Determine if filter is available

output = H5Z.filter_avail(filterID) determines whether the filter specified by filterID is available to the application. filterID can be specified by one of the following character vectors or string scalars, or its numeric equivalent:

  • 'H5Z_FILTER_DEFLATE'

  • 'H5Z_FILTER_SHUFFLE'

  • 'H5Z_FILTER_FLETCHER32'

  • 'H5Z_FILTER_SZIP'

  • 'H5Z_FILTER_NBIT'

  • 'H5Z_FILTER_SCALEOFFSET'.

H5Z.get_filter_info

Information about filter

configFlags = H5Z.get_filter_info(filterID) retrieves information about the filter specified by its identifier. At present, the information returned is the filter's configuration flags, indicating whether the filter is configured to decode data, to encode data, neither, or both. configFlags should be used with these HDF5 constant values in a bitwise AND operation:

  • 'H5Z_FILTER_CONFIG_ENCODE_ENABLED' — Encoding is enabled for filter.

  • 'H5Z_FILTER_CONFIG_DECODE_ENABLED' — Decoding is enabled for filter.

  • 0 — Encoding and decoding functionalities are not available.

If the resulting value is 0, then the encode or decode functionality is not available.

Examples

expand all

Determine if the shuffle filter is available.

bool = H5Z.filter_avail('H5Z_FILTER_SHUFFLE');

Determine if encoding is enabled for the deflate filter.

flags = H5Z.get_filter_info('H5Z_FILTER_DEFLATE');
func = H5ML.get_constant_value('H5Z_FILTER_CONFIG_ENCODE_ENABLED');
enabled = bitand(flags,functionality) > 0;
Introduced before R2006a