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

Label transfer complete.

parent 8db2877c
No related branches found
No related tags found
No related merge requests found
*.asv
\ No newline at end of file
% I am not happy with how these files work
% 1. load in the transcribed file + the original
% 2. Purge the labels from the original
% resetLabelValues(lss)
% 3. Copy the transcribed labels to the original
% setLabelValue?
% For testing
%% For testing
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');
ls = test.lss;
% Search the workspace for ls and lss
%% Main code
% Search the workspace for ls and lss and check for the tracker
if ~ValidWorkspace(ls, lss); return; end
% Remove labels for lss
resetLabelValues(lss)
% Update progress
% Compare ls and lss roi and values
% Relable lss using ls
nTrials = height(test.lss.Labels);
for iTrial = 1:nTrials
nWords = height(test.lss.Labels.Words{iTrial});
setLabelValue(lss, iTrial, 'Words', test.lss.Labels.Words{iTrial}.ROILimits, test.lss.Labels.Words{iTrial}.Value)
% Transfer labels
lss = TransferLabels(ls, lss);
% Save lss and progress
% use uiget element to select save location
%% Functions
function extStatus = ValidWorkspace(ls, lss)
if ~exist("ls", "var")
fprintf(2, 'No exported transcript found. Please export your transciription to the work space as ''ls''\n')
extStatus = false;
return
end
%
if ~exist("lss", 'var')
fprintf(2, 'The original transcription file is missing, please ensure the work you have done is saved to ''ls'' and load in the original transcription\n');
extStatus = false;
return
end
extStatus = true;
end
% Code will be run after student saves the file to the workspace
% Check workspace to find ls, lss, and
function lss = TransferLabels(ls, lss)
% add functionality to check if sessions have been edited compare ROI and
% script
% Clear lss labels
resetLabelValues(lss)
% Move ls labels to lss
nTrials = height(ls.Labels);
for iTrial = 1:nTrials
setLabelValue(lss, iTrial, 'Words', ls.Labels.Words{iTrial}.ROILimits, ls.Labels.Words{iTrial}.Value)
end
% Save the file and save the current progress
% Use a uiget element to delect save location
end
\ No newline at end of file
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