eegprep.pop_load_frombids#
- eegprep.pop_load_frombids(filename, *, bidsmetadata=True, bidschanloc=True, bidsevent='replace', eventtype=None, infer_locations=None, dtype=<class 'numpy.float32'>, numeric_null=array([], dtype=float64), return_report=False, verbose=True)#
Load an EEG data file of a supported format from a BIDS dataset.
Supported formats are EDF, BrainVision, EEGLAB SET, BDF.
Parameters#
- filenamestr
Path to the EEG data file in a BIDS dataset.
- bidsmetadatabool
Whether to override any metadata in the EEG file with metadata from BIDS.
- bidschanlocbool
Whether to override any channel information (incl. locations) in the EEG file with channel information from BIDS.
- bidseventbool or str
Whether to load in and override any event data in the EEG file with event data from BIDS. Can be one of the following:
"replace"/True: replace events from EEG file with those from the BIDS event file."merge": selectively override events from EEG file with those from the BIDS event file."append": append events from the BIDS event file to those from the EEG file. This mode can result in duplicate events; use with caution.False/None: do not load events from BIDS; keep those from the EEG file.
- eventtypestr or None
Optionally the column name in the BIDS events file to use for event types; if not set, will be inferred heuristically.
- infer_locationsbool or str or None
Whether to infer channel locations if necessary from the channel labels (if 10-20 labeling system).
True: infer locations from channel labels and override existing locations if any.False: leave locations as-is, even if missing.None: infer only if no channels have locations.str: filename of a locations file to infer locations from. See files inresources/montages; this can disambiguate alternative montages that use the same naming system.
- dtypenp.dtype
The data type to use for the EEG data.
- numeric_nullAny
The value to use for empty numeric fields in the EEG data.
The default is
np.array([])for MATLAB/pop_loadset compatibility.- return_reportbool
whether to return an import report dictionary as a second output
- verbosebool
whether to log verbose output
Returns#
- EEGdict
A dictionary containing the EEG data and metadata.
- Reportdict, optional
optionally the import report to return, if desired.