4.94118

4.9 | 18 ratings Rate this file 155 downloads (last 30 days) File Size: 6.8 KB File ID: #10867

uipickfiles: uigetfile on steroids

by Douglas Schwarz

 

25 Apr 2006 (Updated 20 Mar 2007)

Code covered by BSD License  

Many-featured, platform independent file and directory picker.

Download Now | Watch this File

File Information
Description

This is a GUI application that allows multiple files or directories to be selected and allows you to manage the list (remove files, reorder, etc.) before returning. It has basic filtering as well as regular expression filtering and navigation of the file system is easy. The output is configurable (cell, struct or char arrays). It is written entirely in M and so is platform independent -- there are no dll's or mex functions.

MATLAB release MATLAB 7.4 (R2007a)
Other requirements Tested on Windows XP and Mac OS X.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (26)
17 May 2006 Scott Miller

Sweet. This saves me a lot of time; I was going to have to write one of these myself. I like that it is written completely in m script; there is really no point in writting such an interface as a dll if you don't have to, and this makes is easy to customize. It also doesn't seem to to have that "where's my dialog box?" effect of uigetfiles, (NOT uigetfile!), where occasionally, randomly, the dialog box will "open" with the window closed on startup. My only complaint as a windows user is uipickfiles has that funny UNIX smell to the UI (e.g., "..\" instead of an up arrow, files are sorted by case and then alphabetically instead of alphabetically), but hey, you can't have everything, and the script is right there if you want to change something.

15 Jun 2006 Laszlo Totthfalusi

Smashing, cool

10 Jul 2006 Lennaert Klerk

Great!! This saved me so much time and is going to be used a lot by me and my colleagues....

24 Jul 2006 Johann Boleininger

Very useful, many thanks.

17 Feb 2007 Oleksnadr Dzyubak

Just Great!!!
I work on Linux where uigetfile is buggy.
The "uipickfiles" is an excellent workarround.
Many thanks!

16 Mar 2007 Chris K

The interface looks great, but I can't use it because of the following error and others.

??? Subscripted assignment between dissimilar structures.

Error in ==> uipickfiles>add at 353
dir_picks(end + 1) = dir_pick;

??? Error using ==> waitfor
Error while evaluating uicontrol Callback

I am running:
MATLAB Version 7.4.0.287 (R2007a) on Mac OS X

20 Mar 2007 Douglas Schwarz

TMW changed the struct returned by dir in R2007a. I have updated uipickfiles accordingly. (It will still work with older versions of MATLAB.) Thanks for the report.

21 Mar 2007 Chris K

Thank you for updating it! I am thrilled to be able use it!

10 Apr 2007 Patrick Naulleau

Any chance of getting a non-nested function version of this allowing it to work in earlier versions of Matlab?

11 Apr 2007 Douglas Schwarz

Patrick, yes it could be done. Email me and we'll discuss it. -- Doug

18 May 2007 Elakkat D

reallay useful tool

11 Jun 2007 Oleksandr (Alex) Dzyubak

I am working on image processing and for me that is usual practice to have more than 100 images in a set. The native MATLAB utility uigetfile does not support that at the moment.
In fact, uipickfiles DOES. Which is more, it works in Linux and Windows and for R2006b and R2007a. Thanks Douglas!!! Nice product!

Alex

06 Jul 2007 B. Andre Weisntock

I needed an intuitive way for a non-MatLab user to load multiple directories into a MatLab stand-alone application and this product was EXACTLY what was needed. Perfect. Many thanks Doug!

04 Feb 2008 Jeff Meganck

Incredibly useful, very well written program. I have incorporated this program into almost all of my own scripts. I just upgraded to R2007b(7.5.0) and started to get the following problem:

??? Subscripted assignment between dissimilar structures.

Error in ==> uipickfiles>add at 353
dir_picks(end + 1) = dir_pick;

??? Error using ==> waitfor
Error while evaluating uicontrol Callback

The fix was easy. Add 'datenum',[] at the end of line 171 so that it reads:
dir_picks = struct('name',{},'date','','bytes',[],'isdir',[],'datenum',[]);

28 Mar 2008 Joe Spernyak

Great for Queue'ing up lots of files/datasets for overnite processing.

19 Aug 2008 Thomas Ibbotson

This looks like just what I need. However I was getting an error when I first tried to use it. It appears that if you specify a filter which returns no files, there is an error:

??? Error using ==> vertcat
CAT arguments are not consistent in structure field number.

Error in ==> uipickfiles>filtered_dir at 762
d = [ddot1;ddot2;dfiles(index1);ddir(index2)];

Error in ==> uipickfiles at 164
fdir = filtered_dir(full_filter,re_filter);

I fixed this by adding these lines:

762 if ~isempty(dfiles)
763 d = [ddot1;ddot2;dfiles(index1);ddir(index2)];
764 else
765 d = [ddot1;ddot2;ddir(index2)];
766 end

It might not be the best way to do it, but it works for me.

20 Aug 2008 Ben Bratton

Excellent code. Very helpful for myself and colleagues. We work with image processing and this greatly simplifies our lives.

09 Oct 2008 Rene Michels

Great Job,

THX for sharing! It really helps me out!!
Greetings,
Rene

23 Jan 2009 Skip

Very useful. Thank you!

Is it possible to have files added to the list in Ctrl+click order? This would avoid the need to sort files after selecting.

24 Jan 2009 Douglas Schwarz

Skip, you can double-click on a file and it will be added to the list immediately. That may be sufficient for your purposes, but I will look into your suggestion.

24 Jun 2009 J W

Great File! One quick question though - how might I go about removing hidden files from file lists? I notice that when I have hidden files in the same directory as the images I am trying to retrieve, hidden file versions with prefix '._' appear first making file selection very non-intuitive. Any solutions?

25 Jun 2009 J W

Actually, I just found a workaround. At every designation of 'filenames' I follow it with a series of loops testing each filename to see if it is preceded by '._' My supplement to the code is working well if anyone needs to have hidden files removed from file lists.

25 Jun 2009 Douglas Schwarz

J W, what platform are you using and what kinds of files are those? Do the hidden files somehow pair up with non-hidden versions so you have both ._abc.txt and abc.txt? It would be easy to add a feature so that hidden files are not displayed in uipickfiles as long as we can identify them. Tell me more.

11 Sep 2009 Nathan Greco

Very useful, especially when loading in multiple files at one with a regexp filter. Thanks a lot!

14 Sep 2009 Bernd

This would have saved me a lot of programming, well it will even save some time in future....perfekt, classic 5 stars for SUPERUSEFUL

07 Nov 2009 Weimin  
Please login to add a comment or rating.
Updates
20 Mar 2007

Updated to work with R2007a.

Tag Activity for this File
Tag Applied By Date/Time
gui tools Douglas Schwarz 22 Oct 2008 08:23:18
example Douglas Schwarz 22 Oct 2008 08:23:18
uigetfile uigetfiles files directory Douglas Schwarz 22 Oct 2008 08:23:18
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com