Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Guide, load image from folder
Date: Sat, 29 Nov 2008 04:18:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 43
Message-ID: <ggqfpq$4aq$1@fred.mathworks.com>
References: <ggq8t2$mcg$1@fred.mathworks.com> <ggqa9i$679$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227932282 4442 172.30.248.35 (29 Nov 2008 04:18:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 29 Nov 2008 04:18:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1343420
Xref: news.mathworks.com comp.soft-sys.matlab:503749


"Rui Gomes" <rpgomes84@gmail.com> wrote in message <ggqa9i$679$1@fred.mathworks.com>...
> "Rui Gomes" <rpgomes84@gmail.com> wrote in message <ggq8t2$mcg$1@fred.mathworks.com>...
> > Hi, i need to load several images, and is the user who will select the image.
> > 
> > what i want to do is, with a button open a menu to the user chose the image, and then the program will display the image, that will be process (in the future :P).
> > 
> > thanks for the help.
> > 
> 
> that is what i found to the moment in the guide i program a calback of a button
> 
> function button_open_Callback(hObject, eventdata, handles)
> 
> %%load image
> image_loaded=UIIMPORT('-file');
> 
> axes(handles.axes2);
> image(image_loaded); 
> axis off;
> 
> guidata(hObject, handles);
> 
> this code do not work because where:
> 
> image(image_loaded); 
> 
> is expecting this image(image_loaded.filename);
> 
> there is any way to get this filename ??
> 
>  thanks for the help.
-------------------------------------------------------------------------------------
Try this:

clc;
[FileName,PathName,FilterIndex] = uigetfile('*.*');
fullFileName = fullfile(PathName, FileName);
inputImageArray = imread(fullFileName);
image(inputImageArray); 
axis off; 

Regards,
ImageAnalyst