OSCR

Evaluating BOLD functional MRI biophysical simulation approaches: Impact of vascular geometry, magnetic field calculations, and water diffusion models.

Code ↔ Paper

1 match between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 1 match
  1. [1] § Theory › Diffusion and dephasing calculations › Deterministic diffusion ↔ lessons/Lesson5_BOLDdeterministic.ipynb, lines 56–75 · score 0.50 · modified Bessel function, axis, Gaussian, kernel, pulse, diffusion

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

Jupyter notebook · 130 lines · 6 KB · GPL-3.0 · 1 match

  1. # %% [markdown]
  2. # # Lesson 5 - BOLDdeterministic
  3. #
  4. # The `BOLDdeterministic` module offers a deterministic approach to diffusion modelling. In a complete simulation, it replaces both the `Spins` and `Sequence` objects. To begin we first import the module as follows (and NumPy for array creation, matplotlib for plotting):
  5. # %%
  6. from boldswimsuite import BOLDgeometry, BOLDdeterministic
  7. import numpy as np
  8. import matplotlib.pyplot as plt
  9. # %% [markdown]
  10. # Deterministic diffusion requires a discrete-space voxel. Rather than using Monte Carlo spins to provide the magnetic field offset samples, we use the points on a discrete grid (from the discrete voxel geometry). Unlike spins however, our samples do not diffuse through space over time, they remain on the grid. Instead, the diffusion is modelled by convolving the resulting magnetization (Mx, My) with a special kernel. In essence we are performing a no-diffusion simulation with the gridded samples, and then we apply a post processing step (kernel convolution) on the magnetization to simulate the effects of diffusion. Currently this method is implemented only for 2D geometry, so we will use that in the examples.
  11. # %% [markdown]
  12. # To get started, we once again start by creating a randomly generated 2D continuous voxel.
  13. # %%
  14. random_continuous_voxel = BOLDgeometry.ContinuousVoxel2D.from_random(
  15. size=0.2,
  16. CBV=0.02,
  17. B0=3,
  18. labels=['vein', 'artery'],
  19. weights={
  20. 'vein':1,
  21. 'artery':1
  22. },
  23. diameter_distributions={
  24. 'vein': [0.002, 0.003, 0.004],
  25. 'artery': [0.003, 0.004, 0.005]
  26. },
  27. dchis={
  28. 'vein': 3e-8,
  29. 'artery': 4e-8
  30. },
  31. permeation_probabilities={
  32. 'vein': 0,
  33. 'artery': 0
  34. },
  35. vessel_type='cylinder',
  36. allow_vessel_intersection=True,
  37. seed=0, #repeating with the same seed with provide the same result
  38. progressbar=True
  39. )
  40. print(f'Number of vessels: {len(random_continuous_voxel.vessels)}')
  41. # %% [markdown]
  42. # Since deterministic diffusion requires a discrete voxel, we will now convert the continuous voxel to a discrete voxel using the `from_continuous_analytical` alternate constructor of `DiscreteVoxel2D`.
  43. # %%
  44. discrete_voxel = BOLDgeometry.DiscreteVoxel2D.from_continuous_analytical(
  45. N=200,
  46. voxel=random_continuous_voxel
  47. )
  48. # %% [markdown]
  49. # We now create a `DeterministicDiffuser2D` object. This object replaces both the `Spins` and `Sequence` objects we were previously using. Many of the arguments we have seen before, and they serve the same purpose (i.e. defining the diffusion length and the pulse sequence). There are two new arguments to define for this object.
  50. # - kernel_type : Literal['ModifiedBessel', 'Gaussian'], the type of convolution kernel to use. Default is 'ModifiedBessel'.
  51. # - permeable_vessels : bool, if False, will use a correction method to stop diffusion across vessel walls. Otherwise vessels will be permeable. Default is False.
  52. #
  53. # The kernel type can remain unchanged, as the modified Bessel function kernel is more accurate. Unlike our simulations with `Spins`, deterministic diffusion does not take in account the permeation probabilities we input in the geometry. This is because vessel permeability has not yet been implemented on a per-vessel basis. We are also unable to assign a probability, we can only choose permeable or impermeable vessels. This is why the `permeable_vessels` argument is necessary, it will therefore overwrite any previously assigned permeation probabilities.
  54. # %%
  55. dt=0.2 #we will use a constant 0.2ms time step
  56. dd2d = BOLDdeterministic.DeterministicDiffuser2D(
  57. geometry=discrete_voxel,
  58. pulse_time_indices=[0, 50], #[0ms , 10ms]
  59. pulse_angles=[np.pi/2, np.pi], #[90 degrees, 180 degrees]
  60. pulse_axes=[[np.pi/2, np.pi/2], [np.pi/2, 0]], #[y-axis , x-axis]
  61. ADC=0.001,
  62. dt=dt,
  63. kernel_type='ModifiedBessel',
  64. permeable_vessels=False
  65. )
  66. # %% [markdown]
  67. # We see that the deterministic diffuser prints out the kernel size. This is important as we need the kernel size to be at least larger than 3 (ideally upwards of 10). If the kernel is too small there will be a warning. The kernel size is increased either by increasing `N` during voxel creation, or by increasing the `ADC` (which is not usually desired).
  68. # %% [markdown]
  69. # Much like the `Sequence` object, we can now call `step` or `walk` on our `DeterministicDiffuser2D` to advance the simulation and obtain the signals. Here we will just use the `walk` method for convenience.
  70. # %%
  71. num_steps = 200 # 200*0.2ms = 40ms
  72. eviv, ev, iv = dd2d.walk(
  73. dt=dt,
  74. num_steps=num_steps,
  75. progressbar=True
  76. )
  77. # %% [markdown]
  78. # Now we can plot the signals using matplotlib.
  79. # %%
  80. # array of the time range
  81. time_range = np.arange(0, dt*num_steps, dt)
  82. # creating a matplotlib figure
  83. figure, (ax1,ax2,ax3) = plt.subplots(nrows=1, ncols=3, figsize=(15,5))
  84. # plotting all three signals with some formatting
  85. ax1.plot(time_range, eviv)
  86. ax1.set_title('Total')
  87. ax1.set_xlabel('Time (ms)')
  88. ax1.set_ylabel('Signal')
  89. ax2.plot(time_range, ev)
  90. ax2.set_title('EV')
  91. ax2.set_xlabel('Time (ms)')
  92. ax3.plot(time_range, iv)
  93. ax3.set_title('IV')
  94. ax3.set_xlabel('Time (ms)')
  95. figure.tight_layout()
  96. # %% [markdown]
  97. # This completes the basic lessons for BOLDswimsuite! There are some example scripts of common simulations in the examples folder which can be used as reference:
  98. # - `3D-ANA-MC_script.py`: Monte Carlo diffusion simulation of a randomly generated 3D continuous voxel.
  99. #
  100. # - `3D-ANA-MC-G_script.py`: Monte Carlo diffusion simulation of a randomly generated 3D discrete voxel with analytical offset calculation.
  101. #
  102. # - `3D-FFT-MC_script.py`: Monte Carlo diffusion simulation of a randomly generated 3D discrete voxel with FFT offset calculation.
  103. #
  104. # - `2D-ANA-DD_script.py`: deterministic diffusion simulation of a randomly generated 2D discrete voxel.
  105. #
  106. # - `2D-ANA-MC_script.py`: Monte Carlo diffusion simulation of a randomly generated 2D continuous voxel.
  107. #
  108. # - `2D-ANA-MC-G_script.py`: Monte Carlo diffusion simulation of a randomly generated 2D discrete voxel with analytical offset calculation.

Lesson5_BOLDdeterministic.ipynb at commit 82d7267, under GPL-3.0 · at the source

Overview

Authors: Avery J.L. Berman1,2, Jacob Chaussé3,4, Grant Hartung5,6,7, Jonathan R. Polimeni5,6,8, J. Jean Chen3,9
  1. Department of Physics, Carleton University, Ottawa, ON, Canada
  2. University of Ottawa Institute of Mental Health Research at The Royal, Ottawa, ON, Canada
  3. Rotman Research Institute, Baycrest Health Sciences, North York, ON, Canada
  4. Department of Chemistry, University of Waterloo, Waterloo, ON, Canada
  5. Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Charlestown, MA, United States
  6. Department of Radiology, Harvard Medical School, Boston, MA, United States
  7. Institute for Mechanics, Computational Mechanics Group, Technical University of Darmstadt, Darmstadt, Germany
  8. Harvard-MIT Program in Health Sciences and Technology, Massachusetts Institute of Technology, Cambridge, MA, United States
  9. Department of Medical Biophysics, University of Toronto, Toronto, ON, Canada
Journal: Imaging neuroscience (Cambridge, Mass.), volume 4, article IMAG.a.1247
Dates: received 29 August 2025; accepted 27 April 2026; published online 26 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1162/imag.a.1247 · PMID 42212230 · PMCID PMC13214576 · OpenAlex W4414029927
Open access: diamond, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), none (in silico) (organism), computational (subfield)
Methods: Preprocessing, Spectral & time-frequency
Keywords: BOLD fMRI, simulation, biophysical modelling, Monte Carlo simulations, vascular fingerprinting, quantitative MRI
Topic: Advanced MRI Techniques and Applications (Radiology, Nuclear Medicine and Imaging, Medicine), according to OpenAlex
Citations: not cited yet (Europe PMC); 70 references in the paper

Abstract

Biophysical simulations have guided the development of blood oxygenation level-dependent (BOLD) functional MRI (fMRI) acquisitions and signal models that relate the BOLD signal to the underlying physiology, such as calibrated BOLD and vascular fingerprinting. Numerous simulation techniques have been developed, however, few of them have been directly compared, thus limiting the assessment of the accuracy and interchangeability of these methods as well as the accuracy of the quantitative techniques derived from them. In this work, we compared the accuracy and computational demands of eight previously published simulation approaches that adopt different geometries (ranging from infinite cylinders to synthetic vascular anatomical networks (VANs)), field offset calculations (analytical and Fourier-based), and water diffusion implementations (Monte Carlo and convolution-based), all of which are available in an open-source Python toolkit, BOLDsωimsuite. The reference simulation approach for comparison used three-dimensional infinite cylinders, analytical field offsets, and Monte Carlo diffusion. When compared with the reference approach, most of the simulations, including two- and three-dimensional geometries, were in excellent agreement when assuming the intravascular signal contribution was small. Two commonly employed simulation approaches were notably biased; both used two-dimensional geometries with overly simplified vasculature or field offset calculations. In general, the simulated intravascular signal was the least consistent across approaches, thus potentially resulting in larger errors when the intravascular signal contribution is large. Lastly, the VAN results were in good agreement with the reference but they diverged slightly, yet systematically, from each other at smaller radii (≲3 μm), primarily driven by intravascular signal differences. We conclude, therefore, that the reference approach is an attractive option for exploratory simulations in the many cases where anatomical and haemodynamic realism is not needed, balancing ease of implementation, accessibility, versatility, computational efficiency, accuracy of results, and interpretability. These findings help pave the way for a broader adoption of forward modelling of the BOLD signal and more reliable interpretations of biophysical simulations aiming to develop quantitative models of the BOLD signal.

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 1 match between paragraphs and lines of code.

jacobchausse/BOLDswimsuite

License: GPL-3.0
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 82d72678eea8c135c03372b772c9bf0eadea9617, 13 June 2025
Languages: Python (11), Jupyter (7)
Size: 23 files, 18 scripts
Software Heritage: not archived
Found in: the text, “Signal simulations”
Holds: README, license file, 7 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (17 files), Matplotlib (15 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
20 files

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;
  • 18 scripts, each with its path and the digest of its content;
  • 1 match 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 and Code Availability

The BOLDsωimsuite simulation toolkit is openly available at https://github.com/jacobchausse/BOLDswimsuite. The data and analysis code that support the findings of this study are available from the corresponding author upon reasonable request.

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, pages, dates, 5 authors, 6 keywords, 5 funders, 69 references.

Cite

This paper

Berman, A. J., Chaussé, J., Hartung, G., Polimeni, J. R., & Chen, J. J. (2026). Evaluating BOLD functional MRI biophysical simulation approaches: Impact of vascular geometry, magnetic field calculations, and water diffusion models. Imaging neuroscience (Cambridge, Mass.), 4, IMAG.a.1247. https://doi.org/10.1162/imag.a.1247

BibTeX

@article{berman2026evaluating,
author = {Berman, Avery J.L. and Chaussé, Jacob and Hartung, Grant and Polimeni, Jonathan R. and Chen, J. Jean},
title = {{Evaluating BOLD functional MRI biophysical simulation approaches: Impact of vascular geometry, magnetic field calculations, and water diffusion models}},
journal = {Imaging neuroscience (Cambridge, Mass.)},
year = {2026},
month = may,
volume = {4},
pages = {IMAG.a.1247},
publisher = {MIT Press},
issn = {2837-6056},
doi = {10.1162/imag.a.1247},
url = {https://doi.org/10.1162/imag.a.1247},
pmid = {42212230},
pmcid = {PMC13214576}
}

RIS

TY - JOUR
AU - Berman, Avery J.L.
AU - Chaussé, Jacob
AU - Hartung, Grant
AU - Polimeni, Jonathan R.
AU - Chen, J. Jean
TI - Evaluating BOLD functional MRI biophysical simulation approaches: Impact of vascular geometry, magnetic field calculations, and water diffusion models
T2 - Imaging neuroscience (Cambridge, Mass.)
J2 - Imaging Neurosci (Camb)
PY - 2026
DA - 2026/05/26
VL - 4
SP - IMAG.a.1247
SN - 2837-6056
PB - MIT Press
DO - 10.1162/imag.a.1247
UR - https://doi.org/10.1162/imag.a.1247
LA - en
ER -

CSL-JSON

{
"id": "10.1162/imag.a.1247",
"type": "article-journal",
"title": "Evaluating BOLD functional MRI biophysical simulation approaches: Impact of vascular geometry, magnetic field calculations, and water diffusion models",
"container-title": "Imaging neuroscience (Cambridge, Mass.)",
"author": [
{
"family": "Berman",
"given": "Avery J.L."
},
{
"family": "Chaussé",
"given": "Jacob"
},
{
"family": "Hartung",
"given": "Grant"
},
{
"family": "Polimeni",
"given": "Jonathan R."
},
{
"family": "Chen",
"given": "J. Jean"
}
],
"container-title-short": "Imaging Neurosci (Camb)",
"volume": "4",
"page": "IMAG.a.1247",
"DOI": "10.1162/imag.a.1247",
"PMID": "42212230",
"PMCID": "PMC13214576",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://doi.org/10.1162/imag.a.1247",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
26
]
]
}
}

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.1162/imag.a.1340
Biophysical simulations of fMRI responses using realistic microvascular models: Insights into distinct hemodynamics in humans and mice.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: computational, fMRI, 20 references
[2] doi:10.1371/journal.pcbi.1014576 [code]
A synthetic 3D human cerebrovascular model informed by histology for simulating the cortical depth-dependent BOLD fMRI signal.
Journal: PLoS computational biology
In common: computational, fMRI, 16 references
[3] doi:10.7554/elife.92805 [code]
Brain-wide mapping of layer-specific functional connectivity in the human cortex at 3T using draining-vein-suppressed fMRI.
Journal: eLife
In common: fMRI, 8 references
[4] doi:10.1162/imag.a.1279 [code]
Multimodal laminar characterization of visual areas along the cortical hierarchy.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Matplotlib, NumPy, 4 references
[5] doi:10.1002/mrm.70468 [code]
A Realistic In Silico Brain Phantom for Quantifying Susceptibility Anisotropy-Induced Error in Susceptibility Separation.
Journal: Magnetic resonance in medicine
In common: Matplotlib, NumPy, computational, 2 references
[6] doi:10.1038/s41598-026-58377-2 [code]
A novel distortion-matched anatomical imaging sequence for high-fidelity functional mapping in submillimeter-resolution fMRI.
Journal: Scientific reports
In common: fMRI, 3 references
[7] doi:10.1002/mrm.70433 [code]
Single-Shot 2D Radial Echo Planar Imaging for Functional MRI.
Journal: Magnetic resonance in medicine
In common: fMRI, 3 references
[8] doi:10.1038/s41592-026-03154-2 [code]
Simultaneous single-cell calcium imaging of neuronal population activity and brain-wide BOLD fMRI.
Journal: Nature methods
In common: Matplotlib, NumPy, fMRI, 2 references
[9] doi:10.1162/netn.a.570 [code]
Higher-order statistics for constructing centered edge functional connectivity.
Journal: Network neuroscience (Cambridge, Mass.)
In common: Matplotlib, NumPy, fMRI, 2 references
[10] doi:10.1162/imag.a.1195
Age-dependent diffusion-relaxation coupling in the basal ganglia: Implications for iron deposition and microstructural dynamics.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: 3 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.

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.