- Timestamp:
- Apr 18, 2013, 9:02:03 AM (12 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r599 r611 335 335 set(handles.ListPairCiv2,'String',{''}) 336 336 Param=xml2struct(fileinput); %read parameters from the xml input file 337 fill_GUI(Param,handles );%fill the GUI with the parameters retrieved from the xml file337 fill_GUI(Param,handles.civ);%fill the GUI with the parameters retrieved from the xml file 338 338 return 339 339 end … … 534 534 MaxIndex_i=min(size(time,1),MaxIndex_i);%possibly adjust the max index according to time data 535 535 MaxIndex_j=min(size(time,2),MaxIndex_j); 536 time=[zeros(size(time,1),1) time]; %insert a vertical line of zeros (to deal with zero file indices)537 time=[zeros(1,size(time,2)); time]; %insert a horizontal line of zeros536 % time=[zeros(size(time,1),1) time]; %insert a vertical line of zeros (to deal with zero file indices) 537 % time=[zeros(1,size(time,2)); time]; %insert a horizontal line of zeros 538 538 else 539 539 set(handles.ImaDoc,'String',''); %xml file not used for timing -
trunk/src/imadoc2struct.m
r591 r611 6 6 % s: structure representing ImaDoc 7 7 % s.Heading: information about the data hierarchical structure 8 % s.Time: matrix of times 8 % s.Time: matrix of times, note that s.Time(i+1,j+1) is the time for file indices i and j (in order to deal with index 0) 9 9 % s.TimeUnit 10 10 % s.GeometryCalib: substructure containing the parameters for geometric calibration … … 101 101 end 102 102 end 103 s.Time=[zeros(size(s.Time,1),1) s.Time]; %insert a vertical line of zeros (to deal with zero file indices) 104 s.Time=[zeros(1,size(s.Time,2)); s.Time]; %insert a horizontal line of zeros 103 105 end 104 106 -
trunk/src/series.m
r610 r611 764 764 MaxIndex_i=MaxIndexTable{iview,1}; 765 765 MaxIndex_j=MaxIndexTable{iview,2}; 766 if isempty(MinIndex_j)% only i index 767 if MinIndex_i>0 768 TimeTable{iview,1}=time(MinIndex_i+1); 769 end 770 TimeTable{iview,2}=time(first_i+1); 771 TimeTable{iview,3}=time(last_i+1); 772 TimeTable{iview,4}=time(MaxIndex_i+1); 773 elseif ~isempty(time) 774 if MinIndex_i>0 775 TimeTable{iview,1}=time(MinIndex_i,MinIndex_j); 766 % if isempty(MinIndex_j)% only i index 767 % TimeTable{iview,1}=time(MinIndex_i+1,2); 768 % TimeTable{iview,2}=time(first_i+1,2); 769 % TimeTable{iview,3}=time(last_i+1,2); 770 % TimeTable{iview,4}=time(MaxIndex_i+1,2); 771 if ~isempty(time) 772 TimeTable{iview,1}=time(MinIndex_i+1,MinIndex_j+1); 773 if size(time)>=[first_i+1 first_j+1] 774 TimeTable{iview,2}=time(first_i+1,first_j+1); 776 775 end 777 776 if size(time)>=[last_i+1 last_j+1] 778 TimeTable{iview,2}=time(first_i+1,first_j+1);779 777 TimeTable{iview,3}=time(last_i+1,last_j+1); 780 778 end … … 866 864 % y=(0.5:nbview-0.5)*Position(4)/nbview; 867 865 range_y=max(1,floor(Position(4)/nbview)); 868 CData=zeros(nbview*range_y, Position(3));866 CData=zeros(nbview*range_y,floor(Position(3))); 869 867 for iview=1:nbview 870 868 ind_y=1+(iview-1)*range_y:iview*range_y; -
trunk/src/uigetfile_uvmat.m
r610 r611 45 45 Bottom=ScreenSize(4)-Height-40; %put fig at top right 46 46 hfig=figure('name',option,'tag',option,'MenuBar','none','NumberTitle','off','Unit','points','Position',[Left,Bottom,Width,Height],'UserData',InputDir); 47 uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.09 0.9 0.71], 'Callback', @(src,event)view_file(option,src,event),'tag','list',... 47 BackgroundColor=get(hfig,'Color'); 48 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.97 0.5 0.03],'BackgroundColor',BackgroundColor,... 49 'String','path:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left'); 50 uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.89 0.9 0.08],'tag','titlebox','Max',2,'BackgroundColor',[1 1 1],... 51 'String',InputDir,'FontUnits','points','FontSize',12,'FontWeight','bold'); 52 % uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.85 0.5 0.03],'BackgroundColor',BackgroundColor,... 53 % 'String','first modified:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right'); 54 % uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.82 0.5 0.03],'BackgroundColor',BackgroundColor,... 55 % 'String','last modified:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right'); 56 uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.08 0.9 0.66], 'Callback', @(src,event)view_file(option,src,event),'tag','list',... 48 57 'FontUnits','points','FontSize',12); 49 uicontrol('Style','edit','Units','normalized', 'Position', [0.05 0.87 0.9 0.1],'tag','titlebox','Max',2,... 50 'String',InputDir,'FontUnits','points','FontSize',12,'FontWeight','bold'); 51 uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.7 0.01 0.2 0.07],'Callback',@(src,event)close(option,src,event),... 58 uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.7 0.005 0.2 0.07],'Callback',@(src,event)close(option,src,event),... 52 59 'String','Close','FontWeight','bold','FontUnits','points','FontSize',12); 53 uicontrol('Style','pushbutton','Tag','refresh','Units','normalized','Position', [0.1 0.0 10.2 0.07],'Callback',@refresh_GUI,...60 uicontrol('Style','pushbutton','Tag','refresh','Units','normalized','Position', [0.1 0.005 0.2 0.07],'Callback',@refresh_GUI,... 54 61 'String','Refresh','FontWeight','bold','FontUnits','points','FontSize',12); 55 62 %set(hrefresh,'UserData',StatusData) … … 59 66 uicontrol('Style','frame','Units','normalized', 'Position', [0.05 0.81 0.9 0.05]); 60 67 else %put a title and additional pushbuttons 61 uicontrol('Style','text','Units','normalized', 'Position', [0.15 0. 81 0.8 0.03],...68 uicontrol('Style','text','Units','normalized', 'Position', [0.15 0.75 0.8 0.03],'BackgroundColor',BackgroundColor,... 62 69 'String',title,'FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left'); 63 uicontrol('Style','pushbutton','Tag','backward','Units','normalized','Position',[0.05 0. 80.1 0.07],...70 uicontrol('Style','pushbutton','Tag','backward','Units','normalized','Position',[0.05 0.75 0.1 0.07],... 64 71 'String','<--','FontWeight','bold','FontUnits','points','FontSize',12,'Callback',@backward); 65 uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.4 0.0 10.2 0.07],...72 uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.4 0.005 0.2 0.07],... 66 73 'String','Home','FontWeight','bold','FontUnits','points','FontSize',12,'Callback',@home_dir); 67 74 end … … 71 78 if ~strcmp(option,'status_display') 72 79 uiwait(hfig) 73 fileinput=get(hfig,'UserData');% retrieve the input file selection 80 htitlebox=findobj(hfig,'Tag','titlebox'); 81 fileinput=get(htitlebox,'String');% retrieve the input file selection 74 82 delete(hfig) 75 83 end … … 85 93 end 86 94 hfig=get(hObject,'parent'); 87 DirName=get(hfig,'UserData'); 95 htitlebox=findobj(hfig,'tag','titlebox'); 96 DirName=get(htitlebox,'String'); 88 97 ListFiles=list_files(DirName);% list the directory content 89 98 hlist=findobj(hfig,'tag','list');% find the list object … … 109 118 110 119 111 htitlebox=findobj(hfig,'tag','titlebox'); 120 112 121 hlist=findobj(hfig,'tag','list'); 113 OutputDir=get(hfig,'UserData');122 % OutputDir=get(hfig,'UserData'); 114 123 115 124 testrecent=0; … … 168 177 index=get(hObject,'Value'); 169 178 hfig=get(hObject,'parent');%handle of the fig 170 DirName=get(hfig,'UserData'); 179 htitlebox=findobj(hfig,'tag','titlebox'); % display the new dir name 180 DirName=get(htitlebox,'String'); 171 181 SelectName=regexprep(list{index},'^\+/','');% remove the +/ used to mark dir 172 182 if strcmp(SelectName,'..')% the upward dir option has been selected … … 195 205 set(hObject,'Value',1) 196 206 set(hObject,'String',ListFiles) 197 set(hfig,'UserData',FullSelectName)% record the new dir name 198 htitlebox=findobj(hfig,'tag','titlebox'); % display the new dir name 199 set(htitlebox,'String',FullSelectName) 207 set(htitlebox,'String',FullSelectName)% record the new dir name 200 208 elseif exist(FullSelectName,'file')%visualise the field if it exists 201 209 FileType=get_file_type(FullSelectName); … … 210 218 switch option 211 219 case 'browser' 212 hfig=get(hObject,'parent'); 213 set(hfig,'UserData',FullSelectName); 220 set(htitlebox,'String',FullSelectName); 214 221 uiresume(hfig) 215 222 case 'status_display' 216 223 uvmat(FullSelectName); 217 224 end 218 set(gcbo,'Value',1)219 225 end 220 226 end … … 222 228 %------------------------------------------------------------------------- 223 229 % list the content of a directory 224 function ListFiles=list_files(DirName)230 function [ListFiles,ListDates]=list_files(DirName) 225 231 %------------------------------------------------------------------------- 226 232 ListStruct=dir(DirName);% get structure of the current directory 227 if numel(ListStruct)<1 233 if numel(ListStruct)<1 % case of empty dir 228 234 ListFiles={}; 235 ListDates={}; 229 236 return 230 237 end 231 if strcmp(ListStruct(1).name,'.')232 ListStruct(1)=[];%removes the first line ='.'233 end238 % if strcmp(ListStruct(1).name,'.') 239 % ListStruct(1)=[];%removes the first line ='.' 240 % end 234 241 ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray 235 242 ListFiles=ListCells(1,:);%list of file names 236 check_dir=cell2mat(ListCells(4,:));% check directories 243 check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files 244 ListDates=cell2mat(ListCells(5,:));%list of numerical dates 237 245 ListFiles(check_dir)=regexprep(ListFiles(check_dir),'^.+','+/$0');% put '+/' in front of dir name display 238 [tild,index_sort]=sort(check_dir,2,'descend');% sort 246 ListDates(check_dir)=0; % we set the dir dates to 0 247 [tild,index_sort]=sort(check_dir,2,'descend');% put the dir first in the list 239 248 ListFiles=ListFiles(index_sort);% list of names sorted by alaphabetical order and dir and file 249 ListDates=ListDates(index_sort);% sort the corresponding dates 240 250 cell_remove=regexp(ListFiles,'^(-|\.|\+/\.)');% detect strings beginning by '-' ,'.' or '+/.'(dir beginning by . ) 241 251 check_keep=cellfun('isempty', cell_remove); 242 252 ListFiles=[{'+/..'} ListFiles(check_keep)]; 253 ListDates=[0 ListDates(check_keep)]; 243 254 244 255 %------------------------------------------------------------------------ … … 249 260 ListFiles=list_files(DirName);% list the directory content 250 261 hfig=get(hObject,'parent'); 251 set(hfig,'UserData',DirName)% record the new dir name 252 htitlebox=findobj(hfig,'tag','titlebox'); % display the new dir name 253 set(htitlebox,'String',DirName) 254 hlist=findobj(hfig,'tag','list');% find the list object 262 htitlebox=findobj(hfig,'Tag','titlebox'); 263 set(htitlebox,'String',DirName)% record the new dir name 264 hlist=findobj(hfig,'tag','list');% find the list object 255 265 set(hlist,'String',ListFiles) 256 266 %------------------------------------------------------------------------ … … 263 273 if ~isempty(PrevDir) 264 274 hfig=get(hObject,'parent'); 265 set(hfig,'UserData',PrevDir)266 275 htitlebox=findobj(hfig,'tag','titlebox'); % display the new dir name 267 276 set(htitlebox,'String',PrevDir) -
trunk/src/uvmat.m
r609 r611 353 353 end 354 354 fileinput=uigetfile_uvmat('select an input file:',oldfile); 355 356 %% display the selected field and related information 355 357 if ~isempty(fileinput) 356 358 display_file_name(handles,fileinput) 357 359 end 358 359 %% display the selected field and related information360 % display_file_name( handles,fileinput)361 360 362 361 % ----------------------------------------------------------------------- … … 895 894 warntext='';%default warning message 896 895 NbSlice=1;%default 896 ImaDoc_str=''; 897 897 set(handles.RootPath,'BackgroundColor',[1 1 1]) 898 898 if ~isempty(XmlFileName) 899 899 set(handles.view_xml,'Visible','on') 900 set(handles.view_xml,'BackgroundColor',[1 1 0]) 900 set(handles.view_xml,'BackgroundColor',[1 1 0])% paint to yellow color to indicate reading of the xml file 901 901 set(handles.view_xml,'String','view .xml') 902 902 drawnow … … 905 905 msgbox_uvmat('WARNING',warntext) 906 906 end 907 if isempty(XmlDataRead) 908 set(handles.view_xml,'Visible','off') 909 else 910 set(handles.view_xml,'String',['view ' DocExt]) 907 if ~isempty(XmlDataRead) 908 ImaDoc_str=['view ' DocExt]; 911 909 XmlData=XmlDataRead; 912 910 if isfield(XmlData,'TimeUnit') … … 915 913 end 916 914 end 917 set(handles.view_xml,'BackgroundColor',[1 1 1]) 915 set(handles.view_xml,'BackgroundColor',[1 1 1])% paint black to white 918 916 drawnow 919 917 if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib) … … 936 934 if ~(isfield(XmlData,'Time')&& ~isempty(XmlData.Time)) 937 935 XmlData.Time=Time; %time set by video 936 end 937 if isempty(ImaDoc_str) 938 set(handles.view_xml,'Visible','off') 939 else 940 set(handles.view_xml,'String',ImaDoc_str) 938 941 end 939 942 … … 2378 2381 end 2379 2382 siz=size(UvData.XmlData{1}.Time); 2380 if ~isempty(num_i1)&& ~isempty(num_i2) && num_i1> 0 &&siz(1)>=max(num_i1,num_i2) && siz(2)>=max(num_j1,num_j2)2381 abstime=(UvData.XmlData{1}.Time(num_i1 ,num_j1)+UvData.XmlData{1}.Time(num_i2,num_j2))/2;%overset the time read from files2382 dt=(UvData.XmlData{1}.Time(num_i2 ,num_j2)-UvData.XmlData{1}.Time(num_i1,num_j1));2383 if ~isempty(num_i1)&& ~isempty(num_i2) && num_i1>=0 &&siz(1)>=max(num_i1,num_i2) && siz(2)>=max(num_j1,num_j2) 2384 abstime=(UvData.XmlData{1}.Time(num_i1+1,num_j1+1)+UvData.XmlData{1}.Time(num_i2+1,num_j2+1))/2;%overset the time read from files 2385 dt=(UvData.XmlData{1}.Time(num_i2+1,num_j2+1)-UvData.XmlData{1}.Time(num_i1+1,num_j1+1)); 2383 2386 Field{1}.Dt=dt; 2384 2387 if isfield(UvData.XmlData{1},'TimeUnit') … … 5301 5304 end 5302 5305 end 5306 5307 5308
Note: See TracChangeset
for help on using the changeset viewer.