Index: trunk/src/uigetfile_uvmat.m
===================================================================
--- trunk/src/uigetfile_uvmat.m	(revision 635)
+++ trunk/src/uigetfile_uvmat.m	(revision 641)
@@ -10,5 +10,8 @@
 % InputDir: directory to browse at first display
 
-function fileinput=uigetfile_uvmat(title,InputName)
+function fileinput=uigetfile_uvmat(title,InputName,FilterExt)
+if ~exist('FilterExt','var')
+    FilterExt='*';
+end
 fileinput=''; %default file selection
 if strcmp(title,'status_display')
@@ -59,5 +62,5 @@
     uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.75 0.8 0.2 0.04],'tag','sort_option','Callback',@refresh_GUI,'Visible','off',...
             'String',{'name';'date'},'FontUnits','points','FontSize',12,'FontWeight','bold');   
-    uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.08 0.9 0.66], 'Callback', @(src,event)list_Callback(option,src,event),'tag','list',...
+    uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.08 0.9 0.66], 'Callback', @(src,event)list_Callback(option,FilterExt,src,event),'tag','list',...
         'FontUnits','points','FontSize',12);
     uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.7 0.005 0.2 0.07],'Callback',@(src,event)close(option,src,event),...
@@ -80,5 +83,5 @@
     drawnow
 end
-refresh_GUI(findobj(hfig,'Tag','refresh'),InputFileName)% refresh the list of content of the current dir  
+refresh_GUI(findobj(hfig,'Tag','refresh'),InputFileName,FilterExt)% refresh the list of content of the current dir  
 if ~strcmp(option,'status_display')  
     uiwait(hfig)
@@ -98,5 +101,5 @@
 %------------------------------------------------------------------------   
 % --- launched by refreshing the display figure
-function refresh_GUI(hObject,InputFileName)
+function refresh_GUI(hObject,InputFileName,FilterExt)
 %------------------------------------------------------------------------
 if ~exist('InputFileName','var')
@@ -125,5 +128,5 @@
         NbOutputFile_str=num2str(NbOutputFile);
     end
-    [ListFiles,NumFiles]=list_files(DirName,1,TimeStart);% list the directory content
+    [ListFiles,NumFiles]=list_files(DirName,1,TimeStart,FilterExt);% list the directory content
     
     %% update the waitbar
@@ -140,5 +143,5 @@
     end
     hcheck_date=findobj(hfig,'tag','check_date');
-    [ListFiles,NumFiles]=list_files(DirName,get(hcheck_date,'Value'),sort_option);% list the directory content
+    [ListFiles,NumFiles]=list_files(DirName,get(hcheck_date,'Value'),sort_option,FilterExt);% list the directory content
 end
 
@@ -169,5 +172,5 @@
 %------------------------------------------------------------------------   
 % --- launched by selecting an item on the file list
-function list_Callback(option,hObject,event)
+function list_Callback(option,filter_ext,hObject,event)
 %------------------------------------------------------------------------
 hfig=get(hObject,'parent');%handle of the fig
@@ -214,5 +217,5 @@
     hcheck_date=findobj(hfig,'tag','check_date');
     
-    ListFiles=list_files(FullSelectName,get(hcheck_date,'Value'),sort_option);% list the directory content
+    ListFiles=list_files(FullSelectName,get(hcheck_date,'Value'),sort_option,filter_ext);% list the directory content
     set(hObject,'Value',1)
     set(hObject,'String',ListFiles)
@@ -242,5 +245,5 @@
 %-------------------------------------------------------------------------   
 % list the content of a directory
-function [ListFiles,NumFiles]=list_files(DirName,check_date,sort_option)
+function [ListFiles,NumFiles]=list_files(DirName,check_date,sort_option,filter_ext)
 %-------------------------------------------------------------------------
 ListStruct=dir(DirName);% get structure of the current directory
@@ -253,4 +256,5 @@
 ListFiles=ListCells(1,:);%list of file names
 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files
+
 ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display
 ListDates=cell2mat(ListCells(5,:));%list of numerical dates
@@ -262,4 +266,5 @@
 ListDates(check_dir)=max(ListDates(~check_dir))+1000; % we set the dir in front
 end
+
 if isnumeric(sort_option)|| strcmp(sort_option,'date')
     [tild,index_sort]=sort(ListDates,2,'descend');% sort files by chronological order, recent first, put the dir first in the list
@@ -270,4 +275,10 @@
 cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . )
 check_keep=cellfun('isempty', cell_remove);
+if exist('filter_ext')
+    switch filter_ext
+        case 'image'
+            check_keep=check_keep & (cellfun(@isimage,ListFiles) |check_dir);
+    end
+end
 ListFiles=[{'+/..'} ListFiles(check_keep)];
 if check_date
@@ -319,7 +330,8 @@
 
 %-------------------------------------------------------------------------   
-% launched by deleting the status figure (only used in mode series status')
+% --- launched by deleting the status figure (only used in mode series status')
+%-------------------------------------------------------------------------
 function close(option,hObject, eventdata)
-%-------------------------------------------------------------------------
+
 if strcmp(option,'status_display')
     hseries=findobj(allchild(0),'Tag','series');
@@ -330,2 +342,10 @@
 delete(gcbf)
 
+%-------------------------------------------------------------------------
+% --- check whether a file is has an image name extension 
+%-------------------------------------------------------------------------
+function CheckImage=isimage(filename)
+
+[pp,name,ext]=fileparts(filename);
+ext
+CheckImage=~isempty(ext)&&~strcmp(ext,'.')&&~isempty(imformats(regexprep(ext,'^.','')));
