Changeset 950 for trunk/src/uvmat.m


Ignore:
Timestamp:
Jun 11, 2016, 9:32:29 PM (8 years ago)
Author:
sommeria
Message:

various updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/uvmat.m

    r946 r950  
    19701970UvData.j1_series{index}=j1_series;
    19711971UvData.j2_series{index}=j2_series;
     1972nbfield=max(max(max(i2_series)));% total number of fields (i index)
     1973if isempty(nbfield)
     1974    nbfield=max(max(max(i1_series)));
     1975end
     1976nbfield_j=max(max(max(j2_series)));% number of fields along j index
     1977if isempty(nbfield_j)
     1978    nbfield_j=max(max(max(j1_series)));
     1979end
    19721980
    19731981%% read timing and total frame number from the current file (e.g. movie files)
     
    20202028        if isfield(XmlDataRead,'TimeUnit')&& ~isempty(XmlDataRead.TimeUnit)
    20212029            TimeUnit=XmlDataRead.TimeUnit;
    2022         end
     2030        end   
    20232031        if isfield(XmlDataRead,'Time')&& ~isempty(XmlDataRead.Time)
    20242032            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
    20252059        end
    20262060        set(handles.view_xml,'BackgroundColor',[1 1 1])% paint back to white
     
    20702104
    20712105%% 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 end
    2076 nbfield_j=max(max(max(j2_series)));
    2077 if isempty(nbfield_j)
    2078     nbfield_j=max(max(max(j1_series)));
    2079 end
    20802106if isfield(XmlData,'Time')&& ~isempty(XmlData.Time)
    20812107    %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.