lina-usc / pylossless

🧠 EEG Processing pipeline that annotates continuous data
https://pylossless.readthedocs.io/en/latest/
MIT License
18 stars 8 forks source link

Handling Multi-modal recordings #64

Open scott-huberty opened 1 year ago

scott-huberty commented 1 year ago

if I run this

import pylossless as ll 
import mne
fname = mne.datasets.sample.data_path() / 'MEG' / 'sample' /  'sample_audvis_raw.fif'
raw = mne.io.read_raw_fif(fname, preload=True).pick_types(eeg=True)  # Without explicit exclusion of MEG chans the pipeline breaks. Must fix.

config = ll.config.Config()
config.load_default()
config.save("my_project_ll_config.yaml")

pipeline = ll.LosslessPipeline('my_project_ll_config.yaml')
pipeline.run_with_raw(raw)

If I don't explicitly pick eeg channels like in line 4, the pipeline will flag all channels in flag_ch_outliers and fail. This is especially problematic for users who run the pipeline from a BIDS path, and don't have the option to pick eeg chans.

EDIT: this is likely the same underlying issue that caused #56

christian-oreilly commented 1 year ago

I'd suggest adding something to the config file to define which channels types should be included, maybe with a default behavior to "EEG" and "MEG? We should definitely not have to pick_types explicitly like that for basic usage.

christian-oreilly commented 1 year ago

Upgraded from bug to enhancement. The bug was fixed by PR #92, which explicitly operates only on EEG. The enhancement would require, e.g., specifying modalities (EEG, MEG, ...) to be included as part of the config file.