Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIDS tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
NTrepo
BIDS tools
Merge requests
!1
new laura folder
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
new laura folder
au620747-main-patch-86964
into
main
Overview
1
Commits
14
Pipelines
0
Changes
1
Merged
Laura Rævsbæk Birch
requested to merge
au620747-main-patch-86964
into
main
1 year ago
Overview
1
Commits
14
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
68fb1ef1
Prev
Next
Show latest version
1 file
+
80
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
68fb1ef1
Upload New File
· 68fb1ef1
Laura Rævsbæk Birch
authored
1 year ago
laura/ntlab_create_events_json.py
0 → 100644
+
35
−
0
Options
from
genericpath
import
exists
from
numpy
import
tri
import
json
from
collections
import
OrderedDict
def
create_events_json
(
path
):
data
=
OrderedDict
()
data
[
"
onset
"
]
=
{
"
Description
"
:
"
Time of event, in seconds since beginning of recording
"
}
data
[
"
duration
"
]
=
{
"
Description
"
:
"
Duration of event (always just 0)
"
}
# data["trial_type"] = {
# "LongName": "Event type", "Levels": {
# "Beginning of Recording": "Time subject turned on amplifier",
# "Lights Off": "Time(from start) that subject turn the lights off",
# "Artifact": "Manual marking by sleep scorer",
# "Arousal": "Cortical arousal",
# "Obs": "Manual marking by sleep scorer",
# "Lights On": "Time(from start) that subject got up",
# "End of Study": "End of measurement"
# }
data
[
"
trial_type
"
]
=
{
"
LongName
"
:
"
Event type
"
,
"
Levels
"
:
{
"
Boundary
"
:
"
Event marking the beginning of a recording
"
,
"
Trigger
"
:
"
Trigger event from patient
"
,
}
}
with
open
(
path
,
'
w
'
)
as
outfile
:
json
.
dump
(
data
,
outfile
,
indent
=
4
)
\ No newline at end of file
Loading