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
59dd058e
Commit
59dd058e
authored
2 months ago
by
Christophe Bradley Smith
Browse files
Options
Downloads
Patches
Plain Diff
Fixed sub label addition (typo in assignment and ability to check for new labels)
parent
16aaac48
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
+26
-4
26 additions, 4 deletions
SaveTranscriptions.m
with
26 additions
and
4 deletions
SaveTranscriptions.m
+
26
−
4
View file @
59dd058e
...
...
@@ -3,7 +3,7 @@
% Prepare work space
clc
checkVersion
()
%
checkVersion()
% Check for miscelaneous transcriptions in the work space
miscLS
=
who
(
'-regexp'
,
'^ls(([0-9]*$)|($))'
);
...
...
@@ -109,6 +109,16 @@ function lss = TransferLabels(ls, lss)
% Clear lss labels
resetLabelValues
(
lss
)
% Update lss labels to match ls
subLabelList
=
split
(
strtrim
(
extract
(
labelDefinitionsHierarchy
(
lss
),
regexpPattern
(
'(?<=Sublabels:).*'
))));
lsSubLabelList
=
split
(
strtrim
(
extract
(
labelDefinitionsHierarchy
(
ls
),
regexpPattern
(
'(?<=Sublabels:).*'
))));
isNewLabel
=
~
contains
(
lsSubLabelList
,
subLabelList
);
if
any
(
isNewLabel
)
curLabelDef
=
getLabelDefinitions
(
ls
);
addLabelDefinitions
(
lss
,
curLabelDef
.
Sublabels
(
isNewLabel
),
curLabelDef
.
Name
)
end
% Move ls labels to lss
nTrials
=
height
(
ls
.
Labels
);
for
iTrial
=
1
:
nTrials
...
...
@@ -122,10 +132,22 @@ for iTrial = 1:nTrials
setLabelValue
(
lss
,
iTrial
,
'Words'
,
curROI
,
curVal
)
% Set sublabel Values
subLabelList
=
split
(
strtrim
(
extract
(
labelDefinitionsHierarchy
(
lss
),
regexpPattern
(
'(?<=Sublabels:).*'
))));
for
curLabel
=
subLabelList
'
setLabelValue
(
lss
,
iTrial
,
[
"Words"
,
string
(
curLabel
)],
ls
.
Labels
.
Words
{
1
}
.
Sublabels
.
(
curLabel
{
1
}),
'LabelRowIndex'
,
1
)
curSpans
=
ls
.
Labels
.
Words
{
iTrial
};
nSpans
=
height
(
curSpans
);
for
iSpan
=
1
:
nSpans
for
curLabel
=
lsSubLabelList
'
labelValues
=
ls
.
Labels
.
Words
{
iTrial
}
.
Sublabels
.
(
curLabel
{
1
});
if
isa
(
labelValues
,
'cell'
)
labelValue
=
labelValues
{
iSpan
};
else
labelValue
=
labelValues
(
iSpan
);
end
setLabelValue
(
lss
,
iTrial
,
[
"Words"
,
string
(
curLabel
)],
labelValue
,
"LabelRowIndex"
,
iSpan
)
end
end
end
end
...
...
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