OSCR

Anatomically constrained volumetric smoothing enhances fMRI reliability while avoiding smoothing artifacts.

Code ↔ Paper

3 matches 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 3 matches
  1. [1] § Methods › Constrained smoothing ↔ csmooth/optimization.py, lines 8–42 · score 0.63 · heat kernel smoothing, full width, iteratively, optimized, FWHM
  2. [2] § Methods › Constrained smoothing › Equivalent parameter estimation and smoothing ↔ csmooth/optimization.py, lines 8–42 · score 0.61 · Heat kernel smoothing, full width, optimization, nodes, signal, graphs
  3. [3] § Methods › Constrained smoothing › Equivalent parameter estimation and smoothing ↔ csmooth/smooth.py, lines 292–360 · score 0.54 · graph signal, Gaussian kernel, computationally, smoothing kernel, nodes, component

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 · 114 lines · 5.4 KB · Apache-2.0 · 2 matches

  1. import numpy as np
  2. import time
  3. from csmooth.fwhm import estimate_fwhm
  4. from csmooth.heat import heat_kernel_smoothing
  5. from csmooth.utils import logger
  6. def graph_smoothing_with_gradient_descent(data, edge_src, edge_dst, edge_distances, fwhm,
  7. max_iterations=100, stop_threshold=0.01, initial_tau=None, learning_rate=1.0,
  8. decay_rate=0.99, random_seed=42):
  9. """
  10. Smooth a signal based on a graph targeting a specific fwhm.
  11. This function uses gradient descent to find the optimal smoothing parameter
  12. to achieve the target fwhm.
  13. First, a random noise image is generated. Then, the signal is smoothed using the initial tau.
  14. The fwhm of the smoothed signal is estimated. The gradient of the fwhm with respect to tau is computed.
  15. The tau is updated using the gradient and learning rate. This process is repeated until the fwhm is close
  16. enough to the target fwhm or the maximum number of iterations is reached.
  17. The final value of tau is used to smooth the original signal.
  18. :param data: signal data to be smoothed.
  19. :param edge_src: source nodes of the graph edges.
  20. :param edge_dst: destination nodes of the graph edges.
  21. :param edge_distances: distances of the graph edges.
  22. :param fwhm: target full width at half maximum in mm.
  23. :param max_iterations: maximum number of iterations for gradient descent.
  24. :param stop_threshold: threshold for stopping the gradient descent.
  25. :param initial_tau: initial value for the smoothing parameter. If None, 2*fwhm is used as the initial value.
  26. :param learning_rate: learning rate for gradient descent.
  27. :param decay_rate: decay rate for the learning rate.
  28. :param random_seed: random seed for generating the random noise image. By default, 42.
  29. :param patience: number of iterations to wait before stopping if the fwhm does not improve.
  30. :return: smoothed signal
  31. """
  32. tua = find_optimal_tau(fwhm=fwhm, edge_src=edge_src, edge_dst=edge_dst,
  33. edge_distances=edge_distances, shape=data.shape, initial_tau=initial_tau,
  34. max_iterations=max_iterations, stop_threshold=stop_threshold,
  35. learning_rate=learning_rate, decay_rate=decay_rate, random_seed=random_seed)
  36. smoothed_signal = heat_kernel_smoothing(signal_data=data, tau=tua, edge_src=edge_src,
  37. edge_dst=edge_dst, edge_distances=edge_distances)
  38. return smoothed_signal, tua
  39. def find_optimal_tau(fwhm, edge_src, edge_dst, edge_distances, shape, initial_tau=None,
  40. max_iterations=100, stop_threshold=0.005, learning_rate=3.0, decay_rate=0.99,
  41. random_seed=42, error_threshold=0.5, patience=20):
  42. # TODO: add momentum to the gradient descent
  43. start_time = time.time()
  44. initial_patience = patience
  45. if initial_tau is None:
  46. initial_tau = 2 * fwhm
  47. tau = initial_tau
  48. np.random.seed(random_seed)
  49. random_noise = np.random.randn(*shape)
  50. mae = np.inf
  51. current_fwhm = np.nan
  52. best_tau = tau
  53. best_mae = np.inf
  54. best_fwhm = current_fwhm
  55. for i in range(max_iterations):
  56. smoothed_noise = heat_kernel_smoothing(signal_data=random_noise, tau=tau, edge_src=edge_src,
  57. edge_dst=edge_dst, edge_distances=edge_distances)
  58. current_fwhm = estimate_fwhm(edge_src=edge_src, edge_dst=edge_dst,
  59. edge_distances=edge_distances, signal_data=smoothed_noise)
  60. logger.debug(f"Iteration {i}: current fwhm: {current_fwhm:.2f}, target fwhm: {fwhm:.2f} tau: {tau:.2f}")
  61. previous_mae = mae
  62. mae = np.abs(current_fwhm - fwhm)
  63. if mae < best_mae:
  64. best_mae = mae
  65. best_tau = tau
  66. best_fwhm = current_fwhm
  67. if mae < stop_threshold:
  68. break
  69. if i == max_iterations - 1:
  70. logger.warning(f"Maximum iterations reached ({max_iterations}). ")
  71. break
  72. gradient = current_fwhm - fwhm
  73. previous_tau = tau
  74. tau -= learning_rate * gradient
  75. if tau <= 0:
  76. logger.info(f"Tau became non-positive. Reducing tau to half of previous value.")
  77. tau = previous_tau / 2
  78. elif mae > previous_mae:
  79. logger.warning(f"MAE increased from {previous_mae:.4f} to {mae:.4f}.")
  80. patience -= 1
  81. if patience <= 0:
  82. logger.warning(f"Patience of {initial_patience} iterations exceeded. Stopping gradient descent.")
  83. break
  84. else:
  85. logger.warning(f"Continuing gradient descent with reduced learning rate.")
  86. learning_rate /= 2
  87. else:
  88. learning_rate *= decay_rate
  89. patience = initial_patience # reset patience if we made progress
  90. if mae > error_threshold:
  91. raise ValueError(f"Failed to achieve target fwhm within error threshold: {error_threshold:.3f}. "
  92. f"Final fwhm: {current_fwhm:.2f}, target fwhm: {fwhm:.2f}, "
  93. f"tau: {tau:.2f}.")
  94. end_time = time.time()
  95. logger.info(f"Gradient descent completed.")
  96. logger.info(f"Final tau: {best_tau:.2f}, "
  97. f"achieved fwhm: {best_fwhm:.2f}, "
  98. f"target fwhm: {fwhm:.2f}, "
  99. f"time taken: {(end_time - start_time) / 60:.2f} minutes")
  100. return best_tau

optimization.py at commit c423680, under Apache-2.0 · at the source

Overview

Authors: David G. Ellis1, Michele R. Aizenberg1
  1. Department of Neurosurgery, University of Nebraska Medical Center, Omaha, NE, United States
Institutions: University of Nebraska Medical Center (United States)
Journal: Frontiers in neuroimaging, volume 5, article 1753534
Dates: received 24 November 2025; accepted 23 March 2026; published online 1 May 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3389/fnimg.2026.1753534 · PMID 42146843 · PMCID PMC13175814 · OpenAlex W7160043380
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), methods / tools (subfield)
Methods: Spectral & time-frequency, Statistics, Connectivity, Graphs, fMRI & imaging
Keywords: fMRI, spatial smoothing, anatomically constrained smoothing, task activation, functional connectivity, volumetric smoothing artifacts
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 39 references in the paper

Abstract

Introduction: Smoothing fMRI data prior to analysis is a fundamental and widely used technique to increase sensitivity. Unconstrained smoothing can also reduce the spatial specificity of the analysis by introducing artifacts in the data. This study tested the effects of smoothing on the reliability and accuracy of both task fMRI and resting state data. The effects of unconstrained smoothing were compared to those of an anatomically constrained smoothing method, which prevents smoothing across the white and gray matter surfaces of the cortex.

Methods: Unconstrained Gaussian smoothing and anatomically constrained smoothing were applied to simulated data, a sensory task fMRI dataset, a precision fMRI motor task mapping dataset, and a resting state fMRI dataset. Smoothing-related artifacts were tested for and compared between the smoothing methods, and the effects of the smoothing methods on the reliability and accuracy were measured.

Results: In the experiments with simulated data, unconstrained Gaussian smoothing demonstrated decreased accuracy and increased white matter activation compared to constrained smoothing. In the sensory task activation analysis, both Gaussian and constrained smoothing increased the reliability of the sensory task fMRI activations, but Gaussian smoothing increased the percentage of active voxels in the white matter relative to constrained smoothing (p < 0.001). Relative to constrained smoothing, Gaussian smoothing with FWHM > 3 mm also decreased the accuracy of motor mapping results from individual sessions to the precision maps (p < 0.001). With cluster significance thresholding, mean false positive voxel percentages remained below 5% for both methods across the tested kernel widths. Both Gaussian and constrained smoothing demonstrated a biasing effect on the resting state connectivity of nearby regions and on the graph theory metrics of the functional connectomes.

Conclusion: This study showed that unconstrained Gaussian smoothing spreads activation across cortical boundaries, increases white matter activation, and biases graph theory connectivity metrics. Anatomically constrained smoothing reduced some of these smoothing artifacts while still increasing reliability and may be a reasonable alternative to unconstrained Gaussian smoothing.

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 3 matches between paragraphs and lines of code.

ellisdg/csmooth

License: Apache-2.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: c4236808cb2cf49ebb8c29fe7c27a2384b3530b0, 3 March 2026
Languages: Python (13)
Size: 20 files, 13 scripts
Software Heritage: not archived
Found in: the acknowledgements
Holds: README, license file, environment (Dockerfile, pyproject.toml, requirements.txt, setup.py)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (8 files), NiBabel (4 files), SciPy (4 files), Nilearn (3 files), NetworkX (2 files), TemplateFlow (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
15 files

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;
  • 3 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

The sensory task fMRI data analyzed in this study can be found at openneuro.org under dataset ds005009 version 1.0.0. The fMRI data for the Midnight Scan Club analyzed in this study can be found at openneuro.org under dataset ds000224 version 1.0.4. Data analyzed in this study from the Human Connectome Project in Aging can be accessed through the National Institute of Mental Health Data Archive at nda.nih.gov. Data collection for the Human Connectome Project in Aging was supported by the National Institute on Aging of the National Institutes of Health under Award Number U01AG052564.

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, 27 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 2 authors, 6 keywords, 35 references.

Cite

This paper

Ellis, D. G., & Aizenberg, M. R. (2026). Anatomically constrained volumetric smoothing enhances fMRI reliability while avoiding smoothing artifacts. Frontiers in neuroimaging, 5, 1753534. https://doi.org/10.3389/fnimg.2026.1753534

BibTeX

@article{ellis2026anatomically,
author = {Ellis, David G. and Aizenberg, Michele R.},
title = {{Anatomically constrained volumetric smoothing enhances fMRI reliability while avoiding smoothing artifacts}},
journal = {Frontiers in neuroimaging},
year = {2026},
month = may,
volume = {5},
pages = {1753534},
publisher = {Frontiers Media SA},
issn = {2813-1193},
doi = {10.3389/fnimg.2026.1753534},
url = {https://doi.org/10.3389/fnimg.2026.1753534},
pmid = {42146843},
pmcid = {PMC13175814}
}

RIS

TY - JOUR
AU - Ellis, David G.
AU - Aizenberg, Michele R.
TI - Anatomically constrained volumetric smoothing enhances fMRI reliability while avoiding smoothing artifacts
T2 - Frontiers in neuroimaging
J2 - Front Neuroimaging
PY - 2026
DA - 2026/05/01
VL - 5
SP - 1753534
SN - 2813-1193
PB - Frontiers Media SA
DO - 10.3389/fnimg.2026.1753534
UR - https://doi.org/10.3389/fnimg.2026.1753534
LA - en
ER -

CSL-JSON

{
"id": "10.3389/fnimg.2026.1753534",
"type": "article-journal",
"title": "Anatomically constrained volumetric smoothing enhances fMRI reliability while avoiding smoothing artifacts",
"container-title": "Frontiers in neuroimaging",
"author": [
{
"family": "Ellis",
"given": "David G."
},
{
"family": "Aizenberg",
"given": "Michele R."
}
],
"container-title-short": "Front Neuroimaging",
"volume": "5",
"page": "1753534",
"DOI": "10.3389/fnimg.2026.1753534",
"PMID": "42146843",
"PMCID": "PMC13175814",
"ISSN": "2813-1193",
"publisher": "Frontiers Media SA",
"URL": "https://doi.org/10.3389/fnimg.2026.1753534",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
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.1162/imag.a.1198 [code]
MEPrep: A robust pipeline for multi-echo fMRI denoising and preprocessing.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: TemplateFlow, Nilearn, NiBabel, 2 other tools, fMRI, methods / tools, 5 references
[2] doi:10.1002/hbm.70469 [code]
VarCoNet: A Variability-Aware Self-Supervised Framework for Functional Connectome Extraction From Resting-State fMRI.
Journal: Human brain mapping
In common: TemplateFlow, Nilearn, NetworkX, 3 other tools, fMRI, methods / tools, 2 references
[3] doi:10.1002/hbm.70483 [code]
Untamed: Unconstrained Tensor Decomposition and Graph Node Embedding for Cortical Parcellation.
Journal: Human brain mapping
In common: Nilearn, NiBabel, SciPy, 1 other tool, fMRI, methods / tools, 4 references
[4] doi:10.1016/j.neuron.2026.04.011 [code]
Precision fMRI reveals densely interdigitated network patches with conserved motifs in the lateral prefrontal cortex.
Journal: Neuron
In common: Nilearn, NiBabel, SciPy, 1 other tool, fMRI, 5 references
[5] doi:10.1038/s41398-026-04157-5 [code]
Association of glymphatic function with 40-Hz neural oscillations, systemic metabolic markers, and cognitive performance in healthy aging adults: An EEG and MRI study.
Journal: Translational psychiatry
In common: TemplateFlow, Nilearn, NetworkX, 3 other tools, fMRI
[6] doi:10.1371/journal.pbio.3003856 [code]
Aging and metabolism contribute separately to brain-body health.
Journal: PLoS biology
In common: Nilearn, NiBabel, SciPy, 1 other tool, 4 references
[7] doi:10.1371/journal.pbio.3003684 [code]
The retrieval of previously learned motor memories is facilitated by the reinstatement of default mode network manifold structures.
Journal: PLoS biology
In common: Nilearn, NiBabel, SciPy, 1 other tool, fMRI, 4 references
[8] doi:10.1038/s41467-026-71270-w [code]
Spatiotemporal dynamics of the human cortical functional hierarchy across the lifespan.
Journal: Nature communications
In common: Nilearn, NetworkX, NiBabel, 2 other tools, fMRI, 2 references
[9] doi:10.1038/s41467-026-75959-w [code]
Charting higher-order models of brain function beyond pairwise interactions.
Journal: Nature communications
In common: Nilearn, NetworkX, NiBabel, 2 other tools, 3 references
[10] doi:10.1162/netn.a.549 [code]
Distributed cortical network dynamics of binocular convergent eye movements in humans.
Journal: Network neuroscience (Cambridge, Mass.)
In common: NiBabel, NumPy, fMRI, 5 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.