Skip to content

FIL-OPMEG/OPyM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPyM

experimental / work in progress / zero results guaranteed

A python library to read OPM data and perform some OPM-specific operations within the MNE-Python universe.

Current functionality

Feature Available in MNE-Python Working Tentative In development Not yet supported
Import: FIL/UCL OPM Data MNE Version 1.4 X
Import: Cerca Magnetics Data X
Import: Optitrak Data X
Coreg: FIL/UCL w/ Scannercasts X
Coreg: Cerca X
Preproc: HFC* ( $\ell =1$ ) MNE Version 1.4 X
Preproc: HFC* ( $\ell >1$ ) MNE Version 1.4 X
Pkg: Install with pip X

* = Homogenous Field Correction (Tierney et al., 2021)

Installation

To install into a (python >= 3.7) environment

git clone https://github.com/FIL-OPMEG/OPyM.git
cd opym
pip install . -r requirements.txt

If you plan on editing the code (for development purpoeses) run instead

git clone https://github.com/FIL-OPMEG/OPyM.git
cd opym
pip install -e . -r requirements.txt

Usage - FIL/UCL BIDS format

This is specific to OPM data acquired at the Wellcome Centre for Human Neuroimaging.

To use the import function, it is assumed that the the data is organised in a BIDS-esque format, such that the files are named:

data_folder
│
├───[FILE_PREFIX]_meg.bin             [REQUIRED]
├───[FILE_PREFIX]_meg.json            [REQUIRED]
├───[FILE_PREFIX]_channels.tsv        [REQUIRED]
├───[FILE_PREFIX]_positions.tsv       [OPTIONAL]
└───[FILE_PREFIX]_coordsystem.json    [OPTIONAL]

the code will try and guess the name of the files based on the name of the .bin file supplied.

To import and use the funciton.

from opym.io import read_raw_ucl

raw = read_raw_ucl('/path/to/data_folder/[FILE_PREFIX]_meg.bin')

Usage - Cerca format

warning: Source analysis not yet sorted - but currently can import data and sensor positions.

To use the import function, it is currently assumed that the data was collected using one of the Cerca helmets. Custom helmet yet to be supported.

data_folder
│
├───[FILE_PREFIX].cMEG                [REQUIRED]
├───[FILE_PREFIX]_SessionInfo.txt     [REQUIRED]
└───[FILE_PREFIX]_sensor_order.mat    [OPTIONAL]

the code will try and guess the name of the files needed based on the name of the .cMEG file supplied, the helmet is determined from reading the SessionInfo file.

To import and use the funciton.

from opym.io import read_raw_cerca

raw = read_raw_cerca('/path/to/data_folder/[FILE_PREFIX].cMEG')