diff --git a/doc/documentation/datasets.rst b/doc/documentation/datasets.rst index 326a521c5e9..0a0280ae5ac 100644 --- a/doc/documentation/datasets.rst +++ b/doc/documentation/datasets.rst @@ -164,15 +164,20 @@ EEGBCI motor imagery The EEGBCI dataset is documented in :footcite:`SchalkEtAl2004` and on the `PhysioNet documentation page `_. The data set is available at PhysioNet :footcite:`GoldbergerEtAl2000`. -It 64-channel EEG recordings from 109 subjects and 14 runs on each subject in EDF+ -format. The recordings were made using the BCI2000 system. To load a subject, -do:: +It contains 64-channel EEG recordings from 109 subjects and 14 runs on each +subject in EDF+ format. The recordings were made using the BCI2000 system. +To load a subject, do:: from mne.io import concatenate_raws, read_raw_edf from mne.datasets import eegbci - raw_fnames = eegbci.load_data(subject, runs) + subjects = [1] # may vary + runs = [4, 8, 12] # may vary + raw_fnames = eegbci.load_data(subjects, runs) raws = [read_raw_edf(f, preload=True) for f in raw_fnames] + # concatenate runs from subject raw = concatenate_raws(raws) + # make channel names follow standard conventions + eegbci.standardize(raw) .. topic:: Examples diff --git a/examples/decoding/decoding_csp_eeg.py b/examples/decoding/decoding_csp_eeg.py index 3bee0761674..5859edde166 100644 --- a/examples/decoding/decoding_csp_eeg.py +++ b/examples/decoding/decoding_csp_eeg.py @@ -41,10 +41,10 @@ # avoid classification of evoked responses by using epochs that start 1s after # cue onset. tmin, tmax = -1.0, 4.0 -subject = 1 +subjects = 1 runs = [6, 10, 14] # motor imagery: hands vs feet -raw_fnames = eegbci.load_data(subject, runs) +raw_fnames = eegbci.load_data(subjects, runs) raw = concatenate_raws([read_raw_edf(f, preload=True) for f in raw_fnames]) eegbci.standardize(raw) # set channel names montage = make_standard_montage("standard_1005") diff --git a/examples/preprocessing/eeg_bridging.py b/examples/preprocessing/eeg_bridging.py index b0eb50a039d..37d85c55df6 100644 --- a/examples/preprocessing/eeg_bridging.py +++ b/examples/preprocessing/eeg_bridging.py @@ -65,7 +65,7 @@ raw_data = dict() # store infos for electrode positions for sub in range(1, 11): print(f"Computing electrode bridges for subject {sub}") - raw_fname = mne.datasets.eegbci.load_data(subject=sub, runs=(1,))[0] + raw_fname = mne.datasets.eegbci.load_data(subjects=sub, runs=(1,))[0] raw = mne.io.read_raw(raw_fname, preload=True, verbose=False) mne.datasets.eegbci.standardize(raw) # set channel names raw.set_montage(montage, verbose=False) diff --git a/examples/preprocessing/muscle_ica.py b/examples/preprocessing/muscle_ica.py index 64c14f5f5af..f61d1e22bc4 100644 --- a/examples/preprocessing/muscle_ica.py +++ b/examples/preprocessing/muscle_ica.py @@ -97,7 +97,7 @@ for sub in (1, 2): raw = mne.io.read_raw_edf( - mne.datasets.eegbci.load_data(subject=sub, runs=(1,))[0], preload=True + mne.datasets.eegbci.load_data(subjects=sub, runs=(1,))[0], preload=True ) mne.datasets.eegbci.standardize(raw) # set channel names montage = mne.channels.make_standard_montage("standard_1005") diff --git a/examples/time_frequency/time_frequency_erds.py b/examples/time_frequency/time_frequency_erds.py index 1d805121739..93272eb7aa3 100644 --- a/examples/time_frequency/time_frequency_erds.py +++ b/examples/time_frequency/time_frequency_erds.py @@ -50,7 +50,7 @@ # First, we load and preprocess the data. We use runs 6, 10, and 14 from # subject 1 (these runs contains hand and feet motor imagery). -fnames = eegbci.load_data(subject=1, runs=(6, 10, 14)) +fnames = eegbci.load_data(subjects=1, runs=(6, 10, 14)) raw = concatenate_raws([read_raw_edf(f, preload=True) for f in fnames]) raw.rename_channels(lambda x: x.strip(".")) # remove dots from channel names diff --git a/mne/datasets/utils.py b/mne/datasets/utils.py index 34dbf0ef803..1b8dc535daa 100644 --- a/mne/datasets/utils.py +++ b/mne/datasets/utils.py @@ -347,9 +347,8 @@ def _download_all_example_data(verbose=True): sleep_physionet, ) - eegbci.load_data(1, [6, 10, 14], update_path=True) - for subj in range(4): - eegbci.load_data(subj + 1, runs=[3], update_path=True) + eegbci.load_data(subjects=1, runs=[6, 10, 14], update_path=True) + eegbci.load_data(subjects=range(1, 5), runs=[3], update_path=True) logger.info("[done eegbci]") sleep_physionet.age.fetch_data(subjects=[0, 1], recording=[1]) diff --git a/tutorials/forward/35_eeg_no_mri.py b/tutorials/forward/35_eeg_no_mri.py index 0fca916cabf..10d13864670 100644 --- a/tutorials/forward/35_eeg_no_mri.py +++ b/tutorials/forward/35_eeg_no_mri.py @@ -48,7 +48,7 @@ # .. note:: See :ref:`plot_montage` to view all the standard EEG montages # available in MNE-Python. -(raw_fname,) = eegbci.load_data(subject=1, runs=[6]) +(raw_fname,) = eegbci.load_data(subjects=1, runs=[6]) raw = mne.io.read_raw_edf(raw_fname, preload=True) # Clean channel names to be able to use a standard 1005 montage diff --git a/tutorials/preprocessing/40_artifact_correction_ica.py b/tutorials/preprocessing/40_artifact_correction_ica.py index 87db02be1f8..5eeb7b79d64 100644 --- a/tutorials/preprocessing/40_artifact_correction_ica.py +++ b/tutorials/preprocessing/40_artifact_correction_ica.py @@ -532,9 +532,9 @@ raws = list() icas = list() -for subj in range(4): +for subj in range(1, 5): # EEGBCI subjects are 1-indexed; run 3 is a left/right hand movement task - fname = mne.datasets.eegbci.load_data(subj + 1, runs=[3])[0] + fname = mne.datasets.eegbci.load_data(subj, runs=[3])[0] raw = mne.io.read_raw_edf(fname).load_data().resample(50) # remove trailing `.` from channel names so we can set montage mne.datasets.eegbci.standardize(raw)