Changeset 950 for trunk/src/uvmat.m
- Timestamp:
- Jun 11, 2016, 9:32:29 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r946 r950 1970 1970 UvData.j1_series{index}=j1_series; 1971 1971 UvData.j2_series{index}=j2_series; 1972 nbfield=max(max(max(i2_series)));% total number of fields (i index) 1973 if isempty(nbfield) 1974 nbfield=max(max(max(i1_series))); 1975 end 1976 nbfield_j=max(max(max(j2_series)));% number of fields along j index 1977 if isempty(nbfield_j) 1978 nbfield_j=max(max(max(j1_series))); 1979 end 1972 1980 1973 1981 %% read timing and total frame number from the current file (e.g. movie files) … … 2020 2028 if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit) 2021 2029 TimeUnit=XmlDataRead.TimeUnit; 2022 end 2030 end 2023 2031 if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time) 2024 2032 XmlData.Time=XmlDataRead.Time; 2033 if XmlDataRead.Time(1,:)==XmlDataRead.Time(2,:)% case starting with index 1 2034 sizDti=size(XmlDataRead.Time,1)-1;%size of the time vector explicitly defined in the xml file 2035 ind_start=1; 2036 else 2037 sizDti=size(XmlDataRead.Time,1);% case starting with index 0 2038 ind_start=0; 2039 end 2040 % complement the input if the whole time series is not defined 2041 if size(i1_series,3)>size(XmlDataRead.Time,1)-ind_start %only the first time interval is defined, extrapolate to the whole series 2042 Dti_total=XmlDataRead.Time(end)-XmlDataRead.Time(1);%total time interval covered by the time vector 2043 missing_indices=sizDti+1+ind_start:size(i1_series,3)+1;% remaining set of frame indices for which time needs to be found 2044 repeat_nbre=1+floor((missing_indices-sizDti-ind_start)/(sizDti-1));% number of repetitions of Dti 2045 time_indices=1+mod(missing_indices-sizDti-1,sizDti-1); 2046 for j=1:size(XmlDataRead.Time,2) 2047 XmlData.Time(missing_indices,j)=XmlDataRead.Time(time_indices,j)+repeat_nbre'*Dti_total; 2048 end 2049 % update the xml file with NbDti 2050 t=xmltree(XmlFileName); 2051 uid_NbDti=find(t,'ImaDoc/Camera/BurstTiming/NbDti') 2052 if isempty(uid_NbDti) 2053 uid_BurstTiming=find(t,'ImaDoc/Camera/BurstTiming') 2054 [t,uid_NbDti]=add(t,uid_BurstTiming,'element','NbDti'); 2055 end 2056 [t,uid_NbDti]=add(t,uid_NbDti,'chardata',num2str(repeat_nbre(end)-1)); 2057 save(t,XmlFileName) 2058 end 2025 2059 end 2026 2060 set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white … … 2070 2104 2071 2105 %% store last index in handles.MaxIndex_i and .MaxIndex_j 2072 nbfield=max(max(max(i2_series)));2073 if isempty(nbfield)2074 nbfield=max(max(max(i1_series)));2075 end2076 nbfield_j=max(max(max(j2_series)));2077 if isempty(nbfield_j)2078 nbfield_j=max(max(max(j1_series)));2079 end2080 2106 if isfield(XmlData,'Time')&& ~isempty(XmlData.Time) 2081 2107 %transform .Time to a column vector if it is a line vector the nomenclature uses a single index
Note: See TracChangeset
for help on using the changeset viewer.