MATLAB Answers

How can I import a lzf compressed HDF5 dataset in Matlab?

32 views (last 30 days)
Gerrit H
Gerrit H on 9 Apr 2018
Answered: Reynaud Lucile on 12 Sep 2019
Hello I try to open a lzf compressed HDF5 dataset in Matlab with h5read but I only get the below error.
Error using h5readc
The HDF5 library encountered an error and produced the following
stack trace information:
H5PL__find can't open directory
H5PL_load search in paths failed
H5Z_pipeline required filter 'lzf' is not registered
H5D__chunk_lock data pipeline read failed
H5D__chunk_read unable to read raw data chunk
H5D__read can't read data
H5Dread can't read data
Error in h5read (line 58)
[data,var_class] = h5readc(Filename,Dataset,start,count,stride);||
I also tried hdf5read but the same...
Error using hdf5readc
Reading from the dataset failed.
Error in hdf5read (line 95)
[data, attributes] = hdf5readc(settings.filename, ...
Does anybody has a good idea how to access lzf compressed datasets in hdf5 files? Thank you

  0 Comments

Sign in to comment.

Answers (2)

Harish Ramachandran
Harish Ramachandran on 12 Apr 2018
As of R2015a, MATLAB upgraded to HDF5 1.8.12 and thus now supports reading HDF5 datasets via the new dynamically loaded filter feature (which includes LZF compression).
To use a custom filter, you must have the third-party filter as a shared library or DLL on your system and then set the HDF5_PLUGIN_PATH environment variable to point to the shared libraries. Note that if you are using Windows, there may be additional steps required to ensure compatibility between the CRT (C Run-time Libraries) of the Visual Studio builds of HDF5 and the third-party filter.
For releases prior to R2015a, MATLAB does not support LZF compression filters.
The high-level functions can be used to read HDF5 files with compression filters. To return information about the compression filter used, and other metadata about the file, use ' h5info'. To read the file, assuming that the compression filter used is supported by MATLAB, call ' h5read', and the decompression will be done automatically.

  0 Comments

Sign in to comment.


Reynaud Lucile
Reynaud Lucile on 12 Sep 2019
Hello,
I have the same question as Gerrit H, I would like to open a lzf compressed HDF5 file.
My MATLAB is the 2019 version so it should be able to open LZF compressions according to your answer.
Error using h5readc
The HDF5 library encountered an error and produced the following stack trace
information:
H5PL__find can't open directory
H5PL_load search in paths failed
H5Z_pipeline required filter 'lzf' is not registered
H5D__chunk_lock data pipeline read failed
H5D__chunk_read unable to read raw data chunk
H5D__read can't read data
H5Dread can't read data
Error in h5read (line 66)
[data,var_class] = h5readc(Filename,Dataset,start,count,stride);
I went on the website for the lzf librairy http://oldhome.schmorp.de/marc/liblzf.html . I downloaded their content liblzf-3.6.tar.gz.sig but I don't know how to install it on MATLAB. How can we install that library ? And how can we add it to HDF5_PLUGIN_PATH environment variable ?
Thank you

  0 Comments

Sign in to comment.

Sign in to answer this question.