function[f,time]=edge_time(thresh,time,m)
warning('off');
% Edge time reconstruction 
% figure(100); pause;
if size(thresh,2)==1
    return
end
f=polyfit(thresh',time',1);
time=polyval(f,0);
% time=polyval(f,((thresh(1)+thresh(size(thresh,2)))/2));
% f=fit(thresh',time','linearinterp')
