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
134 stars 65 forks source link

ENH: Add artifact regression #837

Closed larsoner closed 6 months ago

larsoner commented 6 months ago

Before merging …

Adds config.regress_artifact, used in my pipeline to regress reference sensor signals:

regress_artifact = dict(picks="meg", picks_artifact=["MISC 001", "MISC 002", "MISC 003"])

Draft because I need to find a good KIT dataset to process to show this stuff, any ideas @agramfort ? I saw MASC-MEG but it's continuous speech (which we probably don't handle well) and huge.

I might try converting https://mne.tools/dev/auto_tutorials/inverse/95_phantom_KIT.html to BIDS since it works to demonstrate the processing.

Closes #832

larsoner commented 6 months ago

... @hoechenberger I think this is ready for review. If you're happy I'll wait until https://github.com/mne-tools/mne-python/pull/12389 lands, revert the change to use my branch, then merge

larsoner commented 6 months ago

Seems to work, nice low-freq noise suppressed by regressing the ref sensors!

https://output.circle-artifacts.com/output/job/d92c5960-9b7e-4cb2-ad98-f9586ccb1092/artifacts/0/site/examples/MNE-phantom-KIT-data/sub-01_task-phantom_report.html#Epochs__before_cleaning

I'll work on fixing the conflicts then should be good to go

hoechenberger commented 6 months ago

Thanks @larsoner!