Evaluating BOLD functional MRI biophysical simulation approaches: Impact of vascular geometry, magnetic field calculations, and water diffusion models.
The 1 match
- [1] § Theory › Diffusion and dephasing calculations › Deterministic diffusion ↔ lessons/Lesson5_BOLDdeterministic.ipynb, lines 56 to 75 · score 0.50 · modified Bessel function, axis, Gaussian, kernel, pulse, diffusion · 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
Jupyter notebook · 130 lines · 6 KB · GPL-3.0 · 1 match
- # %% [markdown]
- # # Lesson 5 - BOLDdeterministic
- #
- # 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):
- # %%
- from boldswimsuite import BOLDgeometry, BOLDdeterministic
- import numpy as np
- import matplotlib.pyplot as plt
- # %% [markdown]
- # 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.
- # %% [markdown]
- # To get started, we once again start by creating a randomly generated 2D continuous voxel.
- # %%
- random_continuous_voxel = BOLDgeometry.ContinuousVoxel2D.from_random(
- size=0.2,
- CBV=0.02,
- B0=3,
- labels=['vein', 'artery'],
- weights={
- 'vein':1,
- 'artery':1
- },
- diameter_distributions={
- 'vein': [0.002, 0.003, 0.004],
- 'artery': [0.003, 0.004, 0.005]
- },
- dchis={
- 'vein': 3e-8,
- 'artery': 4e-8
- },
- permeation_probabilities={
- 'vein': 0,
- 'artery': 0
- },
- vessel_type='cylinder',
- allow_vessel_intersection=True,
- seed=0, #repeating with the same seed with provide the same result
- progressbar=True
- )
- print(f'Number of vessels: {len(random_continuous_voxel.vessels)}')
- # %% [markdown]
- # 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`.
- # %%
- discrete_voxel = BOLDgeometry.DiscreteVoxel2D.from_continuous_analytical(
- N=200,
- voxel=random_continuous_voxel
- )
- # %% [markdown]
- # 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.
- # - kernel_type : Literal['ModifiedBessel', 'Gaussian'], the type of convolution kernel to use. Default is 'ModifiedBessel'.
- # - permeable_vessels : bool, if False, will use a correction method to stop diffusion across vessel walls. Otherwise vessels will be permeable. Default is False.
- #
- # 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.
- # %%
- dt=0.2 #we will use a constant 0.2ms time step
- dd2d = BOLDdeterministic.DeterministicDiffuser2D(
- geometry=discrete_voxel,
- pulse_time_indices=[0, 50], #[0ms , 10ms]
- pulse_angles=[np.pi/2, np.pi], #[90 degrees, 180 degrees]
- pulse_axes=[[np.pi/2, np.pi/2], [np.pi/2, 0]], #[y-axis , x-axis]
- ADC=0.001,
- dt=dt,
- kernel_type='ModifiedBessel',
- permeable_vessels=False
- )
- # %% [markdown]
- # 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).
- # %% [markdown]
- # 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.
- # %%
- num_steps = 200 # 200*0.2ms = 40ms
- eviv, ev, iv = dd2d.walk(
- dt=dt,
- num_steps=num_steps,
- progressbar=True
- )
- # %% [markdown]
- # Now we can plot the signals using matplotlib.
- # %%
- # array of the time range
- time_range = np.arange(0, dt*num_steps, dt)
- # creating a matplotlib figure
- figure, (ax1,ax2,ax3) = plt.subplots(nrows=1, ncols=3, figsize=(15,5))
- # plotting all three signals with some formatting
- ax1.plot(time_range, eviv)
- ax1.set_title('Total')
- ax1.set_xlabel('Time (ms)')
- ax1.set_ylabel('Signal')
- ax2.plot(time_range, ev)
- ax2.set_title('EV')
- ax2.set_xlabel('Time (ms)')
- ax3.plot(time_range, iv)
- ax3.set_title('IV')
- ax3.set_xlabel('Time (ms)')
- figure.tight_layout()
- # %% [markdown]
- # 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:
- # - `3D-ANA-MC_script.py`: Monte Carlo diffusion simulation of a randomly generated 3D continuous voxel.
- #
- # - `3D-ANA-MC-G_script.py`: Monte Carlo diffusion simulation of a randomly generated 3D discrete voxel with analytical offset calculation.
- #
- # - `3D-FFT-MC_script.py`: Monte Carlo diffusion simulation of a randomly generated 3D discrete voxel with FFT offset calculation.
- #
- # - `2D-ANA-DD_script.py`: deterministic diffusion simulation of a randomly generated 2D discrete voxel.
- #
- # - `2D-ANA-MC_script.py`: Monte Carlo diffusion simulation of a randomly generated 2D continuous voxel.
- #
- # - `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
- Department of Physics, Carleton University, Ottawa, ON, Canada
- University of Ottawa Institute of Mental Health Research at The Royal, Ottawa, ON, Canada
- Rotman Research Institute, Baycrest Health Sciences, North York, ON, Canada
- Department of Chemistry, University of Waterloo, Waterloo, ON, Canada
- Athinoula A. Martinos Center for Biomedical Imaging, Massachusetts General Hospital, Charlestown, MA, United States
- Department of Radiology, Harvard Medical School, Boston, MA, United States
- Institute for Mechanics, Computational Mechanics Group, Technical University of Darmstadt, Darmstadt, Germany
- Harvard-MIT Program in Health Sciences and Technology, Massachusetts Institute of Technology, Cambridge, MA, United States
- Department of Medical Biophysics, University of Toronto, Toronto, ON, Canada
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
82d72678eea8c135c03372b772c9bf0eadea9617, 13 June 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
20 files
- examples/
2D-ANA-DD_script.py , Python, 68 lines - examples/
2D-ANA-MC-G-MW_script.py , Python, 176 lines - examples/
2D-ANA-MC-G_script.py , Python, 73 lines - examples/
2D-ANA-MC_script.py , Python, 68 lines - examples/
3D-ANA-MC-G_script.py , Python, 71 lines - examples/
3D-ANA-MC_script.py , Python, 66 lines - examples/
3D-FFT-MC_script.py , Python, 73 lines - examples/
saveload_ContinuousVoxel , Python, 80 lines2D.py - examples/
saveload_ContinuousVoxel , Python, 80 lines3D.py - examples/
saveload_DiscreteVoxel2D , Python, 86 lines.py - examples/
saveload_DiscreteVoxel3D , Python, 86 lines.py - lessons/
Lesson0_JupyterNotebooks , Jupyter, 40 lines.ipynb - lessons/
Lesson1_BOLDvessel.ipynb , Jupyter, 166 lines - lessons/
Lesson2_BOLDgeometry.ipy , Jupyter, 314 linesnb - lessons/
Lesson3_BOLDspins.ipynb , Jupyter, 136 lines - lessons/
Lesson4_BOLDsequence.ipy , Jupyter, 271 linesnb - lessons/
Lesson5_BOLDdeterministi , Jupyter, 130 lines, 1 matchc.ipynb - lessons/
Lesson6_AdvancedExamples , Jupyter, 471 lines.ipynb - COPYING, License, 674 lines
- README.md, Text, 44 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;
- 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://
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://
BibTeX
@article{berman2026evalu
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/
url = {https://
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/
VL - 4
SP - IMAG.a.1247
SN - 2837-6056
PB - MIT Press
DO - 10.1162/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1162/
"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":
"volume": "4",
"page": "IMAG.a.1247",
"DOI": "10.1162/
"PMID": "42212230",
"PMCID": "PMC13214576",
"ISSN": "2837-6056",
"publisher": "MIT Press",
"URL": "https://
"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_00519 [code]
- BOLDsωimsuite: A new software suite for forward modeling of the BOLD fMRI signal.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Matplotlib, NumPy, none (in silico), fMRI, 25 references, 2 authors
- [2] 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
- [3] 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 biologyIn common: computational, fMRI, 16 references
- [4] doi:10.1162/imag_a_00533 [code]
- SpinWalk: A Monte Carlo simulator for MR-signal formation in inhomogeneous tissue.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Matplotlib, NumPy, none (in silico), fMRI, 13 references
- [5] doi:10.1162/imag_a_00435
- Macrovascular contributions to resting-state fMRI signals: A comparison between EPI and bSSFP at 9.4 Tesla.Journal: Imaging neuroscience (Cambridge, Mass.)In common: fMRI, 13 references
- [6] doi:10.1162/imag_a_00573
- Impact of vascular architecture, oxygen saturation, and hematocrit on human cortical depth-dependent GE- and SE-BOLD fMRI signals: A simulation approach using realistic 3D vascular networks.Journal: Imaging neuroscience (Cambridge, Mass.)In common: fMRI, 12 references
- [7] doi:10.1162/imag_a_00315
- Predicting the macrovascular contribution to resting-state fMRI functional connectivity at 3 Tesla: A model-informed approach.Journal: Imaging neuroscience (Cambridge, Mass.)In common: fMRI, 11 references
- [8] doi:10.1002/mrm.30629 [code]
- Fast MR signal simulations of microvascular and diffusion contributions using histogram-based approximation and recurrent neural networks.Journal: Magnetic resonance in medicineIn common: Matplotlib, NumPy, computational, fMRI, 8 references
- [9] doi:10.1016/j.neuroimage.2021.118641 [code]
- Simultaneous pure T<sub>2</
sub> and varying T<sub>2</ sub>'-weighted BOLD fMRI using Echo Planar Time-resolved Imaging for mapping cortical-depth dependent responses. Journal: NeuroImageIn common: NumPy, fMRI, 9 references - [10] doi:10.1162/imag_a_00377 [code]
- Enhancing MR vascular Fingerprinting with realistic microvascular geometries.Journal: Imaging neuroscience (Cambridge, Mass.)In common: 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, 18 scripts, and 1 match 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:c73fb1df8960f2e6…
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.1162/imag.a.1247)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1162/imag.a.1247.svg
:target: https://openscicode.org/badge/doi/10.1162/imag.a.1247
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1162/imag.a.1247"><img src="https://openscicode.org/badge/doi/10.1162/imag.a.1247.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.
