Open GUI dialogue to select image files.
The GUI dialogue opened is exactly the same as uigetfile
but uses
recognized image file formats as file filter. All other options from
uigetfile
are accepted.
The return value path is a string with the full filepath of the
selected file. If the "MultiSelect"
option is selected, then a
cell array of strings is returned.
flag is a logical value, true if there was any issue with file selection such as the user closing or cancelling the dialogue with selecting a file. It has a value of false otherwise.
[filepath, flag] = imgetfile (); if (flag) error ("A file must be selected"); endif
There is no guarantee that imread
will be capable to read all
files selected via this dialogue. Possible reasons for this are:
imformats
.
This only means that a format with such extensions is registered, not
necessarily that read or write support has been implemented;
The opposite is also true. imread
is able to guess the file
format even when the file extension is incorrect (or even in the absence
of a file extension). A file that is filtered out may still be readable
by imread
or imfinfo
.
See also: imformats, uigetfile.
Package: image