Table of Contents
Overview
Most people are familiar with thumbnail images for JPEG images that are presented by a file browser. The same system can be used for HDF5 files to help users sort and locate their data files. HDF5 files can contain some header space (called a "user block" by the HDF Group) that can contain information that is not part of the dataspace managed by the HDF5 libraries. The Extensible Metadata Platform is a standardised XML-based system for inserting metadata into files. A script can be used by Pixelator to insert XMP metadata into the HDF5 data files, which can then be viewed in a standard file browser after installing the custom thumbnailer.
Further information can be found in this presentation from the 2019 HDF5 European Workshop.
Pixelator
Pixelator typically adds thumbnails to HDF5 data files after a scan has finished. This is implemented in the insertXMP.py script that is called from the endOfScan script. This is not enabled by default but is easy to set up.
- Copy
~/pixelator/work/stxm/PixelatorController/config/PolLux/scripts/insertXMP.pyto yourconfig/scriptsdirectory - Edit your
endOfScanscript to include a call to theinsertXMP.pyscript, e.g."
filename=$2
python3 ../../PixelatorController/config/PolLux/scripts/insertXMP.py $filename
- Edit your
settings.jsonfile (that is given as an argument to the Pixelator binary call) to ensure that theendOfScanScriptparameter points to the script file above.
File Browser
A custom thumbnailer is implemented by the HDF5XMP project, which can be installed on a computer to enable the native file browsers to access the XMP thumbnails embedded in the HDF5 files.
- Download the released precompiled thumbnailer binaries (expand the "assets") for your OS type.
- Decompress the archive.
- Follow the instructions in the
README.txt. - (may need to restart the system)
- Open a file browser and view some HDF5 files that have thumbnails embedded in them.