Private
Public Access
11
1
3
HDF5_Thumbnails
watts edited this page 2026-04-01 16:25:19 +02:00

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.

  1. Copy ~/pixelator/work/stxm/PixelatorController/config/PolLux/scripts/insertXMP.py to your config/scripts directory
  2. Edit your endOfScan script to include a call to the insertXMP.py script, e.g."
filename=$2
python3 ../../PixelatorController/config/PolLux/scripts/insertXMP.py $filename
  1. Edit your settings.json file (that is given as an argument to the Pixelator binary call) to ensure that the endOfScanScript parameter 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.

  1. Download the released precompiled thumbnailer binaries (expand the "assets") for your OS type.
  2. Decompress the archive.
  3. Follow the instructions in the README.txt.
  4. (may need to restart the system)
  5. Open a file browser and view some HDF5 files that have thumbnails embedded in them.