bemobil_mne.io.export_to_bids#
- bemobil_mne.io.export_to_bids(raw, bids_root, subject, session=None, task='task', run=None, acquisition=None, events=None, event_id=None, line_freq=50.0, overwrite=False, verbose=True, extra_params=None)[source]#
Export an MNE Raw object to a BIDS-compatible directory tree.
Wraps
mne_bids.write_raw_bids()with sensible defaults for EEG data and records the BIDS path in the raw object’s provenance descriptor (when one exists).- Parameters:
- raw
mne.io.BaseRaw Raw EEG recording. Must have a montage set and
info['sfreq']populated.- bids_root
str|Path Root of the BIDS dataset (will be created if it does not exist).
- subject
str BIDS subject label (without the
sub-prefix, e.g."01").- session
str|None BIDS session label (without
ses-).Noneomits the session directory level.- task
str BIDS task label. Defaults to
"task".- run
str|None BIDS run label (without
run-).Nonewhen there is a single run.- acquisition
str|None BIDS acquisition label (without
acq-).- events
ndarray,shape(n_events, 3) |None MNE-style event array (sample, prev_id, event_id). When
None, events are derived fromraw.annotationsautomatically bymne_bids.write_raw_bids().- event_id
dict|None Mapping of event descriptions to integer codes, e.g.
{"left_hand": 1, "right_hand": 2}.- line_freq
float Power-line frequency (Hz). Used to populate the
PowerLineFrequencyBIDS field. Defaults to 50 Hz (Europe / most of Asia).- overwritebool
Whether to overwrite existing BIDS files for this entity.
- verbosebool |
str|int Verbosity level forwarded to
mne_bids.write_raw_bids().- extra_params
dict|None Extra keyword arguments forwarded verbatim to
mne_bids.write_raw_bids().
- raw
- Returns:
- bids_path
mne_bids.BIDSPath The
mne_bids.BIDSPathobject describing the written file.
- bids_path