Note
Click here to download the full example code or to run this example in your browser via Binder
02. Read and load datasets in BIDS format¶
When working with neural data in the BIDS format, we usually have varying types of data, which can be loaded in via read_raw_bids function.
MEG
EEG (scalp)
iEEG (ECoG and SEEG)
the anatomical MRI scan of a study participant
In order to check if your dataset is compliant with BIDS, you can first run the BIDS validator online.
In this tutorial, we show how read_raw_bids can be used to load any BIDS format data, and to display the data that is saved within the accompanying sidecars.
# Authors: Adam Li <adam2392@gmail.com>
# License: BSD (3-clause)
We are importing everything we need for this example:
import os
import mne
from mne.datasets import somato
from mne_bids import make_bids_basename, read_raw_bids
from mne_bids.utils import print_dir_tree
We will be using the MNE somato data, which is already stored in BIDS format. For more information, you can checkout the respective example.
# get MNE directory w/ example data
mne_dir = mne.get_config('MNE_DATASETS_SAMPLE_PATH')
Step 1: Download/Get a BIDS dataset¶
Get the MNE somato data
bids_root = somato.data_path()
somato_raw_fname = os.path.join(bids_root, 'sub-01', 'meg',
'sub-01_task-somato_meg.fif')
subject_id = '01'
task = 'somato'
kind = "meg"
bids_basename = make_bids_basename(subject=subject_id, task=task)
# bids basename is nicely formatted
print(bids_basename)
Out:
sub-01_task-somato
Print the directory tree
print_dir_tree(bids_root)
Out:
|MNE-somato-data/
|--- participants.tsv
|--- CHANGES
|--- dataset_description.json
|--- README
|--- participants.json
|--- code/
|------ convert_somato_data.py
|------ README
|--- derivatives/
|------ freesurfer/
|--------- subjects/
|------------ fsaverage
|------------ 01/
|--------------- scripts/
|------------------ pctsurfcon.log
|------------------ mkheadsurf.log
|------------------ recon-all.env
|------------------ build-stamp.txt
|------------------ patchdir.txt
|------------------ recon-all-status.log
|------------------ lastcall.build-stamp.txt
|------------------ recon-all.cmd
|------------------ recon-all.log
|------------------ ponscc.cut.log
|------------------ recon-all.done
|------------------ pctsurfcon.log.old
|------------------ recon-all.local-copy
|--------------- stats/
|------------------ aseg.stats
|------------------ lh.w-g.pct.stats
|------------------ rh.aparc.pial.stats
|------------------ lh.aparc.stats
|------------------ lh.BA_exvivo.thresh.stats
|------------------ lh.aparc.DKTatlas.stats
|------------------ rh.aparc.stats
|------------------ rh.curv.stats
|------------------ lh.BA_exvivo.stats
|------------------ rh.BA_exvivo.stats
|------------------ rh.w-g.pct.stats
|------------------ lh.curv.stats
|------------------ lh.aparc.a2009s.stats
|------------------ wmparc.stats
|------------------ rh.aparc.DKTatlas.stats
|------------------ rh.aparc.a2009s.stats
|------------------ rh.BA_exvivo.thresh.stats
|------------------ lh.aparc.pial.stats
|--------------- label/
|------------------ rh.aparc.a2009s.annot
|------------------ rh.aparc.DKTatlas.annot
|------------------ lh.BA2_exvivo.label
|------------------ lh.BA2_exvivo.thresh.label
|------------------ lh.cortex.label
|------------------ lh.perirhinal_exvivo.label
|------------------ lh.V1_exvivo.label
|------------------ lh.BA_exvivo.annot
|------------------ lh.MT_exvivo.thresh.label
|------------------ lh.BA4p_exvivo.thresh.label
|------------------ rh.BA45_exvivo.thresh.label
|------------------ rh.V2_exvivo.thresh.label
|------------------ lh.BA4a_exvivo.thresh.label
|------------------ rh.BA1_exvivo.thresh.label
|------------------ rh.BA2_exvivo.label
|------------------ rh.MT_exvivo.thresh.label
|------------------ rh.BA3b_exvivo.thresh.label
|------------------ rh.entorhinal_exvivo.thresh.label
|------------------ rh.BA4a_exvivo.label
|------------------ rh.perirhinal_exvivo.label
|------------------ lh.BA4p_exvivo.label
|------------------ lh.BA44_exvivo.thresh.label
|------------------ rh.BA4p_exvivo.thresh.label
|------------------ lh.BA1_exvivo.label
|------------------ lh.BA6_exvivo.label
|------------------ rh.aparc.annot
|------------------ rh.BA1_exvivo.label
|------------------ rh.BA44_exvivo.thresh.label
|------------------ rh.entorhinal_exvivo.label
|------------------ lh.BA3b_exvivo.thresh.label
|------------------ lh.BA44_exvivo.label
|------------------ aparc.annot.ctab
|------------------ lh.BA4a_exvivo.label
|------------------ rh.perirhinal_exvivo.thresh.label
|------------------ rh.BA44_exvivo.label
|------------------ rh.V1_exvivo.thresh.label
|------------------ lh.BA1_exvivo.thresh.label
|------------------ rh.BA3a_exvivo.thresh.label
|------------------ lh.MT_exvivo.label
|------------------ rh.BA_exvivo.annot
|------------------ lh.BA3a_exvivo.label
|------------------ rh.BA4a_exvivo.thresh.label
|------------------ lh.perirhinal_exvivo.thresh.label
|------------------ rh.cortex.label
|------------------ lh.entorhinal_exvivo.label
|------------------ BA_exvivo.ctab
|------------------ lh.BA45_exvivo.label
|------------------ lh.BA_exvivo.thresh.annot
|------------------ rh.BA45_exvivo.label
|------------------ rh.V2_exvivo.label
|------------------ lh.aparc.a2009s.annot
|------------------ aparc.annot.a2009s.ctab
|------------------ lh.aparc.annot
|------------------ lh.BA3b_exvivo.label
|------------------ lh.entorhinal_exvivo.thresh.label
|------------------ rh.BA6_exvivo.thresh.label
|------------------ aparc.annot.DKTatlas.ctab
|------------------ lh.aparc.DKTatlas.annot
|------------------ rh.BA3b_exvivo.label
|------------------ lh.BA3a_exvivo.thresh.label
|------------------ lh.BA6_exvivo.thresh.label
|------------------ rh.BA2_exvivo.thresh.label
|------------------ lh.V2_exvivo.thresh.label
|------------------ rh.V1_exvivo.label
|------------------ lh.BA45_exvivo.thresh.label
|------------------ lh.V1_exvivo.thresh.label
|------------------ rh.BA6_exvivo.label
|------------------ BA_exvivo.thresh.ctab
|------------------ lh.V2_exvivo.label
|------------------ rh.BA4p_exvivo.label
|------------------ rh.MT_exvivo.label
|------------------ rh.BA3a_exvivo.label
|------------------ rh.BA_exvivo.thresh.annot
|--------------- touch/
|------------------ lh.white.H.K.touch
|------------------ rh.qsphere.touch
|------------------ skull.lta.touch
|------------------ lh.topofix.touch
|------------------ cortical_ribbon.touch
|------------------ aparc.a2009s2aseg.touch
|------------------ rh.surfvolume.touch
|------------------ lh.aparcstats3.touch
|------------------ rusage.mris_sphere.lh.dat
|------------------ ca_normalize.touch
|------------------ rusage.mris_fix_topology.rh.dat
|------------------ rh.jacobian_white.touch
|------------------ inorm1.touch
|------------------ ca_register.touch
|------------------ lh.smoothwm1.touch
|------------------ ca_label.touch
|------------------ lh.aparcstats.touch
|------------------ rh.curvstats.touch
|------------------ lh.inflate2.touch
|------------------ rh.pial_surface.touch
|------------------ segstats.touch
|------------------ rh.white_surface.touch
|------------------ nu.touch
|------------------ rusage.mris_sphere.rh.dat
|------------------ rh.sphreg.touch
|------------------ rusage.mris_register.rh.dat
|------------------ rh.white.H.K.touch
|------------------ rusage.mris_register.lh.dat
|------------------ rusage.mri_em_register.dat
|------------------ wmaparc.stats.touch
|------------------ rh.aparc.touch
|------------------ relabelhypos.touch
|------------------ rh.smoothwm2.touch
|------------------ wmaparc.touch
|------------------ aparc.DKTatlas2aseg.touch
|------------------ rh.inflate.H.K.touch
|------------------ skull_strip.touch
|------------------ apas2aseg.touch
|------------------ lh.pial_surface.touch
|------------------ rusage.mris_inflate.rh.dat
|------------------ rusage.mri_em_register.skull.dat
|------------------ lh.smoothwm2.touch
|------------------ lh.pctsurfcon.touch
|------------------ rh.pctsurfcon.touch
|------------------ rh.aparcstats2.touch
|------------------ inorm2.touch
|------------------ lh.surfvolume.touch
|------------------ rh.aparcstats.touch
|------------------ rh.inflate1.touch
|------------------ lh.avgcurv.touch
|------------------ lh.inflate1.touch
|------------------ lh.aparcstats2.touch
|------------------ talairach.touch
|------------------ rh.tessellate.touch
|------------------ lh.qsphere.touch
|------------------ lh.curvstats.touch
|------------------ rh.sphmorph.touch
|------------------ rusage.mris_inflate.lh.dat
|------------------ fill.touch
|------------------ wmsegment.touch
|------------------ conform.touch
|------------------ lh.aparc.touch
|------------------ rh.smoothwm1.touch
|------------------ rh.topofix.touch
|------------------ lh.white_surface.touch
|------------------ rh.avgcurv.touch
|------------------ lh.aparc2.touch
|------------------ rh.aparc2.touch
|------------------ rh.final_surfaces.touch
|------------------ rusage.mris_fix_topology.lh.dat
|------------------ rh.inflate2.touch
|------------------ lh.jacobian_white.touch
|------------------ lh.sphmorph.touch
|------------------ lh.inflate.H.K.touch
|------------------ lh.final_surfaces.touch
|------------------ lh.sphreg.touch
|------------------ rh.aparcstats3.touch
|------------------ rusage.mri_watershed.dat
|------------------ asegmerge.touch
|------------------ lh.tessellate.touch
|------------------ rusage.mri_ca_register.dat
|------------------ em_register.touch
|--------------- surf/
|------------------ rh.orig.nofix
|------------------ rh.defect_borders
|------------------ rh.smoothwm.H.crv
|------------------ rh.defect_labels
|------------------ lh.smoothwm.K1.crv
|------------------ rh.smoothwm.C.crv
|------------------ lh.qsphere.nofix
|------------------ lh.smoothwm.FI.crv
|------------------ lh.inflated.nofix
|------------------ rh.sphere.reg
|------------------ rh.sphere
|------------------ lh.curv.pial
|------------------ lh.sulc.seghead
|------------------ rh.defect_chull
|------------------ rh.area
|------------------ lh.white
|------------------ lh.defect_chull
|------------------ lh.orig.nofix
|------------------ lh.defect_borders
|------------------ rh.pial
|------------------ rh.white.preaparc.K
|------------------ rh.sulc
|------------------ lh.volume
|------------------ rh.smoothwm
|------------------ rh.area.mid
|------------------ lh.curv.seghead
|------------------ lh.smoothwm.K2.crv
|------------------ rh.curv
|------------------ rh.smoothwm.K1.crv
|------------------ rh.white.H
|------------------ lh.white.preaparc
|------------------ lh.smoothwm.nofix
|------------------ lh.sulc
|------------------ rh.avg_curv
|------------------ rh.inflated
|------------------ rh.white.preaparc.H
|------------------ lh.seghead
|------------------ rh.jacobian_white
|------------------ lh.seghead.inflated
|------------------ lh.sphere
|------------------ rh.white.preaparc
|------------------ lh.area.seghead
|------------------ lh.smoothwm
|------------------ lh.white.H
|------------------ lh.white.preaparc.H
|------------------ rh.white
|------------------ rh.volume
|------------------ lh.smoothwm.H.crv
|------------------ lh.smoothwm.S.crv
|------------------ rh.qsphere.nofix
|------------------ lh.sphere.reg
|------------------ lh.area.pial
|------------------ rh.smoothwm.K2.crv
|------------------ lh.inflated.H
|------------------ lh.curv
|------------------ lh.white.K
|------------------ rh.inflated.K
|------------------ rh.area.pial
|------------------ rh.smoothwm.K.crv
|------------------ lh.inflated.K
|------------------ rh.smoothwm.FI.crv
|------------------ rh.inflated.H
|------------------ lh.area.mid
|------------------ lh.thickness
|------------------ lh.white.preaparc.K
|------------------ rh.smoothwm.BE.crv
|------------------ lh.avg_curv
|------------------ lh.inflated
|------------------ rh.curv.pial
|------------------ lh.smoothwm.K.crv
|------------------ lh.pial
|------------------ lh.w-g.pct.mgh
|------------------ rh.white.K
|------------------ lh.jacobian_white
|------------------ rh.smoothwm.S.crv
|------------------ lh.orig
|------------------ lh.defect_labels
|------------------ rh.inflated.nofix
|------------------ rh.smoothwm.nofix
|------------------ lh.area
|------------------ rh.w-g.pct.mgh
|------------------ lh.smoothwm.C.crv
|------------------ lh.smoothwm.BE.crv
|------------------ rh.orig
|------------------ rh.thickness
|--------------- mri/
|------------------ orig.mgz
|------------------ mri_nu_correct.mni.log.bak
|------------------ aseg.mgz
|------------------ norm.mgz
|------------------ brainmask.mgz
|------------------ brain.mgz
|------------------ mri_nu_correct.mni.log
|------------------ talairach.label_intensities.txt
|------------------ ribbon.mgz
|------------------ aseg.presurf.mgz
|------------------ wmparc.mgz
|------------------ filled.mgz
|------------------ rh.ribbon.mgz
|------------------ nu.mgz
|------------------ talairach_with_skull.log
|------------------ ctrl_pts.mgz
|------------------ aparc+aseg.mgz
|------------------ brain.finalsurfs.mgz
|------------------ wm.seg.mgz
|------------------ wm.asegedit.mgz
|------------------ T1.mgz
|------------------ seghead.mgz
|------------------ rawavg.mgz
|------------------ aseg.auto.mgz
|------------------ aseg.presurf.hypos.mgz
|------------------ aseg.auto_noCCseg.label_intensities.txt
|------------------ brainmask.auto.mgz
|------------------ orig_nu.mgz
|------------------ aseg.auto_noCCseg.mgz
|------------------ aparc.a2009s+aseg.mgz
|------------------ wm.mgz
|------------------ aparc.DKTatlas+aseg.mgz
|------------------ talairach.log
|------------------ lh.ribbon.mgz
|------------------ segment.dat
|------------------ transforms/
|--------------------- talairach.xfm
|--------------------- talairach_avi.log
|--------------------- talairach_with_skull.lta
|--------------------- talairach.auto.xfm.lta
|--------------------- talairach_avi_QA.log
|--------------------- talsrcimg_to_711-2C_as_mni_average_305_t4_vox2vox.txt
|--------------------- cc_up.lta
|--------------------- talairach.m3z
|--------------------- talairach.auto.xfm
|--------------------- talairach.lta
|--------------------- bak/
|------------------ orig/
|--------------------- 001.mgz
|--------------- trash/
|--------------- tmp/
|--------------- bem/
|------------------ 01-head.fif
|------------------ brain.surf
|------------------ 01-head-dense.fif
|------------------ 01-head-medium.fif
|------------------ outer_skull.surf
|------------------ inner_skull.surf
|------------------ 01-head-sparse.fif
|------------------ outer_skin.surf
|------------------ watershed/
|--------------------- 01_brain_surface
|--------------------- 01_outer_skull_surface
|--------------------- 01_outer_skin_surface
|--------------------- 01_inner_skull_surface
|--------------------- ws/
|------------------------ COR-143
|------------------------ COR-230
|------------------------ COR-005
|------------------------ COR-154
|------------------------ COR-104
|------------------------ COR-234
|------------------------ COR-103
|------------------------ COR-033
|------------------------ COR-123
|------------------------ COR-010
|------------------------ COR-098
|------------------------ COR-175
|------------------------ COR-076
|------------------------ COR-218
|------------------------ COR-235
|------------------------ COR-047
|------------------------ COR-013
|------------------------ COR-081
|------------------------ COR-220
|------------------------ COR-157
|------------------------ COR-202
|------------------------ COR-133
|------------------------ COR-064
|------------------------ COR-041
|------------------------ COR-151
|------------------------ COR-152
|------------------------ COR-024
|------------------------ COR-144
|------------------------ COR-208
|------------------------ COR-126
|------------------------ COR-057
|------------------------ COR-196
|------------------------ COR-023
|------------------------ COR-162
|------------------------ COR-031
|------------------------ COR-020
|------------------------ COR-119
|------------------------ COR-102
|------------------------ COR-072
|------------------------ COR-142
|------------------------ COR-193
|------------------------ COR-229
|------------------------ COR-071
|------------------------ COR-056
|------------------------ COR-216
|------------------------ COR-003
|------------------------ COR-204
|------------------------ COR-051
|------------------------ COR-174
|------------------------ COR-067
|------------------------ COR-084
|------------------------ COR-159
|------------------------ COR-158
|------------------------ COR-236
|------------------------ COR-045
|------------------------ COR-001
|------------------------ COR-185
|------------------------ COR-227
|------------------------ COR-173
|------------------------ COR-132
|------------------------ COR-140
|------------------------ COR-049
|------------------------ COR-207
|------------------------ COR-008
|------------------------ COR-039
|------------------------ COR-146
|------------------------ COR-179
|------------------------ COR-199
|------------------------ COR-131
|------------------------ COR-188
|------------------------ COR-116
|------------------------ COR-211
|------------------------ COR-012
|------------------------ COR-100
|------------------------ COR-090
|------------------------ COR-161
|------------------------ COR-217
|------------------------ COR-085
|------------------------ COR-163
|------------------------ COR-129
|------------------------ COR-110
|------------------------ COR-212
|------------------------ COR-250
|------------------------ COR-109
|------------------------ COR-253
|------------------------ COR-221
|------------------------ COR-206
|------------------------ COR-249
|------------------------ COR-203
|------------------------ COR-164
|------------------------ COR-088
|------------------------ COR-002
|------------------------ COR-149
|------------------------ COR-177
|------------------------ COR-160
|------------------------ COR-113
|------------------------ COR-038
|------------------------ COR-172
|------------------------ COR-044
|------------------------ COR-097
|------------------------ COR-224
|------------------------ COR-004
|------------------------ COR-093
|------------------------ COR-138
|------------------------ COR-122
|------------------------ COR-060
|------------------------ COR-082
|------------------------ COR-068
|------------------------ COR-153
|------------------------ COR-246
|------------------------ COR-130
|------------------------ COR-032
|------------------------ COR-170
|------------------------ COR-117
|------------------------ COR-026
|------------------------ COR-011
|------------------------ COR-198
|------------------------ COR-245
|------------------------ COR-226
|------------------------ COR-063
|------------------------ COR-083
|------------------------ COR-127
|------------------------ COR-070
|------------------------ COR-135
|------------------------ COR-086
|------------------------ COR-036
|------------------------ COR-112
|------------------------ COR-210
|------------------------ COR-037
|------------------------ COR-255
|------------------------ COR-062
|------------------------ COR-042
|------------------------ COR-189
|------------------------ COR-017
|------------------------ COR-021
|------------------------ COR-106
|------------------------ COR-087
|------------------------ COR-014
|------------------------ COR-018
|------------------------ COR-186
|------------------------ COR-187
|------------------------ COR-059
|------------------------ COR-030
|------------------------ COR-165
|------------------------ COR-166
|------------------------ COR-192
|------------------------ COR-182
|------------------------ COR-243
|------------------------ COR-019
|------------------------ COR-099
|------------------------ COR-061
|------------------------ COR-080
|------------------------ COR-125
|------------------------ COR-219
|------------------------ COR-239
|------------------------ COR-108
|------------------------ COR-213
|------------------------ COR-181
|------------------------ COR-075
|------------------------ COR-223
|------------------------ COR-121
|------------------------ COR-232
|------------------------ COR-065
|------------------------ COR-079
|------------------------ COR-066
|------------------------ COR-195
|------------------------ COR-077
|------------------------ COR-114
|------------------------ COR-190
|------------------------ COR-.info
|------------------------ COR-241
|------------------------ COR-194
|------------------------ COR-027
|------------------------ COR-231
|------------------------ COR-015
|------------------------ COR-167
|------------------------ COR-136
|------------------------ COR-209
|------------------------ COR-069
|------------------------ COR-169
|------------------------ COR-247
|------------------------ COR-180
|------------------------ COR-054
|------------------------ COR-168
|------------------------ COR-092
|------------------------ COR-073
|------------------------ COR-178
|------------------------ COR-244
|------------------------ COR-046
|------------------------ COR-150
|------------------------ COR-120
|------------------------ COR-035
|------------------------ COR-156
|------------------------ COR-025
|------------------------ COR-183
|------------------------ COR-176
|------------------------ COR-096
|------------------------ COR-095
|------------------------ COR-105
|------------------------ COR-240
|------------------------ COR-053
|------------------------ COR-141
|------------------------ COR-248
|------------------------ COR-251
|------------------------ COR-242
|------------------------ COR-101
|------------------------ COR-214
|------------------------ COR-233
|------------------------ COR-171
|------------------------ COR-029
|------------------------ COR-034
|------------------------ COR-043
|------------------------ COR-134
|------------------------ COR-237
|------------------------ COR-115
|------------------------ COR-222
|------------------------ COR-091
|------------------------ COR-016
|------------------------ COR-124
|------------------------ COR-074
|------------------------ COR-228
|------------------------ COR-022
|------------------------ COR-118
|------------------------ COR-145
|------------------------ COR-137
|------------------------ COR-238
|------------------------ COR-028
|------------------------ COR-058
|------------------------ COR-128
|------------------------ COR-197
|------------------------ COR-256
|------------------------ COR-215
|------------------------ COR-184
|------------------------ COR-148
|------------------------ COR-094
|------------------------ COR-055
|------------------------ COR-007
|------------------------ COR-205
|------------------------ COR-225
|------------------------ COR-089
|------------------------ COR-111
|------------------------ COR-191
|------------------------ COR-155
|------------------------ COR-139
|------------------------ COR-009
|------------------------ COR-200
|------------------------ COR-107
|------------------------ COR-050
|------------------------ COR-201
|------------------------ COR-040
|------------------------ COR-147
|------------------------ COR-052
|------------------------ COR-252
|------------------------ COR-006
|------------------------ COR-048
|------------------------ COR-078
|------------------------ COR-254
|------ sub-01/
|--------- sub-01_task-somato-fwd.fif
|--- sub-01/
|------ sub-01_scans.tsv
|------ meg/
|--------- sub-01_task-somato_channels.tsv
|--------- sub-01_task-somato_meg.json
|--------- sub-01_task-somato_events.tsv
|--------- sub-01_task-somato_meg.fif
|--------- sub-01_coordsystem.json
|------ anat/
|--------- sub-01_T1w.nii.gz
|--------- sub-01_T1w.json
Step 2: Read a BIDS dataset¶
Let’s read in the dataset and show off a few features of the loading function read_raw_bids. Note, this is just one line of code.
bids_fname = bids_basename + "_{}.fif".format(kind)
raw = read_raw_bids(bids_fname, bids_root, verbose=True)
Out:
Opening raw data file /home/stefanappelhoff/mne_data/MNE-somato-data/sub-01/meg/sub-01_task-somato_meg.fif...
Range : 237600 ... 506999 = 791.189 ... 1688.266 secs
Ready.
Current compensation grade : 0
Reading events from /home/stefanappelhoff/mne_data/MNE-somato-data/sub-01/meg/sub-01_task-somato_events.tsv.
Reading channel info from /home/stefanappelhoff/mne_data/MNE-somato-data/sub-01/meg/sub-01_task-somato_channels.tsv.
/home/stefanappelhoff/Desktop/bids/mne-bids/mne_bids/read.py:275: RuntimeWarning: The unit for channel(s) STI 001, STI 002, STI 003, STI 004, STI 005, STI 006, STI 014, STI 015, STI 016 has changed from V to NA.
raw.set_channel_types(channel_type_dict)
/home/stefanappelhoff/Desktop/bids/mne-bids/mne_bids/utils.py:635: UserWarning: Did not find any electrodes.tsv file associated with sub-01_task-somato_meg.fif.
The search_str was "/home/stefanappelhoff/mne_data/MNE-somato-data/sub-01/**/sub-01*electrodes.tsv"
warnings.warn(msg)
raw.info has the basic subject metadata
print(raw.info['subject_info'])
# `raw.info` has the PowerLineFrequency loaded in, which should be 50 Hz here
print(raw.info['line_freq'])
# `raw.info` has the sampling frequency loaded in
print(raw.info['sfreq'])
# annotations
print(raw.annotations)
Out:
{'id': 175, 'sex': 1}
50
300.3074951171875
<Annotations | 111 segments: somato_event1 (111)>
Total running time of the script: ( 0 minutes 0.060 seconds)