mne-tools / mne-bids-pipeline

Automatically process entire electrophysiological datasets using MNE-Python.
https://mne.tools/mne-bids-pipeline/
BSD 3-Clause "New" or "Revised" License
138 stars 65 forks source link

BUG: Multiple rest run support #645

Open larsoner opened 1 year ago

larsoner commented 1 year ago

For example, using a simple config for ds004024:

RuntimeError: Found more than one matching data file for the requested recording. While searching:
    BIDSPath(
    root: /home/larsoner/mne_data/ds004024
    datatype: eeg
    basename: sub-CON001_ses-async14ms_task-rest)
Found 4 paths:
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-02_eeg.vhdr
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-03_eeg.vhdr
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-01_eeg.vhdr
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-04_eeg.vhdr
Cannot proceed due to the ambiguity. This is likely a problem with your BIDS dataset. Please run the BIDS validator on your data.

for now I'll use process_rest = False, but we should support subselecting a single rest run, or combining across runs. Maybe with process_rest: Union[Bool, List[str]] support to add to the existing bool support to allow specifying the run/runs if necessary? Then we'll need to concat if there are multiple.

hoechenberger commented 1 year ago

Maybe with process_rest: Union[Bool, List[str]] support to add to the existing bool support to allow specifying the run/runs if necessary? Then we'll need to concat if there are multiple.

For "task" runs, we have the settings

I wonder if we need to / should have all three for resting-state runs too?

agramfort commented 1 year ago

this is for rest used as baseline right? if it's for a rest pipeline without events etc. it works?

larsoner commented 1 year ago

Yes indeed, rest-as-baseline is this use case. I haven't tested task_as_rest = True, it might work already (but wouldn't fit this use case of wanting to use/process task data but also have process_rest = True so you could for example get a noise cov from the resting-state data, or just preproc the same way as runs so you could do connectivity analyses separately).