Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
Transcription Save Script
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christophe Bradley Smith
Transcription Save Script
Commits
60459fe7
Commit
60459fe7
authored
2 months ago
by
Christophe Bradley Smith
Browse files
Options
Downloads
Patches
Plain Diff
Implemented progress monitoring.
parent
3de05e74
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SaveTranscriptions.m
+39
-8
39 additions, 8 deletions
SaveTranscriptions.m
with
39 additions
and
8 deletions
SaveTranscriptions.m
+
39
−
8
View file @
60459fe7
clearvars
-
except
ls
lss
remainingFiles
%% 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
;
% 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;
testpos
=
6
;
resetLabelValues
(
lss
,
testpos
)
setLabelValue
(
lss
,
testpos
,
'Words'
,
ls
.
Labels
.
Words
{
testpos
}
.
ROILimits
,
ls
.
Labels
.
Words
{
testpos
}
.
Value
)
%% Main code
% Search the workspace for ls and lss and check for the tracker
if
~
ValidWorkspace
(
ls
,
lss
);
return
;
end
if
~
Valid
ate
Workspace
(
ls
,
lss
);
return
;
end
% Update progress
% Compare ls and lss roi and values
if
~
exist
(
'remainingFiles'
,
'var'
);
remainingFiles
=
[];
end
remainingFiles
=
FindRemainingFiles
(
ls
,
lss
,
remainingFiles
);
% Transfer labels
lss
=
TransferLabels
(
ls
,
lss
);
% Save l
ss
and progress
% use uiget element to select save location
% Save l
atest transcription
and progress
uisave
({
'lss'
,
'remainingFiles'
},
'lss.mat'
)
%% Functions
function
extStatus
=
ValidWorkspace
(
ls
,
lss
)
function
extStatus
=
Valid
ate
Workspace
(
ls
,
lss
)
if
~
exist
(
"ls"
,
"var"
)
fprintf
(
2
,
'No exported transcript found. Please export your transciription to the work space as
''
ls
''
\n'
)
...
...
@@ -35,6 +42,30 @@ extStatus = true;
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
)
% Clear lss labels
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment