HDF5NoHeaderLoader

class io.loaders.HDF5NoHeaderLoader

Bases: io.loaders.BaseImageLoader

HDF5NOHEADERLOADER - Loader for HDF5 files without XML headers, based on.

io.loaders.BaseImageLoader base class

Constructor Summary
HDF5NoHeaderLoader(options)

HDF5NOHEADERLOADER - Constructor for HDF5NoHeaderLoader class.

Syntax:
loader = io.loaders.HDF5NoHeaderLoader(options)
Input Arguments:
  • options - (optional) struct with fields:

    • waitbar - [logical] show or not the waitbar; default: false

    • mibPath - [char] path to MIB directory

    • customSections - [logical] load custom sections only; default: false

    • customSectionsSettings - [struct] custom section parameters

    • imgStretch - [logical] stretch uint32 images to uint16; default: false

    • silentMode - [logical] do not ask user questions; default: false

    • verbose - [logical] show timing information; default: false

    • Font - [struct] font settings for dialogs

    • ParentFigure - handle of the main MIB window (parent for uiprogressdlg)

Output Arguments:
  • obj - instance of the HDF5NoHeaderLoader class

Example 1 - create loader with options:

options.waitbar = true;
loader = io.loaders.HDF5NoHeaderLoader(options);
Method Summary
loadImages(files, imginfo, options)

LOADIMAGES - Load image data from HDF5 files.

Syntax:
[img, imginfo] = obj.loadImages(files, imginfo, options)

This method loads actual image data using h5read. It handles single/double conversion to integers and dimension permutation via transMatrix.

Input Arguments:
  • files - structure array from loadMetadata

  • imginfo - dictionary from loadMetadata

  • options - (optional) struct for image loading

Output Arguments:
  • img - loaded image dataset

  • imginfo - updated dictionary

Example 1 - load images from HDF5 file:

loader = io.loaders.HDF5NoHeaderLoader();
[imginfo, files] = loader.loadMetadata({'dataset.h5'}, options);
[img, imginfo] = loader.loadImages(files, imginfo, options);
loadMetadata(filenames, options)

LOADMETADATA - Load metadata for HDF5 files.

Syntax:
[imginfo, files] = obj.loadMetadata(filenames, options)

This method inspects HDF5 files to extract dataset metadata. It prompts the user to select the dataset if multiple are present, reads attributes like axistags for Ilastik compatibility, and determines dimensions and data types.

Input Arguments:
  • filenames - cell array with filenames of HDF5 files

  • options - (optional) struct with fields:

    • waitbar - [logical] show or not the waitbar; default: false

    • customSections - [logical] load part of the dataset; default: false

    • Font - [struct] font settings for dialogs

Output Arguments:
  • imginfo - dictionary with image metadata containing fields:

    • Height - image height in pixels

    • Width - image width in pixels

    • Colors - number of color channels

    • Depth - number of z-slices

    • Time - number of time points

    • imgClass - image class (uint8, uint16, etc.)

    • ColorType - 'grayscale', 'truecolor', or 'indexed'

    • ImageDescription - description with BoundingBox info

    • Format - HDF5 format type ('matlab.hdf5' or 'bdv.hdf5')

    • Levels - number of pyramid levels (for BDV only)

    • ReturnedLevel - selected pyramid level (for BDV only)

    • pixSize - struct with pixel sizes: .x, .y, .z, .t, .units, .tunits

    • other format-specific metadata fields

  • files - structure array with file information

Example 1 - load metadata from HDF5 file:

loader = io.loaders.HDF5NoHeaderLoader();
filenames = {'dataset.h5'};
[imginfo, files] = loader.loadMetadata(filenames, options);