- Timestamp:
- Jun 28, 2016, 1:05:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r961 r962 442 442 443 443 %------------------------------------------------------------------------ 444 % --- Executes on the menu Open/Browse... 444 % --- Executes on the menu Open/Browse...fill_GUI 445 445 % search the files, recognize their type according to their name and fill the rootfile input windows 446 446 function MenuBrowse_Callback(hObject, eventdata, handles) … … 452 452 fileinput=uigetfile_uvmat('pick an input file',oldfile); 453 453 hh=dir(fileinput); 454 if numel(hh)>1 454 if numel(hh)>1fill_GUI 455 455 msgbox_uvmat('ERROR','invalid input, probably a broken link'); 456 456 else … … 465 465 466 466 % ----------------------------------------------------------------------- 467 % --- Open again the file whose name has been recorded in MenuFile _1467 % --- Open again the file whose name has been recorded in MenuFile 468 468 function MenuFile_Callback(hObject, eventdata, handles) 469 469 %------------------------------------------------------------------------ … … 1695 1695 j1=str2num(get(handles.j1,'String')); 1696 1696 j2=str2num(get(handles.j2,'String')); 1697 NomType=get(hObject,'String'); 1698 if strcmp(NomType,'level') 1699 FileIndex=str2num(get(handles.i1,'String')); 1700 else 1697 1701 FileIndex=fullfile_uvmat('','','','',get(handles.NomType,'String'),i1,i2,j1,j2); 1702 end 1698 1703 set(handles.FileIndex,'String',FileIndex) 1699 1704 % refresh the current settings and refresh the field view … … 1708 1713 j1=str2num(get(handles.j1,'String')); 1709 1714 j2=str2num(get(handles.j2,'String')); 1715 NomType=get(hObject,'String'); 1716 if strcmp(NomType,'level') 1717 FileIndex=str2num(get(handles.i1,'String')); 1718 else 1710 1719 FileIndex=fullfile_uvmat('','','','',get(handles.NomType_1,'String'),i1,i2,j1,j2); 1720 end 1711 1721 set(handles.FileIndex_1,'String',FileIndex) 1712 1722 % inputfilerefresh the current settings and inputfilerefresh the field view … … 1858 1868 otherwise 1859 1869 set(handles_RootPath,'String',RootPath); 1860 rootname=fullfile(RootPath,SubDir,RootFile);1861 1870 set(handles_SubDir,'String',['/' SubDir]); 1862 1871 set(handles_RootFile,'String',['/' RootFile]); %display the separator 1863 indices=fileinput(length(rootname)+1:end); 1864 indices(end-length(FileExt)+1:end)=[]; %remove extension 1865 set(handles_FileIndex,'String',indices); 1872 if strcmp(NomType,'level') 1873 rootname=fullfile(RootPath,SubDir,'level'); 1874 rr=regexp(fileinput,['^' rootname '(?<j>\d+)/' RootFile '(?<i>\d+)' FileExt '$'],'names'); 1875 if ~isempty(rr) 1876 set(handles_FileIndex,'String',rr.i); 1877 end 1878 else 1879 rootname=fullfile(RootPath,SubDir,RootFile); 1880 indices=fileinput(length(rootname)+1:end); 1881 indices(end-length(FileExt)+1:end)=[]; %remove extension 1882 set(handles_FileIndex,'String',indices); 1883 end 1866 1884 set(handles_NomType,'String',NomType); 1867 1885 set(handles_FileExt,'String',FileExt); … … 2045 2063 if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit) 2046 2064 TimeUnit=XmlDataRead.TimeUnit; 2047 end 2065 end 2048 2066 if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time) 2049 2067 XmlData.Time=XmlDataRead.Time; 2050 2051 sizDti=size(XmlDataRead.Time,1)-1;%size of the time vector explicitly defined in the xml file2052 ind_start=1;2053 else2054 sizDti=size(XmlDataRead.Time,1);% case starting with index 02055 ind_start=0;2056 end2068 if XmlDataRead.Time(1,:)==XmlDataRead.Time(2,:)% case starting with index 1 2069 sizDti=size(XmlDataRead.Time,1)-1;%size of the time vector explicitly defined in the xml file 2070 ind_start=1; 2071 else 2072 sizDti=size(XmlDataRead.Time,1);% case starting with index 0 2073 ind_start=0; 2074 end 2057 2075 % complement the input if the whole time series is not defined 2058 % if size(i1_series,3)>size(XmlDataRead.Time,1)-ind_start %only the first time interval is defined, extrapolate to the whole series 2059 % Dti_total=XmlDataRead.Time(end)-XmlDataRead.Time(1);%total time interval covered by the time vector2060 % missing_indices=sizDti+1+ind_start:size(i1_series,3)+1;% remaining set of frame indices for which time needs to be found2061 % repeat_nbre=1+floor((missing_indices-sizDti-ind_start)/(sizDti-1));% number of repetitions of Dti2062 % time_indices=1+mod(missing_indices-sizDti-1,sizDti-1);2063 % for j=1:size(XmlDataRead.Time,2)2064 % XmlData.Time(missing_indices,j)=XmlDataRead.Time(time_indices,j)+repeat_nbre'*Dti_total;2065 % end2066 % % update the xml file with NbDti2067 % t=xmltree(XmlFileName);2068 % uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti')2069 % if isempty(uid_NbDti)2070 % uid_BurstTiming=find(t,'ImaDoc/Camera/BurstTiming')2071 % [t,uid_NbDti]=add(t,uid_BurstTiming,'element','NbDti');2072 % end2073 % [t,uid_NbDti]=add(t,uid_NbDti,'chardata',num2str(repeat_nbre(end)-1));2074 % save(t,XmlFileName)2075 % end2076 % if size(i1_series,3)>size(XmlDataRead.Time,1)-ind_start %only the first time interval is defined, extrapolate to the whole series 2077 % Dti_total=XmlDataRead.Time(end)-XmlDataRead.Time(1);%total time interval covered by the time vector 2078 % missing_indices=sizDti+1+ind_start:size(i1_series,3)+1;% remaining set of frame indices for which time needs to be found 2079 % repeat_nbre=1+floor((missing_indices-sizDti-ind_start)/(sizDti-1));% number of repetitions of Dti 2080 % time_indices=1+mod(missing_indices-sizDti-1,sizDti-1); 2081 % for j=1:size(XmlDataRead.Time,2) 2082 % XmlData.Time(missing_indices,j)=XmlDataRead.Time(time_indices,j)+repeat_nbre'*Dti_total; 2083 % end 2084 % % update the xml file with NbDti 2085 % t=xmltree(XmlFileName); 2086 % uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti') 2087 % if isempty(uid_NbDti) 2088 % uid_BurstTiming=find(t,'ImaDoc/Camera/BurstTiming') 2089 % [t,uid_NbDti]=add(t,uid_BurstTiming,'element','NbDti'); 2090 % end 2091 % [t,uid_NbDti]=add(t,uid_NbDti,'chardata',num2str(repeat_nbre(end)-1)); 2092 % save(t,XmlFileName) 2093 % end 2076 2094 end 2077 2095 set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white … … 2354 2372 2355 2373 NomType=get(handles.NomType,'String'); 2356 indices=get(handles.FileIndex,'String'); 2374 2357 2375 if strcmp(NomType,'level') 2358 2376 indices=get(handles.i1,'String'); 2359 2377 else 2378 indices=get(handles.FileIndex,'String'); 2360 2379 [tild,tild,tild,i1,i2,j1,j2]=fileparts_uvmat(indices);% the indices for the second series taken from FileIndex 2361 2380 switch index_rank
Note: See TracChangeset
for help on using the changeset viewer.