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) returns a positive value if the filter specified by filterID is available to the application, and 0 if it is not. filterID can be specified as one of these values or their numeric equivalents:

  • "H5Z_FILTER_DEFLATE"

  • "H5Z_FILTER_SHUFFLE"

  • "H5Z_FILTER_FLETCHER32"

  • "H5Z_FILTER_SZIP"

  • "H5Z_FILTER_NBIT"

  • "H5Z_FILTER_SCALEOFFSET"

For custom third-party filters, specify filterID as the numeric filter identifier assigned by The HDF Group.

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.

For custom third-party filters, specify filterID as the numeric filter identifier assigned by The HDF Group.

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,func) > 0;

Version History

Introduced before R2006a

expand all