Skip to content

Simulation and analysis code for making global and local laminar inferences with MEG data.

License

Notifications You must be signed in to change notification settings

sashel/laminar_sim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

136 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laminar inferences using OPM-MEG

Accompanying code for my simulation paper on laminar inferences with OPMs.

S Helbling
Inferring laminar origins of MEG signals with optically pumped magnetometers (OPMs): a simulation study
doi: https://doi.org/10.1101/2023.08.20.554011

Based on code by JJ Bonaiuto (https://github.com/jbonaiuto/laminar_sim) for laminar inference using high-precision forward models and by Tim Tierney (https://github.com/tierneytim/OPM/) for OPM-MEG array simulations.

JJ Bonaiuto, HE Rossiter, SS Meyer, N Adams, S Little, MF Callaghan, F Dick, S Bestmann, GR Barnes
Non-invasive laminar inference with MEG: Comparison of methods and source inversion algorithms
NeuroImage (2017), http://www.sciencedirect.com/science/article/pii/S1053811917310145
(bioRxiv link: https://www.biorxiv.org/content/early/2017/11/30/147215)

TM Tierney, S Mellor, GC O’Neill, N Holmes, E Boto, G Roberts, RM Hill, J Leggett, R Bowtell, MJ Brookes & GR Barnes
Pragmatic spatial sampling for wearable MEG arrays
Scientific Reports (2020), https://www.nature.com/articles/s41598-020-77589-8

Requirements

Usage

Construct the OPM-MEG arrays

Create OPM-MEG arrays across inter-sensor distances, number of measurement axes for a default scalp-sensor offset of 6.5 mm. Simulated data consists of 200 trials of 1 second each, sampled at a rate of 200/sec.

prepare_opm(<PROJECT_DIR>/DATA_DIR>)

Create OPM-MEG arrays across varying larger scalp-sensor offsets of 20, 30 and 40 mm at an inter-sensor distance of 35 mm and a single measurement axis.

prepare_opm_offsets(<PROJECT_DIR>/DATA_DIR>)

Running simulations

Run simulations across SNRs for an OPM-MEG sensor array with an inter-sensor distance of 35 mm and one measurement axis using the whole-brain and ROI-based analyses

run_opm_sim(<PROJECT_FOLDER>,35,1,[-5,-10,-20,-30,-40,-50)

Run simulations across inter-sensor distances

run_opm_sim(<PROJECT_FOLDER>,[25 35 45 55],1,[-5,-10,-20,-30,-40])

Run simulations across number of measurement axes

run_opm_sim(<PROJECT_FOLDER>,55,[1 2 3],[-5,-10,-20,-30,-40])

Run simulations across varying scalp-sensor offsets

run_opm_sim_offset(<PROJECT_FOLDER>,35,1,[-5,-10,-20,-30,-40],[20 30 40])

Run simulations across varying co-registration errors

run_opm_sim_offset_coreg(<PROJECT_FOLDER>,35,1,-10,[1 2 3 4])

TODO: add simulations for varying patch sizes & internal noise sources

Analyzing results

Plot classification accuracy and bias across SNRs (Fig.1)

plot_snr_classification_performance('correct',35,1)
plot_snr_classification_performance('pial',35,1)

Plot classification results across inter-sensor distances (Fig.2)

plot_space_classification_performance('correct',1)
plot_space_classification_performance('pial',1)

Plot classification results across number of measurement axes (Fig.3)

plot_axes_classification_performance('correct',35)
plot_axes_classification_performance('pial',35)

Plot classification results across scalp-sensor offsets (Fig. 4)

plot_offset_classification_performance('correct',55,1)
plot_offset_classification_performance('pial',55,1)

Plot classification results across co-registration errors (Fig. 5)

plot_coreg_classification_performance('correct',35)
plot_coreg_classification_performance('pial',35)

Plot classification results for congruent and incongruent patch sizes (Fig. 6)

plot_free_energy_patch_size_classification_performance()

Support

Email saskia.helbling@gmail.com with any questions.

About

Simulation and analysis code for making global and local laminar inferences with MEG data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MATLAB 99.1%
  • Objective-C 0.9%