Neuromagnetism "On the Cheap": Evaluating a Combined Cylindrical Shield and Partial-Coverage OPM-MEG System for Detecting Sensorimotor Responses in Humans.
11 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 15 matches
- [1] § 2. Materials and Methods ↔ work/10_SEF_stats.r, lines 1 to 41 · score 0.89 · superior precentral sulcus, superior parietal lobule, postcentral sulcus, precentral gyrus, postcentral gyrus, ROIs · block
oscr:b:T5Y5HW7HPN8BG-Q· Report a mismatch - [2] § 2. Materials and Methods ↔ work/11_mubeta_stats.r, lines 1 to 43 · score 0.88 · superior precentral sulcus, superior parietal lobule, postcentral sulcus, precentral gyrus, postcentral gyrus, ROIs · block
oscr:b:T2J3G9DDR0PQK-T· Report a mismatch - [3] § 2. Materials and Methods ↔ work/04_find_bad_channels.ipynb, lines 45 to 125 · score 0.85 · linear regression, notch filtered, bad channels, 145 Hz, scored, spectral · Report a mismatch
- [4] § 2. Materials and Methods ↔ work/07_compute_sensor_evoked_and_tfrs.py, lines 262 to 318 · score 0.78 · edge artifacts, baseline corrected TFRs, epoch TFRs, Morlet, cycles, power · block
oscr:b:VE5A2QPZC547W-B· Report a mismatch - [5] § 3. Results › 3.3. Source-Level Results › 3.3.2. Source-Level Mu and Beta Modulation ↔ work/11_mubeta_stats.r, lines 1 to 43 · score 0.78 · superior precentral sulcus, precentral gyrus, postcentral gyrus, beta ERS, ERD, ROIs · block
oscr:b:T2J3G9DDR0PQK-T· Report a mismatch - [6] § 3. Results › 3.3. Source-Level Results › 3.3.2. Source-Level Mu and Beta Modulation ↔ work/10_SEF_stats.r, lines 1 to 41 · score 0.78 · superior precentral sulcus, precentral gyrus, postcentral gyrus, beta ERS, ERD, ROIs · block
oscr:b:T5Y5HW7HPN8BG-Q· Report a mismatch - [7] § 2. Materials and Methods ↔ work/05_sensor_preprocessing.py, lines 392 to 435 · score 0.74 · notch filtered, bad channels, 145 Hz, scored, regression, 120 · block
oscr:b:K06Q4CJVV159K-U· Report a mismatch - [8] § 2. Materials and Methods ↔ work/09_extract_label_tfrs.py, lines 242 to 313 · score 0.68 · edge artifacts, baseline corrected, Morlet, cycles, TFRs, power · block
oscr:b:CGRPWM2MR05PH-6· Report a mismatch - [9] § 2. Materials and Methods ↔ work/11_mubeta_stats.r, lines 45 to 85 · score 0.66 · 0.2–0.4 s, 0.5–1 s, artifact, ERD, 0.5 s, ERS · block
oscr:b:2EW75SG6FKVQN-F· Report a mismatch - [10] § 2. Materials and Methods ↔ work/07_compute_sensor_evoked_and_tfrs.py, lines 222 to 260 · score 0.63 · short ISI, evoked response, baseline corrected, subtracting, rejected, epochs · block
oscr:b:97K4KCN5NA22D-E· Report a mismatch - [11] § 3. Results › 3.3. Source-Level Results › 3.3.2. Source-Level Mu and Beta Modulation ↔ work/14_plot_label_tfrs.ipynb, lines 178 to 213 · score 0.63 · mu ERD, beta ERD, Bayes factors, beta ERS, power change, Boxplots · Report a mismatch
- [12] § 2. Materials and Methods ↔ work/10_SEF_stats.r, lines 94 to 158 · score 0.58 · baseline window, narrow, opposite, tailed, BF10, Bayes · block
oscr:b:WH4J9G4S0A2T9-I· Report a mismatch - [13] § 2. Materials and Methods ↔ work/01_registrationPrep.py, lines 123 to 196 · score 0.58 · head coordinate frame, matrices, nasion, translated, fiducial, transformation · block
oscr:b:GJXP9SE1KJK0S-5· Report a mismatch - [14] § 2. Materials and Methods ↔ work/02_register.py, lines 265 to 293 · score 0.54 · ICP, iterative, nasion, BEM, translated, fiducial · block
oscr:b:A1B20613QB9VF-K· Report a mismatch - [15] § 2. Materials and Methods ↔ work/05_sensor_preprocessing.py, lines 437 to 497 · score 0.50 · evoked response, rejected, event, artifacts, filtered, HFC · block
oscr:b:FT4JX6ZR3NSJK-J· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 158 lines · 5.7 KB · BSD-3-Clause · 3 matches
- # Outline: The purpose of this script is to compute Bayes factors for mu and beta ERS and ERD, in a selected sensor (ususally C3) and in a set of labels (i.e., ROIs)
- # Import packages
- library(BayesFactor)
- library(reticulate)
- library(ggplot2)
- library(scales)
- library(effsize)
- library(abind)
- np <- import('numpy') # This will trigger a prompt to set up a new environment. Enter "no"
- dataPre = 'MNS_shortISI'
- method_sufx = 'MNE-constrained'
- pick='C3'
- # Main directories
- data_path = '/media/NAS/lbailey/OPM_mnsbp/Data/results/'
- support_path = '/media/NAS/lbailey/OPM_mnsbp/Data/support_files/'
- # Input files
- times_fname = paste(data_path, dataPre, '-sens-evoked-times.npy', sep='')
- data_sens_evoked_fname = paste(data_path, dataPre,
- '-trans-cleaned-manRej-baseCorrected-evoked-', pick, '_N=11.npy', sep='')
- data_labels_evoked_fname = paste(data_path, dataPre,
- '-trans-cleaned-manRej-baseCorrected-', method_sufx, '-labelEvoked_N=12.npy', sep='')
- # Output files
- bfs_fname = paste(data_path, dataPre, '_', pick, '_and_label_evoked_stats.csv', sep='')
- magns_fname = paste(data_path, dataPre, '_', pick, '_and_label_evoked_magnitudes.csv', sep='')
- # Define labels
- labels = c('C3', 'Superior Precentral Sulcus', 'Precentral Gyrus',
- 'Central Sulcus','Postcentral Gyrus',
- 'Postcentral Sulcus', 'Superior Parietal Lobule'
- )
- # Define periods for baseline and peaks: 20 ms, 25 ms, 60 ms
- times_baseline = c(-0.2, -0.1)
- times_win20 = c(0.015, 0.025) # 10 ms window around 20 ms peak
- times_win35 = c(0.030, 0.040) # 10 ms window around 35 ms peak
- times_win60 = c(0.055, 0.065) # 10 ms window around 60 ms peak
- ###################
- # Load data
- # Load the times array and convert to r array
- times = np$load(times_fname)
- times = py_to_r(times)
- # Define indices for the baseline window and our 3 peaks
- idxs_baseline = which(times >= times_baseline[1] & times <= times_baseline[2])
- idxs_win20 = which(times >= times_win20[1] & times <= times_win20[2])
- idxs_win35 = which(times >= times_win35[1] & times <= times_win35[2])
- idxs_win60 = which(times >= times_win60[1] & times <= times_win60[2])
- # Load the sens and labels data and convert to r array
- data_sens = np$load(data_sens_evoked_fname)
- data_sens = py_to_r(data_sens)
- data_labels = np$load(data_labels_evoked_fname)
- data_labels = py_to_r(data_labels)
- # Create empty dataframes to store BFs and effect magnitudes for all labels
- all_bfs = data.frame()
- all_magns = data.frame()
- # Loop through labels. This is inefficient because we're loading the data on each loop, but it gets the job done...
- for (i in seq_along(labels)) {
- label = labels[i]
- # Select the data for this label (or if i==1, use the sensor data)
- if (i == 1) {
- data = data_sens[, i, ]
- } else {
- data = data_labels[, i-1, ]
- }
- # Define a dataframe to store bfs for this label
- bfs = data.frame(label = label,
- SEF20 = NA,
- SEF35 = NA,
- SEF60 = NA
- )
- magns = data.frame(label = label,
- SEF20 = NA,
- SEF35 = NA,
- SEF60 = NA
- )
- # Find the index for the max value in each time window, averaged across subjects.
- idx_peak20 = which.max(abs(apply(data[, idxs_win20], 2, mean))) + min(idxs_win20)
- idx_peak35 = which.max(apply(data[, idxs_win35], 2, mean)) + min(idxs_win35)
- idx_peak60 = which.max(apply(data[, idxs_win60], 2, mean)) + min(idxs_win60)
- # Create a very narrow time window (peak +/- 1 ms) around the peak
- idxs_peak20_3ms = c(idx_peak20 - 1, idx_peak20, idx_peak20 + 1)
- idxs_peak35_3ms = c(idx_peak35 - 1, idx_peak35, idx_peak35 + 1)
- idxs_peak60_3ms = c(idx_peak60 - 1, idx_peak60, idx_peak60 + 1)
- # Average over each 3ms time window, preserving subjects. Also average over the baseline window
- data_baseline = apply(data[, idxs_baseline], 1, mean)
- data_peak20 = apply(data[, idxs_peak20_3ms], 1, mean)
- data_peak35 = apply(data[, idxs_peak35_3ms], 1, mean)
- data_peak60 = apply(data[, idxs_peak60_3ms], 1, mean)
- # Compute magntiude of each response: abs(peak - baseline)
- magn_peak20 = abs(data_peak20 - data_baseline)
- magn_peak35 = abs(data_peak35 - data_baseline)
- magn_peak60 = abs(data_peak60 - data_baseline)
- # Determine the sign of the first peak, and select left/right tailed test.
- # The tail for the other two peaks will be the opposite of the first peak
- if (sign(mean(data_peak20))==1) {
- peak20_nullInterval = c(0, Inf)
- peak35_nullInterval = c(-Inf, 0)
- peak60_nullInterval = c(-Inf, 0)
- } else {
- peak20_nullInterval = c(-Inf, 0)
- peak35_nullInterval = c(0, Inf)
- peak60_nullInterval = c(0, Inf)
- }
- # Perform Bayes paired t-tests
- BF10_peak20 = ttestBF(data_peak20, data_baseline, paired=TRUE,
- nullInterval = peak20_nullInterval)
- BF10_peak35 = ttestBF(data_peak35, data_baseline, paired=TRUE,
- nullInterval = peak35_nullInterval)
- BF10_peak60 = ttestBF(data_peak60, data_baseline, paired=TRUE,
- nullInterval = peak60_nullInterval)
- # Assign BF10 to bfs dataframe
- bfs$SEF20 = as.vector(BF10_peak20)[[1]]
- bfs$SEF35 = as.vector(BF10_peak35)[[1]]
- bfs$SEF60 = as.vector(BF10_peak60)[[1]]
- # Store magnitudes in each cell (label / effect) as a list
- magns$SEF20 = paste(magn_peak20, collapse=',')
- magns$SEF35 = paste(magn_peak35, collapse=',')
- magns$SEF60 = paste(magn_peak60, collapse=',')
- # Append bfs to the all labels dataframe
- all_bfs = rbind(all_bfs, bfs)
- all_magns = rbind(all_magns, magns)
- } # labels loop
- all_bfs
- # Write bfs to disk
- write.csv(all_bfs, file=bfs_fname, row.names=FALSE)
- # Write magnitudes to disk. Each cell will be enclosed in quotes, to preserve the lists without disrupting csv formatting
- write.csv(all_magns, file=magns_fname, row.names=FALSE, quote=TRUE)
10_SEF_stats.r at commit b703004, under BSD-3-Clause · at the source
Overview
- Diagnostic & Interventional Radiology, Hospital for Sick Children, Toronto, ON M5G 0A4, Canada
- Department of Physics & Atmospheric Science, Dalhousie University, Halifax, NS B3H 4R2, Canada
Abstract
Background: Optically pumped magnetometers (OPMs) have emerged as a promising technology for neuromagnetic recording in humans. Current state-of-the-art OPM systems are housed in large magnetically shielded rooms to reduce external electromagnetic noise and typically comprise sensor arrays covering the entire head. Such systems are extremely costly to purchase and install, and take up large amounts of physical space, which limits the accessibility of this technology to research groups with limited funding. Here we sought to evaluate the utility of a more accessible “starter” OPM system comprising a small cylindrical mu-metal shield and partial sensor coverage. Methods: Twelve participants underwent right-sided median nerve stimulation (MNS) intended to elicit ubiquitous sensorimotor responses: somatosensory-evoked fields (SEFs, comprising N20m, P35m and P60m components) and event-related (de)synchronization (ERD/
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 15 matches between paragraphs and lines of code.
lyambailey/OPM_MNSBP
b703004e1c69958174ff57de80fb59343d868240, 11 June 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
18 files
- work/
00_make_combined_ROI.py , Python, 54 lines - work/
01_registrationPrep.py , Python, 359 lines, 1 match - work/
02_register.py , Python, 411 lines, 1 match - work/
03_find_event_thresholds , Jupyter, 103 lines.ipynb - work/
04_find_bad_channels.ipy , Jupyter, 202 lines, 1 matchnb - work/
05_sensor_preprocessing. , Python, 498 lines, 2 matchespy - work/
06_find_bad_epochs.ipynb , Jupyter, 57 lines - work/
07_compute_sensor_evoked , Python, 342 lines, 2 matches_and_tfrs.py - work/
08_extract_label_evoked. , Python, 232 linespy - work/
09_extract_label_tfrs.py , Python, 333 lines, 1 match - work/
10_SEF_stats.r , R, 158 lines, 3 matches - work/
11_mubeta_stats.r , R, 161 lines, 3 matches - work/
12_plot_SEFs.ipynb , Jupyter, 342 lines - work/
13_plot_sens_tfrs.ipynb , Jupyter, 251 lines - work/
14_plot_label_tfrs.ipynb , Jupyter, 223 lines, 1 match - work/
15_compute_snrs_SEF.py , Python, 235 lines - work/
16_plot_ROIs.py , Python, 50 lines - LICENSE, License, 28 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 17 scripts, each with its path and the digest of its content;
- 15 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
Data for this study is not publicly available, as participants did not consent to their data being made publicly available. Code for all analyses presented in this manuscript is publicly available on GitHub: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 3 keywords, 8 MeSH terms, 3 funders, 45 references.
Cite
This paper
Bailey, L. M., Knox, C., & Bardouille, T. (2026). Neuromagnetism "On the Cheap": Evaluating a Combined Cylindrical Shield and Partial-Coverage OPM-MEG System for Detecting Sensorimotor Responses in Humans. Sensors (Basel, Switzerland), 26(10), 3131. https://
BibTeX
@article{bailey2026neuro
author = {Bailey, Lyam M. and Knox, Clara and Bardouille, Timothy},
title = {{Neuromagnetism "On the Cheap": Evaluating a Combined Cylindrical Shield and Partial-Coverage OPM-MEG System for Detecting Sensorimotor Responses in Humans}},
journal = {Sensors (Basel, Switzerland)},
year = {2026},
month = may,
volume = {26},
number = {10},
pages = {3131},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {1424-8220},
doi = {10.3390/
url = {https://
pmid = {42197937},
pmcid = {PMC13210914}
}
RIS
TY - JOUR
AU - Bailey, Lyam M.
AU - Knox, Clara
AU - Bardouille, Timothy
TI - Neuromagnetism "On the Cheap": Evaluating a Combined Cylindrical Shield and Partial-Coverage OPM-MEG System for Detecting Sensorimotor Responses in Humans
T2 - Sensors (Basel, Switzerland)
J2 - Sensors (Basel)
PY - 2026
DA - 2026/
VL - 26
IS - 10
SP - 3131
SN - 1424-8220
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3390/
"type": "article-journal",
"title": "Neuromagnetism \"On the Cheap\": Evaluating a Combined Cylindrical Shield and Partial-Coverage OPM-MEG System for Detecting Sensorimotor Responses in Humans",
"container-title": "Sensors (Basel, Switzerland)",
"author": [
{
"family": "Bailey",
"given": "Lyam M."
},
{
"family": "Knox",
"given": "Clara"
},
{
"family": "Bardouille",
"given": "Timothy"
}
],
"container-title-short":
"volume": "26",
"issue": "10",
"page": "3131",
"DOI": "10.3390/
"PMID": "42197937",
"PMCID": "PMC13210914",
"ISSN": "1424-8220",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
15
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.3389/fnins.2025.1547916 [code]
- Demonstrating the need for long inter-stimulus intervals when studying the post-movement beta rebound following a simple button press.Journal: Frontiers in neuroscienceIn common: BayesFactor, reticulate, MNE-Python, 6 other tools, MEG, systems, 11 references
- [2] doi:10.1162/imag_a_00283 [code]
- A novel, robust, and portable platform for magnetoencephalography using optically-pumped magnetometers.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MNE-Python, pandas, Matplotlib, 1 other tool, MEG, 8 references
- [3] doi:10.1162/imag_a_00495 [code]
- Combining video telemetry and wearable MEG for naturalistic imaging.Journal: Imaging neuroscience (Cambridge, Mass.)In common: NumPy, MEG, 9 references
- [4] doi:10.1162/imag.a.10 [code]
- Demonstrating equivalence across magnetoencephalography scanner platforms using neural fingerprinting.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MEG, 10 references
- [5] doi:10.1038/s41531-024-00669-3 [code]
- Oscillatory and non-oscillatory features of the magnetoencephalic sensorimotor rhythm in Parkinson's disease.Journal: NPJ Parkinson's diseaseIn common: BayesFactor, MNE-Python, ggplot2, 5 other tools, MEG, systems, 4 references
- [6] doi:10.1162/imag.a.1042 [code]
- Towards a 384-channel magnetoencephalography system based on optically pumped magnetometers.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MNE-Python, seaborn, pandas, 3 other tools, MEG, 6 references
- [7] doi:10.1162/imag.a.1040 [code]
- Novel 4 He-OPMs support waveform-specific beta burst analysis comparable to SQUID-MEGJournal: n/aIn common: MNE-Python, scikit-learn, pandas, 3 other tools, MEG, 6 references
- [8] doi:10.3390/bioengineering11080773 [code]
- A Novel Time-Frequency Parameterization Method for Oscillations in Specific Frequency Bands and Its Application on OPM-MEG.Journal: Bioengineering (Basel, Switzerland)In common: BayesFactor, MNE-Python, ggplot2, 5 other tools, MEG, systems, 3 references
- [9] doi:10.1038/s41598-025-12131-2 [code]
- Assessing the stability of evoked, induced, and passive MEG responses for repeat testing with optically pumped magnetometers.Journal: Scientific reportsIn common: MNE-Python, seaborn, pandas, 3 other tools, MEG, 5 references
- [10] doi:10.1162/imag_a_00179 [code]
- Simultaneous whole-head electrophysiological recordings using EEG and OPM-MEG.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MEG, 8 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 17 scripts, and 15 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:b2db7468eef461dd…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.3390/s26103131)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.3390/s26103131.svg
:target: https://openscicode.org/badge/doi/10.3390/s26103131
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3390/s26103131"><img src="https://openscicode.org/badge/doi/10.3390/s26103131.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
