How can I import a lzf compressed HDF5 dataset in Matlab?
29 views (last 30 days)
Show older comments
Gerrit H
on 9 Apr 2018
Answered: Lorenza Sala
on 27 Jan 2022
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
Accepted Answer
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
More Answers (3)
Suzanne Onstwedder
on 2 May 2020
Edited: Suzanne Onstwedder
on 5 May 2020
Install Microsoft C++ runtime environment
- Make sure you have the latest Microsoft C++ runtime environment installed. (Go to https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads for the appropriate installer).
- Just install it the normal way, following the prompt instructions.
Install third party LZF plugin
- Download the plugin (all the way at the bottom) from https://www.hdfgroup.org/downloads/hdf5/
- Open and install the ‘h5pl-1.12.0-win64.msi’file.
- Just install it the normal way, following the prompt instructions. If you install it in an alternative location, copy that path. Standard is ‘C:\Program Files\HDF_Group\HDF5\1.12.0’
Add HDF5_plugin_path to windows
- Open Control panel
- Open system and security
- Open system
- Open Advanced settings, located in the most left column
- Click ‘Environment variables’ (‘omgevingsvariabelen’)
- Click the Top ‘New’ and add exactly the same following three variables (See image)
- For copy purpose C:\Program Files\HDF_Group\HDF5\1.12.0\lib\plugin
Restart matlab
0 Comments
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
2 Comments
Torbjörn Pettersson
on 11 Oct 2020
Did you solve the above issue?
I have encountered the same problem...
Cheers,
Torbjörn
saurabh pegwal
on 25 Nov 2021
Edited: saurabh pegwal
on 25 Nov 2021
1). you just need to install the third party LZF plugin as explained above.
Lorenza Sala
on 27 Jan 2022
Hello,
I have the same problem, but for a different filter (blosc filter). The filter is included in the dynamically loaded filter feature. But I am working on Mac OS and I don't know how to download and install the feature on my machine. Can anyone help me with this?
Thanks
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!