MibImgLoader¶
- class io.loaders.MibImgLoader¶
Bases:
io.loaders.BaseImageLoaderMIBIMGLOADER - Loader for mibImg files (MAT-files with specific structure), based on.
io.loaders.BaseImageLoader base class
This loader handles .mibImg files which are standard MATLAB .mat files containing a ‘res’ structure with image data and metadata.
- Constructor Summary
- MibImgLoader(options)¶
MIBIMGLOADER - Constructor for MibImgLoader class.
- Syntax:
loader = io.loaders.MibImgLoader(options)- Input Arguments:
options - (optional) struct with fields:
waitbar- [logical] show or not the waitbar; default:falsemibPath- [char] path to MIB directorycustomSections- [logical] load custom sections only; default:falsecustomSectionsSettings- [struct] custom section parametersimgStretch- [logical] stretch uint32 images to uint16; default:falsesilentMode- [logical] do not ask user questions; default:falseverbose- [logical] show timing information; default:falseFont- [struct] font settings for dialogsParentFigure- handle of the main MIB window (parent for uiprogressdlg)
- Output Arguments:
obj - instance of the MibImgLoader class
Example 1 - create loader with options:
options.waitbar = true; loader = io.loaders.MibImgLoader(options);
- Method Summary
- loadImages(files, imginfo, options)¶
LOADIMAGES - Load image data from mibImg files.
- Syntax:
[img, imginfo] = obj.loadImages(files, imginfo, options)
This method loads the ‘res’ structure and extracts the image data, handling dimension permutation if necessary (to ensure YXCZT order).
- 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 mibImg file:
loader = io.loaders.MibImgLoader(); [imginfo, files] = loader.loadMetadata({'dataset.mibImg'}, options); [img, imginfo] = loader.loadImages(files, imginfo, options);
- loadMetadata(filenames, options)¶
LOADMETADATA - Load metadata for mibImg files.
- Syntax:
[imginfo, files] = obj.loadMetadata(filenames, options)
This method inspects .mibImg (MAT) files to extract dataset metadata. It reads the ‘res’ structure to determine dimensions, data type, and dimension ordering.
- Input Arguments:
filenames - cell array with filenames of mibImg files
options - (optional) struct with fields:
waitbar- [logical] show or not the waitbar; default:falsecustomSections- [logical] load part of the dataset; default:falseFont- [struct] font settings for dialogs
- Output Arguments:
imginfo - dictionary with image metadata containing fields:
Height- image height in pixelsWidth- image width in pixelsColors- number of color channelsDepth- number of z-slicesTime- number of time pointsimgClass- image class (uint8,uint16, etc.)ColorType-'grayscale','truecolor', or'indexed'ImageDescription- description with BoundingBox infoFormat- 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,.tunitsother format-specific metadata fields
files - structure array with file information
Example 1 - load metadata from mibImg file:
loader = io.loaders.MibImgLoader(); filenames = {'dataset.mibImg'}; [imginfo, files] = loader.loadMetadata(filenames, options);