BioFormatsStdLoader

class io.loaders.BioFormatsStdLoader

Bases: io.loaders.BaseImageLoader

BIOFORMATSSTDLOADER - Loader for microscopy files using Bio-Formats, based on.

io.loaders.BaseImageLoader base class

This loader handles a wide variety of microscopy file formats via the Bio-Formats library. It supports: - Standard loading of multi-series datasets - Metadata extraction (pixel sizes, channels, time points) - Custom region loading (cropping) - Memoization for faster metadata access via loci.formats.Memoizer

Constructor Summary
BioFormatsStdLoader(options)

BIOFORMATSSTDLOADER - Constructor for BioFormatsStdLoader class.

Syntax:
loader = io.loaders.BioFormatsStdLoader(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)

    • bioFormatsMemoizerMemoDir - [char] path to memo directory

    • BioFormatsIndices - [numeric] specific series indices to load (0 for all)

Output Arguments:
  • obj - instance of the BioFormatsStdLoader class

Example 1 - create loader with options:

options.waitbar = true;
options.bioFormatsMemoizerMemoDir = 'c:\temp';
loader = io.loaders.BioFormatsStdLoader(options);
Method Summary
loadImages(files, imginfo, options)

LOADIMAGES - Load image data using Bio-Formats.

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

This method uses bfopen5 (MIB wrapper around bfopen) to load images. It supports loading multiple series and concatenating them along Z.

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 Bio-Formats file:

loader = io.loaders.BioFormatsStdLoader();
[imginfo, files] = loader.loadMetadata({'image.czi'}, options);
[img, imginfo] = loader.loadImages(files, imginfo, options);
loadMetadata(filenames, options)

LOADMETADATA - Load metadata for files using Bio-Formats.

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

This method uses loci.formats.Memoizer with bfGetReader to extract metadata efficiently. It handles multi-series selection, pixel size extraction from OME metadata, and sets up the file structure for loading.

Input Arguments:
  • filenames - cell array with filenames

  • 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

    • BioFormatsIndices - [numeric] specific series to load (0 for all)

    • bioFormatsMemoizerMemoDir - [char] memo directory path

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 Bio-Formats file:

loader = io.loaders.BioFormatsStdLoader();
filenames = {'image.czi'};
[imginfo, files] = loader.loadMetadata(filenames, options);