Mne bids pipeline

From MEG Core
Revision as of 11:47, 3 May 2022 by Jstout (talk | contribs)
Jump to navigation Jump to search

If interested in skipping intro: Use on Biowulf

Intro

BIDS is a standard specification for neuroimaging/physiology data. This currently includes at least: MRI, fMRI, DTI, EEG, MEG, fNIRS (and possibly ECOG/sEEG). BIDS typically describes how RAW data is organized - and processed data is located in the bids_dir/derivatives/{AnalysisPackage}/{SUBJECT}/... The main advantage is that common code can be generated to process data organized in a standard format. Therefore, you should be able to import the bids data into any number of neurophysiological packages (MNE, Brainstorm, SPM, Fieldtrip, ...). Additionally, standardized processing packages known as BIDS apps can be used to process the data in the same way as long as the data is organized in BIDS.

 BIDS (formal specs) >> MNE_BIDS (python neurophysiological BIDS) >> MNE_BIDS_PIPELINE (structured processing in MNE python according to BIDS definition)

BIDS website

 https://bids-specification.readthedocs.io/en/stable/

MNE Bids

MNE bids is a python tool to make and access neurophysiological data. This tool is a branch of the MNE tools for neurophysiological analysis.

MNE Bids website

 https://mne.tools/mne-bids/stable/index.html

MNE bids pipeline background

Mne bids pipeline website:

 https://mne.tools/mne-bids-pipeline/

Full example:

 https://mne.tools/mne-bids-pipeline/examples/ds000248.html

Processing

All processing is defined in the config.py file. This has hundreds of options to define the processing.

 Here are some of the typical options:  https://mne.tools/mne-bids-pipeline/settings/general.html

Here is the full list of options:

 https://github.com/mne-tools/mne-bids-pipeline/blob/main/config.py

Example Script (copy into a config.py text file and use)

 study_name = 'TESTSTudy'
 bids_root = 'YOUR_BIDS_DIR' #<< Modify
 l_freq = 1.0
 h_freq = 100.
 epochs_tmin = -0.1
 epochs_tmax = 0.2
 baseline = (-0.1, 0.0)
 resample = 300.0
 ch_types = ['meg']
 conditions = ['stim']
 
 N_JOBS=4

Use on biowulf

 sinteractive --mem=6G --cpus-per-task=4 --gres=lscratch:50
 module load mne_scripts
 make_meg_bids.py -meg_input_dir MEGFOLDER -mri_brik AFNI_COREGED+orig.BRIK
 module purge 
 module load mne_bids_pipeline
 mne-bids-pipeline-run.py --config=CONFIG.py  ##Optional --steps=preprocessing,source  --subject=SUBJECTID(without sub-)