Spatial-Jitter Model for Magnetoencephalography Sensor Arrays.
The 6 matches
- [1] § Methods › Realistic Geometry ↔ functions.py, lines 345–379 · score 0.67 · dense spherical sensor, inner product, VSH coefficients
- [2] § Methods › Realistic Geometry ↔ BEM_analysis_MeasCov.py, lines 112–181 · score 0.63 · source amplitudes, noise models, white noise, covariance, Simulations, sensor
- [3] § Methods › Spherical Conductor ↔ functions.py, lines 117–148 · score 0.62 · uniform distribution, half sphere, drawn, inside, radius
- [4] § Methods › Spherical Conductor ↔ functions.py, lines 345–379 · score 0.61 · inner product, VSH coefficients, sensor positions, magnetic field, quadrature, sphere
- [5] § Results › Realistic Geometry ↔ BEM_analysis_MeasCov.py, lines 112–181 · score 0.60 · covariance model, source amplitude, noise model, simulation, SNR, sensor
- [6] § Methods › Spherical Conductor ↔ source_depth.py, lines 30–75 · score 0.54 · Lebedev quadrature, spherical conductor, scalp measurements, spatial jitter, sphere, VSH
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 457 lines · 9.7 KB · MIT · 3 matches
- import numpy as np
- #Functions that are shared across the scripts used in the spatial-jitter simulations
- def BSph(r, rq, Q):
- """
- Calculate magnetic field due to a current dipole in a spherical conductor.
- Sarvas' formula is used'
- Parameters
- ----------
- r: array (1, 3)
- the position where the field is calculated
- rq: array (1, 3)
- the position of the dipole
- Q: array (1, 3)
- the dipole monent of the current dipole
- Returns
- -------
- B: array (1, 3)
- """
- mu04pi = 1e-7
- a = r-rq
- rn = np.linalg.norm(r)
- an = np.linalg.norm(a)
- F = an*(rn*an + rn**2 - np.dot(rq,r))
- nF1 = ((1/rn)*an**2 + (1/an)*np.dot(a,r) + 2*an + 2*rn)*r
- nF2 = -(an+ 2*rn + 1/an*np.dot(a,r))*rq
- nF = nF1+nF2
- B = mu04pi*(F*np.cross(Q,rq) - (np.dot(np.cross(Q,rq),r)*(nF)))/(F**2)
- return B
- def spectra(coefs, lmax):
- """
- Calculate the energy-spectral density from the VSH coefficients
- Parameters
- ----------
- coefs: array (Ncoefs)
- the VSH coefficients
- lmax: integer
- the maximum l-degree
- Returns
- -------
- s: array (lmax, 1)
- """
- s = np.zeros(lmax)
- lind = 0
- for l in range(1,lmax+1):
- temp = 0
- for m in range(-1*l,l+1):
- c = coefs[lind]
- temp += c**2
- lind += 1
- s[l-1] = temp
- return s
- def Bdim(r, n, t1, t2, rq, Q, dim):
- """
- Calculate the sensor output to a current dipole in a spherical conductor.
- Assumes rectangular sensor. Uses Sarvas' formula. Outputs the 3D magnetic field vector.
- Parameters
- ----------
- r: array (1,3)
- the position of the sensor
- n: array (1,3)
- the normal vector of the sensor
- t1: array (1,3)
- the first tangential vector of the sensor
- t2: array (1,3)
- the second tangential vector of the sensor
- rq: array (1,3)
- the position of the dipole
- Q: array (1,3)
- the dipole monent of the current dipole
- dim: float
- the sidelength of the sensor rectangle
- Returns
- -------
- res: array (1, 3)
- """
- ropm = np.zeros((4,3))
- ropm[0] = r + dim/4*t1 + dim/4*t2
- ropm[1] = r + dim/4*t1 - dim/4*t2
- ropm[2] = r - dim/4*t1 + dim/4*t2
- ropm[3] = r - dim/4*t1 - dim/4*t2
- res = np.zeros((1,3))
- for i in range(4):
- res += BSph(ropm[i], rq, Q)
- res /= 4
- return res
- def GetRandomPointsInAsphere(dim,N):
- """
- Get uniform-distributed random points inside a half sphere (z>0).
- Parameters
- ----------
- dim: float
- the radius of the half sphere
- N: integer
- the number of random points to be produced
- Returns
- -------
- xr: array (N, 1)
- yr: array (N, 1)
- zr: array (N, 1)
- """
- u = np.random.rand(N)
- rr = dim*np.cbrt(u)
- thetar = 2*np.pi*np.random.rand(N)
- phir = np.arccos(np.random.rand(N)) #random number drawn from [0,1] to produce points in the half sphere
- xr = rr*np.cos(thetar)*np.sin(phir)
- yr = rr*np.sin(thetar)*np.sin(phir)
- zr = rr*np.cos(phir)
- return xr, yr, zr
- def GetRandomPointsInACircle(dim,N):
- """
- Get uniform-distributed random points inside a circle.
- Parameters
- ----------
- dim: float
- the radius of the circle
- N: integer
- the number of random points to be produced
- Returns
- -------
- x: array (N, 1)
- y: array (N, 1)
- """
- u = np.random.rand(N)
- r = dim*np.sqrt(u)
- theta = 2*np.pi*np.random.rand(N)
- x = r*np.cos(theta)
- y = r*np.sin(theta)
- return x, y
- def jitpos_tang(r,dim,t1,t2):
- """
- Add tangential spatial jitter to the sensor positions.
- Parameters
- ----------
- r: array (N,3)
- the sensor positions
- dim: float
- the amount of spatial jitter to be added
- t1: array (N,3)
- the first tangential vectors of the sensors
- t2: array (N,3)
- the second tangential vectors of the sensors
- Returns
- -------
- r_ret: array (N, 3)
- """
- N = r.shape[0]
- x, y = GetRandomPointsInACircle(dim,N)
- r_ret = r + x[:,None]*t1 + y[:,None]*t2
- return r_ret
- def jitpos_normal(r,dim,n):
- """
- Add normal/radial spatial jitter to the sensor positions.
- Parameters
- ----------
- r: array (N,3)
- the sensor positions
- dim: float
- the amount of spatial jitter to be added
- n: array (N,3)
- the normal vectors of the sensors
- Returns
- -------
- r_ret: array (N, 3)
- """
- N = r.shape[0]
- z = np.random.rand(N)*dim
- r_ret = r + z[:,None]*n
- return r_ret
- def jitpos_3D(r,dim,t1,t2,n):
- """
- Add 3D spatial jitter to the sensor positions.
- Parameters
- ----------
- r: array (N,3)
- the sensor positions
- dim: float
- the amount of spatial jitter to be added
- n: array (N,3)
- the normal vectors of the sensors
- t1: array (N,3)
- the first tangential vectors of the sensors
- t2: array (N,3)
- the second tangential vectors of the sensors
- Returns
- -------
- r_ret: array (N, 3)
- """
- N = r.shape[0]
- x, y, z = GetRandomPointsInAsphere(dim,N)
- r_ret = r + x[:,None]*t1 + y[:,None]*t2+ z[:,None]*n
- return r_ret
- def jitori(theta):
- """
- Add orientation jitter to the sensor orientations.
- Each of the sensor axes is rotated by theta to a random direction.
- Parameters
- ----------
- theta: float
- the amount (in radians) how much the sensor axes are perturbed
- Returns
- -------
- ret: array (3, 3)
- rotation matrix that perturbs the sensor directions
- """
- #X-axis
- phi =np.random.rand()*2*np.pi
- u = np.zeros((1,3))
- u[0] = np.array((0, -1*np.sin(phi), np.cos(phi)))
- uxu = u.T@u
- ux = np.array(((0, -1*u[0,2], u[0,1]), (u[0,2],0, -1*u[0,0]), (-1*u[0,1], u[0,0], 0)))
- th = np.random.rand()*theta
- R = np.cos(th)*np.eye((3)) + np.sin(th)*ux + (1-np.cos(th))*uxu
- x = np.zeros((3,1))
- x[0] = 1
- new_x = R@x
- #Y-axis
- phi =np.random.rand()*2*np.pi
- u = np.zeros((1,3))
- u[0] = np.array((np.sin(phi), 0, -1*np.cos(phi)))
- uxu = u.T@u
- ux = np.array(((0, -1*u[0,2], u[0,1]), (u[0,2],0, -1*u[0,0]), (-1*u[0,1], u[0,0], 0)))
- th = np.random.rand()*theta
- R = np.cos(th)*np.eye((3)) + np.sin(th)*ux + (1-np.cos(th))*uxu
- y = np.zeros((3,1))
- y[1] = 1
- new_y= R@y
- #z-axis
- phi =np.random.rand()*2*np.pi
- u = np.zeros((1,3))
- u[0] = np.array((-1*np.sin(phi), np.cos(phi),0))
- uxu = u.T@u
- ux = np.array(((0, -1*u[0,2], u[0,1]), (u[0,2],0, -1*u[0,0]), (-1*u[0,1], u[0,0], 0)))
- th = np.random.rand()*theta
- R = np.cos(th)*np.eye((3)) + np.sin(th)*ux + (1-np.cos(th))*uxu
- z = np.zeros((3,1))
- z[2] = 1
- new_z= R@z
- ret = np.zeros((3,3))
- ret[0] = new_x.T
- ret[1] = new_y.T
- ret[2] = new_z.T
- return ret
- def CalculateCoefs(b,V,Rm,Rs,w,lvalues):
- """
- Calculate VSH coefficients according to the inner product formula.
- Only works for dense spherical sensor arrays defined at quadrature points for integrating over a sphere.
- Please check the manuscript.
- Parameters
- ----------
- b: array (Nx3)
- the magnetic field at the sensor positions
- V: array (Nx3xNc)
- Nc VSH basis functions normalized to unit energy
- Rm: float
- the radius of the sphere where the sensor array is
- Rs: float
- the radius of the sphere of the VSH expansion
- w: array (N)
- the quadrature weights at the sensor positions
- lvalues: array (Nc)
- the values of l-degrees at each index
- Returns
- -------
- coeffs: array (Nc, 1)
- """
- Nc = V.shape[2]
- mu0 = 1e-7 * 4 * np.pi
- coeffs = np.zeros((Nc))
- for i in range(Nc):
- dotp = np.sum(w*np.sum(b * V[:,:,i], axis=1))
- coeffs[i] = - Rm**(2*lvalues[i]+4)*dotp/(mu0*(2*lvalues[i]+1)*Rs**(2*lvalues[i]+1))
- return coeffs
- def rand_rotation_matrix(angle):
- """
- Generate a random rotation matrix. The matrix rotates a vector to a random direction by an angle.
- Parameters
- ----------
- angle: float
- rotation angle in radians
- Returns
- -------
- R: array (3, 3)
- """
- x1 = np.random.rand()
- x2 = np.random.rand()
- theta = np.arccos(2*x1-1)
- phi= 2*np.pi*x2
- v = np.array((np.sin(theta)*np.cos(phi), np.sin(theta)*np.sin(phi),np.cos(theta)))
- cn= 1-np.cos(angle)
- c = np.cos(angle)
- s = np.sin(angle)
- R = np.zeros((3,3))
- R[0,0] = v[0]**2*cn+c
- R[0,1] = v[0]*v[1]*cn-v[2]*s
- R[0,2] = v[0]*v[2]*cn+v[1]*s
- R[1,0] = v[0]*v[1]*cn+v[2]*s
- R[1,1] = v[1]**2*cn+c
- R[1,2] = v[1]*v[2]*cn-v[0]*s
- R[2,0] = v[0]*v[2]*cn-v[1]*s
- R[2,1] = v[1]*v[2]*cn+v[0]*s
- R[2,2] = v[2]**2*cn+c
- return R
- def rand_translation(dist):
- """
- Generate a random translation vector. Translates a vector to random direction by a some distance.
- Parameters
- ----------
- dist: float
- translation distance
- Returns
- -------
- v: array (1, 3)
- """
- x1 = np.random.rand()
- x2 = np.random.rand()
- theta = np.arccos(2*x1-1)
- phi= 2*np.pi*x2
- v = np.array((np.sin(theta)*np.cos(phi), np.sin(theta)*np.sin(phi),np.cos(theta)))*dist
- return v
functions.py at commit 3ec835c, under MIT · at the source
Overview
Abstract
Sampling jitter, i.e., random deviations in the time instants when samples are taken, causes frequency-dependent noise that reduces signal-to-noise ratio (SNR). This paper generalizes the concept of jitter to magnetoencephalography (MEG) sensor arrays that spatially sample the quasistatic magnetic field due to brain activity. It is shown that spatial jitter, i.e., random deviations in MEG sensor positions, causes spatial-frequency-depend
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 6 matches between paragraphs and lines of code.
jiivana/SpatialJitter
3ec835c01f790e5a01659f8dad5846f0bfa3e11b, 31 March 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
14 files
- BEM_analysis_MeasCov.py, Python, 321 lines, 2 matches
- BEM_simulation_MeasCov.p
y , Python, 396 lines - BEM_simulation_analysis.
py , Python, 149 lines - BEM_simulation_inpieces.
py , Python, 768 lines - Bspectrasphere.py, Python, 853 lines
- Illustration.py, Python, 313 lines
- Illustration_BEM.py, Python, 560 lines
- LICENSE.py, Python, 7 lines
- PlotManyParameterResults
.py , Python, 173 lines - TransferFunctions.py, Python, 599 lines
- UniformTranslationRotati
on.py , Python, 278 lines - functions.py, Python, 457 lines, 3 matches
- source_depth.py, Python, 296 lines, 1 match
- README.md, Text, 5 lines
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;
- 13 scripts, each with its path and the digest of its content;
- 6 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.
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 2, 28 September 2026
- Publisher: n/a → Institute of Electrical and Electronics Engineers
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 1 author, 6 keywords, 8 MeSH terms, 5 funders, 28 references.
Cite
This paper
Iivanainen, J. (2026). Spatial-Jitter Model for Magnetoencephalography Sensor Arrays. IEEE transactions on medical imaging, 45(7), 3908-3921. https://
BibTeX
@article{iivanainen2026s
author = {Iivanainen, Joonas},
title = {{Spatial-Jitter Model for Magnetoencephalography Sensor Arrays}},
journal = {IEEE transactions on medical imaging},
year = {2026},
month = jul,
volume = {45},
number = {7},
pages = {3908--3921},
publisher = {Institute of Electrical and Electronics Engineers},
issn = {0278-0062},
doi = {10.1109/
url = {https://
pmid = {42043988},
pmcid = {PMC13503295}
}
RIS
TY - JOUR
AU - Iivanainen, Joonas
TI - Spatial-Jitter Model for Magnetoencephalography Sensor Arrays
T2 - IEEE transactions on medical imaging
J2 - IEEE Trans Med Imaging
PY - 2026
DA - 2026/
VL - 45
IS - 7
SP - 3908
EP - 3921
SN - 0278-0062
PB - Institute of Electrical and Electronics Engineers
DO - 10.1109/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1109/
"type": "article-journal",
"title": "Spatial-Jitter Model for Magnetoencephalography Sensor Arrays",
"container-title": "IEEE transactions on medical imaging",
"author": [
{
"family": "Iivanainen",
"given": "Joonas"
}
],
"container-title-short":
"volume": "45",
"issue": "7",
"page": "3908-3921",
"DOI": "10.1109/
"PMID": "42043988",
"PMCID": "PMC13503295",
"ISSN": "0278-0062",
"publisher": "Institute of Electrical and Electronics Engineers",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
1
]
]
}
}
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.1002/hbm.70368 [code]
- The Mismatch Negativity Compared: EEG, SQUID‐MEG, and Novel 4 Helium‐OPMsJournal: n/aIn common: MNE-Python, SciPy, Matplotlib, 1 other tool, MEG, 4 references
- [2] doi:10.1038/s41598-025-08037-8 [code]
- OPM-MEG reveals dynamics of beta bursts underlying attentional processes in sensory cortexJournal: n/aIn common: NumPy, MEG, 6 references
- [3] 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, SciPy, Matplotlib, 1 other tool, MEG, 3 references
- [4] doi:10.1093/cercor/bhag075 [code]
- Cortical dynamics of icon perception: effects of concreteness and attractiveness.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: MNE-Python, SciPy, Matplotlib, 1 other tool, MEG, 3 references
- [5] doi:10.1371/journal.pone.0351872 [code]
- Decoding visual object recognition from EEG signals.Journal: PloS oneIn common: MNE-Python, SciPy, Matplotlib, 1 other tool, 3 references
- [6] doi:10.1162/imag.a.1218 [code]
- Reliability and signal comparison of OPM-MEG, fMRI &
amp; iEEG in a repeated movie viewing paradigm. Journal: Imaging neuroscience (Cambridge, Mass.)In common: MEG, 4 references - [7] doi:10.1126/sciadv.aea3919 [code]
- Hierarchical brain dynamics supporting visual perceptual transitions.Journal: Science advancesIn common: MNE-Python, SciPy, Matplotlib, 1 other tool, MEG, 2 references
- [8] doi:10.1162/imag.a.1269 [code]
- From early to contemporary normative modeling: Mapping individual differences in neurophysiological signals.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MNE-Python, SciPy, Matplotlib, 1 other tool, MEG, 2 references
- [9] doi:10.1016/j.neuroimage.2026.122051 [code]
- Determining hemispheric language dominance from MEG beta-power modulations: Concordance with fMRI.Journal: NeuroImageIn common: MNE-Python, SciPy, Matplotlib, 1 other tool, MEG, 1 reference
- [10] doi:10.1038/s41597-025-06397-4 [code]
- MEG-SCANS - A comprehensive magnetoencephalography speech dataset with Stories, Chirps and Noisy SentencesJournal: n/aIn common: MNE-Python, SciPy, Matplotlib, 1 other tool, MEG, 1 reference
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, 13 scripts, and 6 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:b93b0d26d8a725ee…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
