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
Loading
...@@ -4,4 +4,6 @@ SaveTranscription is a script that manages saving transcription files to make it ...@@ -4,4 +4,6 @@ SaveTranscription is a script that manages saving transcription files to make it
## Usage ## 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. 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
Add explanation of variables
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
clc clc
% Check for miscelaneous transcriptions in the work space % Check for miscelaneous transcriptions in the work space
miscLS = who('-regexp', '^ls.*[0-9]'); miscLS = who('-regexp', '^ls(([0-9]$)|($))');
newLS = CheckmiscLS(miscLS); newLS = CheckmiscLS(miscLS);
if ~isempty(newLS); ls = eval(newLS); end if ~isempty(newLS); ls = eval(newLS); end
...@@ -21,7 +21,9 @@ lss = TransferLabels(ls, lss); ...@@ -21,7 +21,9 @@ lss = TransferLabels(ls, lss);
reviewerInit = input('Please enter your initials: ', 's'); reviewerInit = input('Please enter your initials: ', 's');
% Save latest transcription and progress % Save latest transcription and progress
uisave({'lss', 'remainingFiles'}, ['lss_' reviewerInit '.mat']) uisave({'lss', 'remainingFiles', 'reviewerInit'}, '*.mat')
% ['lss_' reviewerInit '.mat']
%% Functions %% Functions
function ls = CheckmiscLS(miscLS) function ls = CheckmiscLS(miscLS)
...@@ -31,9 +33,9 @@ if isempty(miscLS); return; end ...@@ -31,9 +33,9 @@ if isempty(miscLS); return; end
fprintf(2, 'Warning: multiple potential ''ls'' files were found in the work space. \n\n') fprintf(2, 'Warning: multiple potential ''ls'' files were found in the work space. \n\n')
nLS = length(miscLS); nLS = length(miscLS);
lsNames = string(['ls'; miscLS]); lsNames = string(miscLS);
formatPat = '\t%i. %s\n'; formatPat = '\t%i. %s\n';
formattedstring = compose(formatPat, (0:nLS)', lsNames); formattedstring = compose(formatPat, (1:nLS)', lsNames);
listSet = join(formattedstring' , ''); listSet = join(formattedstring' , '');
validResp = 0:nLS; validResp = 0:nLS;
...@@ -43,14 +45,14 @@ while true ...@@ -43,14 +45,14 @@ while true
userResp = input('Resp:'); userResp = input('Resp:');
if any(ismember(validResp, userResp)) if any(ismember(validResp, userResp))
fprintf('%s has been selected.', lsNames(userResp + 1)) fprintf('%s has been selected.', lsNames(userResp))
break break
else else
fprintf('%i is an invalid response.', userResp) fprintf('%i is an invalid response.', userResp)
end end
end end
ls = lsNames(userResp + 1); ls = lsNames(userResp);
end end
...@@ -78,7 +80,7 @@ function remainingFiles = FindRemainingFiles(ls, lss, remainingFiles) ...@@ -78,7 +80,7 @@ function remainingFiles = FindRemainingFiles(ls, lss, remainingFiles)
nFiles = lss.NumMembers; nFiles = lss.NumMembers;
isUntouched = false(nFiles, 1); isUntouched = false(nFiles, 1);
for i = 1:nFiles 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 end
% Account for previosuly edited files % Account for previosuly edited files
...@@ -103,7 +105,12 @@ resetLabelValues(lss) ...@@ -103,7 +105,12 @@ resetLabelValues(lss)
% Move ls labels to lss % Move ls labels to lss
nTrials = height(ls.Labels); nTrials = height(ls.Labels);
for iTrial = 1:nTrials 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
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