Skip to content
Snippets Groups Projects
Commit 60459fe7 authored by Christophe Bradley Smith's avatar Christophe Bradley Smith
Browse files

Implemented progress monitoring.

parent 3de05e74
No related branches found
No related tags found
No related merge requests found
clearvars -except ls lss remainingFiles
%% For testing %% For testing
load('C:\Users\chris\Box\Nelson Lab Data\Other Data\NTAud Transcription\Transcript_OrigAudio_AudSentStim.mat', 'lss'); % load('C:\Users\chris\Box\Nelson Lab Data\Other Data\NTAud Transcription\Transcript_OrigAudio_AudSentStim.mat', 'lss');
test = load('C:\Users\chris\Box\Nelson Lab Data\Other Data\NTAud Transcription\Transcript_Version2_AudSent.mat'); % test = load('C:\Users\chris\Box\Nelson Lab Data\Other Data\NTAud Transcription\Transcript_Version2_AudSent.mat');
ls = test.lss; % ls = test.lss;
testpos = 6;
resetLabelValues(lss, testpos)
setLabelValue(lss, testpos, 'Words', ls.Labels.Words{testpos}.ROILimits, ls.Labels.Words{testpos}.Value)
%% Main code %% Main code
% Search the workspace for ls and lss and check for the tracker % Search the workspace for ls and lss and check for the tracker
if ~ValidWorkspace(ls, lss); return; end if ~ValidateWorkspace(ls, lss); return; end
% Update progress % Update progress
% Compare ls and lss roi and values if ~exist('remainingFiles', 'var'); remainingFiles = []; end
remainingFiles = FindRemainingFiles(ls, lss, remainingFiles);
% Transfer labels % Transfer labels
lss = TransferLabels(ls, lss); lss = TransferLabels(ls, lss);
% Save lss and progress % Save latest transcription and progress
% use uiget element to select save location uisave({'lss', 'remainingFiles'}, 'lss.mat')
%% Functions %% Functions
function extStatus = ValidWorkspace(ls, lss) function extStatus = ValidateWorkspace(ls, lss)
if ~exist("ls", "var") if ~exist("ls", "var")
fprintf(2, 'No exported transcript found. Please export your transciription to the work space as ''ls''\n') fprintf(2, 'No exported transcript found. Please export your transciription to the work space as ''ls''\n')
...@@ -35,6 +42,30 @@ extStatus = true; ...@@ -35,6 +42,30 @@ extStatus = true;
end end
function remainingFiles = FindRemainingFiles(ls, lss, remainingFiles)
% Find identical labels
nFiles = lss.NumMembers;
isUntouched = false(nFiles, 1);
for i = 1:nFiles
isUntouched(i) = isequal(ls.Labels.Words{i}, lss.Labels.Words{i});
end
% Account for previosuly edited files
if ~isempty(remainingFiles)
wasPreviouslyUntouched = ~ismember(1:nFiles, remainingFiles.File_Pos);
isUntouched(wasPreviouslyUntouched) = false;
end
% Prepare output
File_Pos = find(isUntouched);
memberNames = ls.getMemberNames;
File_Name = memberNames(isUntouched);
remainingFiles = table(File_Pos, File_Name);
% could always print out a nice little status msg to encourage the user
end
function lss = TransferLabels(ls, lss) function lss = TransferLabels(ls, lss)
% Clear lss labels % Clear lss labels
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment