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

Changed default file name in save ui, Fixed issue for transfering empty...

Changed default file name in save ui, Fixed issue for transfering empty labels, Fixed equality check to use only ROI, removed ls as a default option
parent 6c676125
No related branches found
No related tags found
No related merge requests found
......@@ -4,4 +4,6 @@ SaveTranscription is a script that manages saving transcription files to make it
## Usage
Run the code in MATLAB and follow any prompts you may see. For ease of use adhere the to the convention that the file you load into the Command Window is the lss file and the file exported from the app is the ls file.
\ No newline at end of file
Run the code in MATLAB and follow any prompts you may see. For ease of use adhere the to the convention that the file you load into the Command Window is the lss file and the file exported from the app is the ls file.
Add explanation of variables
\ No newline at end of file
......@@ -3,7 +3,7 @@
clc
% Check for miscelaneous transcriptions in the work space
miscLS = who('-regexp', '^ls.*[0-9]');
miscLS = who('-regexp', '^ls(([0-9]$)|($))');
newLS = CheckmiscLS(miscLS);
if ~isempty(newLS); ls = eval(newLS); end
......@@ -21,7 +21,9 @@ lss = TransferLabels(ls, lss);
reviewerInit = input('Please enter your initials: ', 's');
% Save latest transcription and progress
uisave({'lss', 'remainingFiles'}, ['lss_' reviewerInit '.mat'])
uisave({'lss', 'remainingFiles', 'reviewerInit'}, '*.mat')
% ['lss_' reviewerInit '.mat']
%% Functions
function ls = CheckmiscLS(miscLS)
......@@ -31,9 +33,9 @@ if isempty(miscLS); return; end
fprintf(2, 'Warning: multiple potential ''ls'' files were found in the work space. \n\n')
nLS = length(miscLS);
lsNames = string(['ls'; miscLS]);
lsNames = string(miscLS);
formatPat = '\t%i. %s\n';
formattedstring = compose(formatPat, (0:nLS)', lsNames);
formattedstring = compose(formatPat, (1:nLS)', lsNames);
listSet = join(formattedstring' , '');
validResp = 0:nLS;
......@@ -43,14 +45,14 @@ while true
userResp = input('Resp:');
if any(ismember(validResp, userResp))
fprintf('%s has been selected.', lsNames(userResp + 1))
fprintf('%s has been selected.', lsNames(userResp))
break
else
fprintf('%i is an invalid response.', userResp)
end
end
ls = lsNames(userResp + 1);
ls = lsNames(userResp);
end
......@@ -78,7 +80,7 @@ function remainingFiles = FindRemainingFiles(ls, lss, remainingFiles)
nFiles = lss.NumMembers;
isUntouched = false(nFiles, 1);
for i = 1:nFiles
isUntouched(i) = isequal(ls.Labels.Words{i}, lss.Labels.Words{i});
isUntouched(i) = isequal(ls.Labels.Words{i}.ROILimits, lss.Labels.Words{i}.ROILimits);
end
% Account for previosuly edited files
......@@ -103,7 +105,12 @@ 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)
curROI = ls.Labels.Words{iTrial}.ROILimits;
curVal = ls.Labels.Words{iTrial}.Value;
if isempty(curROI)
continue
end
setLabelValue(lss, iTrial, 'Words', curROI, curVal)
end
end
......
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