function reviseFocusData(reviewloc,focusloc) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Revises slightly the focus annotation data to account for when the start % frame of one annotation begins before the previous one ends (after sorting) % Inputs: % - reviewloc: Input string of the folder with the datasets % - focusloc: Save location for the revised .mat data % Outputs: (none) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear cd(reviewloc); A = dir('reviewer*'); for fn = 1:length(A) cd(strcat(A(fn).folder, '/', A(fn).name)); B = dir('0*.mat'); for nn = 1:length(B) load(B(nn).name); if ~isempty(focusTable) [~, I] = sort(focusTable(:, 1)); focusTable = focusTable(I, :); for p = 2:size(focusTable, 1) sframe = focusTable(p, 1); endframe = focusTable(p-1, 2); if sframe == endframe focusTable(p, 1) = sframe+1; end end save(strcat(focusloc, A(fn).name, '\', B(nn).name), 'focusTable'); end end end