MATLAB Function Reference Previous page   Next Page
imformats

Manage file format registry

Syntax

Description

imformats displays a table of information listing all 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 the values in the MATLAB file format registry. The following tables lists the fields in the order they appear in the structure.

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.

Example

See Also

fileformats, imfinfo, imread, imwrite, path

Bit-Mapped Images for related functions


Previous page  imfinfo importdata Next page

© 1994-2005 The MathWorks, Inc.