Ignore:
Timestamp:
Jun 24, 2024, 6:38:26 PM (3 months ago)
Author:
sommeria
Message:

browse_data improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/imadoc2struct.m

    r1149 r1150  
    7070        s.Camera.FirstFrameIndexI=1; %first index assumed equl to 1 by default
    7171    end
    72     Timing=s.Camera.BurstTiming;
    73     if ~iscell(Timing)
    74         Timing={Timing};
    75     end
     72    s.Time=xmlburst2time(s.Camera.BurstTiming,s.Camera.FirstFrameIndexI);
     73end
    7674
    77     s.Time=[];
    78     for k=1:length(Timing)
    79         Frequency=1;
    80         if isfield(Timing{k},'FrameFrequency')
    81             Frequency=Timing{k}.FrameFrequency;
    82         end
    83         Dtj=[];
    84         if isfield(Timing{k},'Dtj')
    85             Dtj=Timing{k}.Dtj/Frequency;%Dtj converted from frame unit to TimeUnit (e.g. 's');
    86         end
    87         NbDtj=1;
    88         if isfield(Timing{k},'NbDtj')&&~isempty(Timing{k}.NbDtj)
    89             NbDtj=Timing{k}.NbDtj;
    90         end
    91         Dti=[];
    92         if isfield(Timing{k},'Dti')
    93             Dti=Timing{k}.Dti/Frequency;%Dti converted from frame unit to TimeUnit (e.g. 's');
    94         end
    95         NbDti=1;
    96         if isfield(Timing{k},'NbDti')&&~isempty(Timing{k}.NbDti)
    97             NbDti=Timing{k}.NbDti;
    98         end
    99         Time_val=Timing{k}.Time;%time in TimeUnit
    100         if ~isempty(Dti)
    101             Dti=reshape(Dti'*ones(1,NbDti),NbDti*numel(Dti),1); %concatene Dti vector NbDti times
    102             Time_val=[Time_val;Time_val(end)+cumsum(Dti)];%append the times defined by the intervals  Dti
    103         end
    104         if ~isempty(Dtj)
    105             Dtj=reshape(Dtj'*ones(1,NbDtj),1,NbDtj*numel(Dtj)); %concatene Dtj vector NbDtj times
    106             Dtj=[0 Dtj];
    107             Time_val=Time_val*ones(1,numel(Dtj))+ones(numel(Time_val),1)*cumsum(Dtj);% produce a time matrix with Dtj
    108         end
    109         % reading Dtk
    110         Dtk=[];%default
    111         NbDtk=1;%default
    112         if isfield(Timing{k},'Dtk')
    113             Dtk=Timing{k}.Dtk;
    114         end
    115         if isfield(Timing{k},'NbDtk')&&~isempty(Timing{k}.NbDtk)
    116             NbDtk=Timing{k}.NbDtk;
    117         end
    118         if isempty(Dtk)
    119             s.Time=[s.Time;Time_val];
    120         else
    121             for kblock=1:NbDtk+1
    122                 Time_val_k=Time_val+(kblock-1)*Dtk;
    123                 s.Time=[s.Time;Time_val_k];
    124             end
    125         end
    126     end
    127    
    128     s.Time=[zeros(size(s.Time,1),1) s.Time]; %insert a vertical line of zeros (to deal with zero file indices)
    129     if s.Camera.FirstFrameIndexI~=0
    130     s.Time=[zeros(s.Camera.FirstFrameIndexI,size(s.Time,2)); s.Time]; %insert a horizontal line of zeros
    131     end
    132 end
    13375
    13476function [s,errormsg]=read_subtree(subt,Data,NbOccur,NumTest)
Note: See TracChangeset for help on using the changeset viewer.