OPM preprocessing pipeline built on mne-python and osl-ephys.
Grateful for advice and code from Lukas Rier and Robert Seymour.
git clone https://github.com/harrisonritz/opm-preproc.git
cd opm-preproc
conda env create -f environment.yml
conda activate opm-preproc
download the (noisy) oddball dataset here, and add to examples/oddball
.
Preprocessing parameters are configured through YAML text files. Inspired by the approach in osl-ephys, these human-readable configuration files let you keep a record of subject analyses for ease and reproducability.
You can call a config file when you execute run_preproc_sensors.py
, and the contents of this config file will overwrite the defaults set in set_preproc_params
. e.g.,
python run_preproc_sensors PATH/TO/CONFIG.yaml
Your configuration file can update just a subset of the parameters, for example just the participant information:
participant:
id: 2
session: 1
run: 1
task: "oddball"
datatype: "meg"
known_bads: [
'2E[X]', '2E[Y]', '2E[Z]',
'2Z[X]', '2Z[Y]', '2Z[Z]',
'29[X]', '29[Y]', '29[Z]',
]
do_BIDS: True
data_root: "/Users/hr0283/Projects/opm-preproc/examples/oddball/bids" # UPDATE THIS TO YOUR PATH
This allows you use a similar preprocessing pipeline across multiple participants and experiments, and to more easily batch script your pipeline.
src/opm_preproc_sensors.py
: run preprocessing pipeline for a single participantsrc/format/opm_format_bids.py
: BIDSify Cerca OPM data, annotating experimental eventssrc/utils/amm.py
: python port of SPM functions for Adaptative Multipole Modelsrc/utils/plot_ica_axis.py
: version of MNE's ICA GUI adapted for OPM (handling spatially-overlapping sensors)
- continuous segment reject (kurtosis)
- channel reject
- harmonic field correction / AMM
- temporal filter (notch/spectrum, bandpass)
- continuous segment reject (std)
- fit ICA
- epoch, apply ICA, and resample
- epoch reject
- coregistration & source reconstruction