Changeset 621


Ignore:
Timestamp:
Apr 26, 2013, 8:12:29 PM (8 years ago)
Author:
sommeria
Message:

pb of time repaired in civ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r611 r621  
    512512        set(handles.ListPairMode,'String',{'series(Di)'})
    513513        MaxIndex_i=get(MovieObject,'NumberOfFrames');
    514         time=(dt*(0:MaxIndex_i-1))';%list of image times
     514        %time=(dt*(0:MaxIndex_i-1))';%list of image times
     515                    time=zeros(MaxIndex_i+1,2);
     516            time(:,2)=dt*(0:MaxIndex_i)';
    515517    else
    516518        set(handles.ListPairMode,'String',[{'series(Dj)'};{'series(Di)'}])
    517519        MaxIndex_i=max(i1_series(i1_series>0));
    518520        MaxIndex_j=get(MovieObject,'NumberOfFrames');
    519         time=ones(MaxIndex_i,1)*(dt*(0:MaxIndex_j-1));%list of image times
     521        %time=ones(MaxIndex_i,1)*(dt*(0:MaxIndex_j-1));%list of image times
     522        time=[0;dt*ones(MaxIndex_j,1)]*(0:MaxIndex_j);
    520523        enable_j(handles,'on')
    521524    end
     
    527530%show the reference image edit box if relevant (not needed for movies or in the absence of time information
    528531if numel(time)>=2 % if there are at least two time values to define dt
    529     if size(time,1)<MaxIndex_i;
     532    if size(time,1)<MaxIndex_i+1;
    530533        msgbox_uvmat('WARNING','maximum i index restricted by the timing of the xml file');
    531     elseif size(time,2)<MaxIndex_j
     534    elseif size(time,2)<MaxIndex_j+1
    532535        msgbox_uvmat('WARNING','maximum j index restricted by the timing of the xml file');
    533536    end
    534     MaxIndex_i=min(size(time,1),MaxIndex_i);%possibly adjust the max index according to time data
    535     MaxIndex_j=min(size(time,2),MaxIndex_j);
     537    MaxIndex_i=min(size(time,1)-1,MaxIndex_i);%possibly adjust the max index according to time data
     538    MaxIndex_j=min(size(time,2)-1,MaxIndex_j);
    536539%     time=[zeros(size(time,1),1) time]; %insert a vertical line of zeros (to deal with zero file indices)
    537540%     time=[zeros(1,size(time,2)); time]; %insert a horizontal line of zeros
    538541else
    539542    set(handles.ImaDoc,'String',''); %xml file not used for timing
    540     time=(i1_series(:,1)+0:size(i1_series,3)-1);% time=index i
    541     time=time'*ones(1,size(i1_series,2),1); %makes a time matrix with the same time for all j indices
     543    time=(i1_series(:,1)+0:size(i1_series,3));% time=index i
     544    time=time'*ones(1,size(i1_series,2)+1,1); %makes a time matrix with the same time for all j indices
    542545    TimeUnit='frame';
    543546end
Note: See TracChangeset for help on using the changeset viewer.