Skip to content

harrisonritz/opm-preproc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opm-preproc

OPM preprocessing pipeline built on mne-python and osl-ephys.

Grateful for advice and code from Lukas Rier and Robert Seymour.

Installation

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.

Preproc Config

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.

Core Functions

  • src/opm_preproc_sensors.py: run preprocessing pipeline for a single participant
  • src/format/opm_format_bids.py: BIDSify Cerca OPM data, annotating experimental events
  • src/utils/amm.py: python port of SPM functions for Adaptative Multipole Model
  • src/utils/plot_ica_axis.py: version of MNE's ICA GUI adapted for OPM (handling spatially-overlapping sensors)

Pipeline Steps

  1. continuous segment reject (kurtosis)
  2. channel reject
  3. harmonic field correction / AMM
  4. temporal filter (notch/spectrum, bandpass)
  5. continuous segment reject (std)
  6. fit ICA
  7. epoch, apply ICA, and resample
  8. epoch reject

todo

  • coregistration & source reconstruction

About

OPM preprocessing using mne-python & osl-ephys

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages