Skip to content

BIDSConversion

Bases: BaseClass

Class for converting EEG data to BIDS format.

It uses MNE-BIDS library for the conversion. The module reads event information from a provided eventfile and maps it to the events in the raw data. It then writes the raw data, events, and other metadata to a BIDS-compliant directory structure.

MNE-functions used: mne_bids.BIDSPath, mne_bids.write_raw_bids

Parameters:

Name Type Description Default
raw Raw

Input data.

required
eventsfile str

Path to a csv file with 2 columns (ID, label).

required
bids_root str

Root directory for the BIDS dataset.

required
session str

Session identifier.

None
task str

Experimental task identifier.

required
run str

Run identifier.

None
subject str

Subject identifier. If not provided, it will be extracted from the raw data.

None
datatype str

Data type for the BIDS files, e.g. 'anat', 'func', 'eeg', 'meg', 'ieeg'..

'eeg'
format ‘auto’ | ‘BrainVision’ | ‘BDF’ | ‘EDF’ | ‘FIF’ | ‘EEGLAB’

File format for the output BIDS files.

'BrainVision'
overwrite bool

Whether to overwrite existing BIDS files.

False
**kwargs

Additional keyword arguments passed to mne.find_events(), mne_bids.BIDSPath() or mne_bids.write_raw_bids() MNE-BIDS functions by using a dictionary with find_events, BIDSPath, and write_raw_bids as keys.

Example:
'BIDSPath': {'suffix': 'channels'}, 'write_raw_bids': {'acpc_aligned': True}}

{}

Attributes:

Name Type Description
processed Raw

Output data after BIDS conversion.

Example settings for config file

Example settings in correct format for the config file.

BIDSConversion:
  _biopap_module: <class 'biopap.modules.bids.BIDSConversion'>
  bids_root: ./bids_data
  eventsfile: /path/to/your/eventsfile.csv
  task: task