Thread Subject: gui toolbar load image

Subject: gui toolbar load image

From: Matt Fetterman

Date: 25 Apr, 2011 03:22:04

Message: 1 of 4

Trying to make a GUI so that the user can select an image file from the directory, load the file. without the gui I would write: A=imread('joker.tif');
but with the gui, the user would have the advantage to look in the directory.

I would like to use the "Open File" function in the Toolbar.
When I use the open file, the default is set so that it opens ".fig" files.
How could I set the default to .tif files, and then can I make it so it stores the data in some variable.

Subject: gui toolbar load image

From: Nasser M. Abbasi

Date: 25 Apr, 2011 03:48:53

Message: 2 of 4

On 4/24/2011 8:22 PM, Matt Fetterman wrote:
> Trying to make a GUI so that the user can select an image file
> from the directory, load the file. without the gui I would write: A=imread('joker.tif');
> but with the gui, the user would have the advantage to look in the directory.
>
> I would like to use the "Open File" function in the Toolbar.
> When I use the open file, the default is set so that it opens ".fig" files.
> How could I set the default to .tif files, and then can I make it so
> it stores the data in some variable.


I think if you just use type uigetfile('*.fig')

then it should only list these files in the search file window.

I do not know what you mean by

" make it so it stores the data in some variable."

If you mean as in to read the file? then there are many ways to read data
in Matlab. Help fopen is a starter.

HTH

--Nasser

Subject: gui toolbar load image

From: ImageAnalyst

Date: 25 Apr, 2011 03:59:22

Message: 3 of 4

On Apr 24, 11:22 pm, "Matt Fetterman" <mattinjer...@yahoo.com> wrote:
> Trying to make a GUI so that the user can select an image file from the directory, load the file. without the gui I would write: A=imread('joker.tif');
> but with the gui, the user would have the advantage to look in the directory.
>
> I would like to use the "Open File" function in the Toolbar.
> When I use the open file, the default is set so that it opens ".fig" files.
> How could I set the default to .tif files, and then can I make it so it stores the data in some variable.

---------------------------------------------------
Matt:
Sounds tedious and inconvenient for your user. Why don't you just put
all the image filenames into a listbox and let the user click on one
to display it or analyze it? That would be so much easier and
convenient. You could also have a button that lets them specify the
folder. In fact, this is just what MAGIC does. Why don't you check
magic out?
http://www.mathworks.com/matlabcentral/fileexchange/24224
-ImageAnalyst

Subject: gui toolbar load image

From: Matt Fetterman

Date: 25 Apr, 2011 04:23:06

Message: 4 of 4

Thanks guys for helpful comments. - Matt

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com