OSCR

DeepRelaxo: Fast Mono-Exponential Magnitude Brain R2* Mapping With Reduced Echoes Using Self-Supervised Deep Learning.

Code ↔ Paper

2 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 2 matches
  1. [1] § Methods › DeepRelaxo Cascaded Neural Networks › DeepRelaxo Denoiser (3D U‐Net) ↔ bet2_utils.py, lines 1–32 · score 0.56 · FSL, brain mask, background, module, reconstructed, magnitudes
  2. [2] § Methods › DeepRelaxo Cascaded Neural Networks › DeepRelaxo Estimator (Transformer‐MLP) ↔ transformer_mlp_model.py, lines 83–133 · score 0.54 · padding mask, tokens, zero, model, batch, MLP

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 · 84 lines · 3.3 KB · MIT · 1 match

  1. """
  2. Automatic brain-mask generation via FSL's bet2, vendored at vendor/bet2/ (bin + its ~15
  3. runtime shared libraries -- see vendor/bet2/README.md for provenance/license). Not a full
  4. FSL install.
  5. Used by run.py / app.py when no --mask / uploaded mask is supplied: bet2 runs on the
  6. magnitude volume to generate one automatically, so a brain mask is available by default
  7. without requiring a separate manual step. A missing/failing bet2 never aborts
  8. reconstruction -- callers fall back to whole-head (no mask) instead.
  9. Uses print() rather than the `logging` module so messages appear in app.py's live Log
  10. panel too (its background inference thread redirects sys.stdout, not the logging module).
  11. """
  12. import os
  13. import subprocess
  14. import traceback
  15. from pathlib import Path
  16. from time import perf_counter
  17. import nibabel as nib
  18. import numpy as np
  19. REPO_ROOT = Path(__file__).resolve().parent
  20. _BET2_CANDIDATES = [
  21. os.environ.get("BET2_DIR"),
  22. "/opt/bet2", # Docker image, if built that way
  23. str(REPO_ROOT / "vendor" / "bet2"), # local checkout (this repo's own copy)
  24. ]
  25. BET2_DIR = next((p for p in _BET2_CANDIDATES
  26. if p and os.path.isfile(os.path.join(p, "bin", "bet2"))), None)
  27. def first_3d_volume(nii_path, output_dir, name="mag_for_bet2"):
  28. """bet2 needs a plain 3D volume. Returns nii_path unchanged if it's already 3D,
  29. otherwise saves and returns the path to its first volume along the last axis."""
  30. img = nib.load(str(nii_path))
  31. if len(img.shape) == 3:
  32. return str(nii_path)
  33. data = np.asarray(img.dataobj)[..., 0].astype(np.float32)
  34. out_path = os.path.join(output_dir, f"{name}.nii.gz")
  35. nib.save(nib.Nifti1Image(data, img.affine), out_path)
  36. return out_path
  37. def run_bet2(mag_nii_path, output_dir, fractional_intensity=0.5):
  38. """Run bet2 on a (3D) magnitude volume, returning the path to the binary brain
  39. mask NIfTI, or None if bet2 isn't available or the run fails."""
  40. if BET2_DIR is None:
  41. print("bet2 not found (checked $BET2_DIR, /opt/bet2, ./vendor/bet2) -- "
  42. "skipping automatic brain extraction")
  43. return None
  44. bet2Bin = os.path.join(BET2_DIR, "bin", "bet2")
  45. outPrefix = os.path.join(output_dir, "bet2_out")
  46. env = dict(os.environ)
  47. env["LD_LIBRARY_PATH"] = os.path.join(BET2_DIR, "lib")
  48. env.setdefault("FSLOUTPUTTYPE", "NIFTI_GZ")
  49. tic = perf_counter()
  50. try:
  51. result = subprocess.run(
  52. [bet2Bin, mag_nii_path, outPrefix, "-m", "-f", str(fractional_intensity)],
  53. env=env, capture_output=True, text=True, timeout=120,
  54. )
  55. except Exception:
  56. print(f"bet2 failed to run -- skipping brain extraction:\n{traceback.format_exc()}")
  57. return None
  58. if result.returncode != 0:
  59. print(f"bet2 exited with code {result.returncode} -- skipping brain extraction. "
  60. f"stdout={result.stdout} stderr={result.stderr}")
  61. return None
  62. maskPath = outPrefix + "_mask.nii.gz"
  63. if not os.path.exists(maskPath):
  64. print(f"bet2 completed but mask file not found at {maskPath} -- skipping brain extraction")
  65. return None
  66. mask = nib.load(maskPath).get_fdata()
  67. print(f"bet2 brain extraction completed in {perf_counter() - tic:.1f}s -> "
  68. f"{Path(maskPath).name} ({100.0 * mask.sum() / mask.size:.1f}% of voxels)")
  69. return maskPath

bet2_utils.py at commit ced5d70, under MIT · at the source

Overview

Authors: Samiha Prima1, Zhuang Xiong2, Alan H Wilman3, Hongfu Sun4
  1. School of Electrical Engineering and Computer Science, University of Queensland, Brisbane, Queensland, Australia
  2. Image X Institute, Sydney School of Health Sciences, University of Sydney, Sydney, New South Wales, Australia
  3. Department of Biomedical Engineering, University of Alberta, Edmonton, Alberta, Canada
  4. School of Engineering, University of Newcastle, Newcastle, New South Wales, Australia
Journal: Magnetic resonance in medicine, volume 96, issue 3, pages 1293-1302
Dates: received 4 September 2025; accepted 14 April 2026; published online 26 April 2026; in print September 2026
Type: Other · Language: English
License: CC BY
Identifiers: DOI 10.1002/mrm.70405 · PMID 42036809 · PMCID PMC13327502 · OpenAlex W7155689185
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: human (organism), computational (subfield)
Methods: Connectivity, fMRI & imaging, Statistics, Machine learning
Keywords: deep learning, DeepRelaxo, Echo reduction, multi‐echo gradient echo (ME‐GRE), R2* mapping, transformer
MeSH: Brain*, Brain Mapping*, Deep Learning*, Image Processing, Computer-Assisted*, Magnetic Resonance Imaging*, Supervised Machine Learning*, Algorithms, Computer Simulation, Humans, Signal-To-Noise Ratio (* major topic)
Topic: Functional Brain Connectivity Studies (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Health and Medical Research Council (2030157); Australian Research Council (DE210101297, DP230101628)
Citations: not cited yet (Europe PMC); 32 references in the paper

Abstract

Purpose: We introduce DeepRelaxo, a fast and generalizable deep learning method for estimating brain R2* maps from multi‐echo gradient echo (ME‐GRE) acquisitions with arbitrary echo configurations, including shortened echo trains for accelerated scans.

Methods: DeepRelaxo is a cascaded two‐stage self‐supervised network comprising: (1) a voxel‐wise Transformer‐MLP for initial R2* estimation, and (2) a patch‐based 3D U‐Net for denoising. Both stages are trained entirely on synthetic ME‐GRE data simulated at 3 T with a varied number of echoes, echo times, and noise levels. We evaluate on simulated and in vivo brain datasets, comparing it against conventional non‐linear least squares (NLLS) and the standalone Transformer‐MLP. Experiments assess robustness under increased noise and shortened TEs.

Results: In simulations, DeepRelaxo consistently outperforms NLLS and Transformer‐MLP, particularly in accelerated conditions. For example, with 4× scan time reduction at low SNR (= 10), DeepRelaxo improves SSIM by 13.5% and reduces RMSE by 76% compared with baseline methods. In in vivo 3 T and 7 T data, DeepRelaxo produces consistent R2* values in deep gray matter and preserves anatomical detail, even with only two short echoes.

Conclusion: DeepRelaxo effectively models ME‐GRE decay, leveraging temporal and spatial context to deliver accurate, robust, and computationally efficient R2* mapping. It enables reliable reconstruction under accelerated protocols, making it suitable for time‐sensitive workflows.

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

sunhongfu/DeepRelaxo

License: MIT
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: ced5d70250ad68829c5b7c4dff6e23e54fbf0660, 6 August 2026
Languages: Python (10)
Size: 37 files, 10 scripts
Software Heritage: not archived
Found in: “Data Availability Statement”
Holds: README, license file, environment (Dockerfile, requirements-webapp.txt, requirements.txt)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NiBabel (7 files), NumPy (7 files), PyTorch (7 files), pydicom (2 files), h5py (1 file), Matplotlib (1 file), SciPy (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
12 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;
  • 10 scripts, each with its path and the digest of its content;
  • 2 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 data that support the findings of this study are available on request from the corresponding author. The data are not publicly available due to privacy or ethical restrictions. Codes are available at: https://github.com/sunhongfu/DeepRelaxo.

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

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 6 keywords, 10 MeSH terms, 2 funders, 28 references.

Cite

This paper

Prima, S., Xiong, Z., Wilman, A. H., & Sun, H. (2026). DeepRelaxo: Fast Mono-Exponential Magnitude Brain R2* Mapping With Reduced Echoes Using Self-Supervised Deep Learning. Magnetic resonance in medicine, 96(3), 1293-1302. https://doi.org/10.1002/mrm.70405

BibTeX

@article{prima2026deeprelaxo,
author = {Prima, Samiha and Xiong, Zhuang and Wilman, Alan H and Sun, Hongfu},
title = {{DeepRelaxo: Fast Mono-Exponential Magnitude Brain R2* Mapping With Reduced Echoes Using Self-Supervised Deep Learning}},
journal = {Magnetic resonance in medicine},
year = {2026},
month = apr,
volume = {96},
number = {3},
pages = {1293--1302},
publisher = {Wiley},
issn = {0740-3194},
doi = {10.1002/mrm.70405},
url = {https://doi.org/10.1002/mrm.70405},
pmid = {42036809},
pmcid = {PMC13327502}
}

RIS

TY - JOUR
AU - Prima, Samiha
AU - Xiong, Zhuang
AU - Wilman, Alan H
AU - Sun, Hongfu
TI - DeepRelaxo: Fast Mono-Exponential Magnitude Brain R2* Mapping With Reduced Echoes Using Self-Supervised Deep Learning
T2 - Magnetic resonance in medicine
J2 - Magn Reson Med
PY - 2026
DA - 2026/04/26
VL - 96
IS - 3
SP - 1293
EP - 1302
SN - 0740-3194
PB - Wiley
DO - 10.1002/mrm.70405
UR - https://doi.org/10.1002/mrm.70405
LA - en
ER -

CSL-JSON

{
"id": "10.1002/mrm.70405",
"type": "article-journal",
"title": "DeepRelaxo: Fast Mono-Exponential Magnitude Brain R2* Mapping With Reduced Echoes Using Self-Supervised Deep Learning",
"container-title": "Magnetic resonance in medicine",
"author": [
{
"family": "Prima",
"given": "Samiha"
},
{
"family": "Xiong",
"given": "Zhuang"
},
{
"family": "Wilman",
"given": "Alan H"
},
{
"family": "Sun",
"given": "Hongfu"
}
],
"container-title-short": "Magn Reson Med",
"volume": "96",
"issue": "3",
"page": "1293-1302",
"DOI": "10.1002/mrm.70405",
"PMID": "42036809",
"PMCID": "PMC13327502",
"ISSN": "0740-3194",
"publisher": "Wiley",
"URL": "https://doi.org/10.1002/mrm.70405",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
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.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: NiBabel, SciPy, Matplotlib, 1 other tool, computational, 3 references
[2] doi:10.1002/mrm.70496 [code]
A Deep Nonlinear Subspace Modeling and Reconstruction for Diffusion-Weighted Imaging Using Denoising Auto-Encoder.
Journal: Magnetic resonance in medicine
In common: pydicom, h5py, NiBabel, 4 other tools
[3] doi:10.1080/07853890.2026.2685416 [code]
Pulmonary and cerebral damage in COVID-19 survivors: is there any association?
Journal: Annals of medicine
In common: pydicom, h5py, NiBabel, 4 other tools
[4] doi:10.3389/frai.2026.1771088 [code]
Few-shot deployment of pretrained MRI transformers in brain imaging tasks.
Journal: Frontiers in artificial intelligence
In common: pydicom, h5py, NiBabel, 4 other tools
[5] doi:10.1002/nbm.70349 [code]
Susceptibility Source Separation Unveils Paramagnetic and Diamagnetic Trajectories in Healthy Brains From 5 to 90 Years.
Journal: NMR in biomedicine
In common: h5py, PyTorch, SciPy, 2 other tools, 2 references
[6] doi:10.1002/mp.70599 [code]
Accurate estimation of intravoxel incoherent motion parameters based on implicit neural representation.
Journal: Medical physics
In common: pydicom, NiBabel, PyTorch, 2 other tools, 1 reference
[7] doi:10.1002/hbm.70602 [code]
Neuroimaging Correlates of Post-Stroke Pain After Ischemic Stroke: Secondary Analysis of the INSPiRE-TMS Trial.
Journal: Human brain mapping
In common: pydicom, h5py, NiBabel, 3 other tools
[8] doi:10.1038/s41586-026-10631-3 [code]
A prognostic human brain network for diffuse midline glioma.
Journal: Nature
In common: pydicom, h5py, NiBabel, 3 other tools
[9] doi:10.1111/ene.70678 [code]
Who Falls After a Stroke? Evidence From a Prospective Stroke Cohort.
Journal: European journal of neurology
In common: pydicom, h5py, NiBabel, 3 other tools
[10] doi:10.1016/j.celrep.2026.117404 [code]
Action and rest tremor map to distinct networks within the primary motor cortex.
Journal: Cell reports
In common: pydicom, h5py, NiBabel, 3 other tools

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.