MATLAB Function Reference    
imformats

Manage file format registry

Syntax

Description

imformats displays a table of information listing all of the values in the MATLAB file format registry. This registry determines which file formats are supported by the imfinfo, imread, and imwrite functions.

formats = imformats returns a structure containing all of the values in the MATLAB file format registry. The fields in this structure are listed below.

Field
Value
ext
A cell array of strings that specify filename extensions that are valid for this format
isa
A string specifying the name of the function that determines if a file is a certain format. This can also be a function handle.
info
A string specifying the name of the function that reads information about a file. This can also be a function handle.
read
A string specifying the name of the function that reads image data in a file. This can also be a function handle.
write
A string specifying the name of the function that writes MATLAB data to a file. This can also be a function handle.
alpha
Returns 1 if the format has an alpha channel, 0 otherwise
description
A text description of the file format

formats = imformats('fmt') searches the known formats in the MATLAB file format registry for the format associated with the filename extension 'fmt'. If found, imformats returns a structure containing the characteristics and function names associated with the format. Otherwise, it returns an empty structure.

formats = imformats(format_struct) sets the MATLAB file format registry to the values in format_struct. The output structure, formats, contains the new registry settings.

formats = imformats('factory') resets the MATLAB file format registry to the default format registry values. This removes any user-specified settings.

Changes to the format registry do not persist between MATLAB sessions. To have a format always available when you start MATLAB, add the appropriate imformats command to the MATLAB startup file, startup.m, located in $MATLAB/toolbox/local on UNIX systems, or $MATLAB\toolbox\local on Windows systems.

See Also

fileformats, imfinfo, imread, imwrite, path

Bit-Mapped Images for related functions


  imfinfo import