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.

2 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.

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

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 (how the code is found and 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.1038/s42003-025-09371-3 [code]
Multi-contrast generation and quantitative MRI using a transformer-based framework with RF excitation embeddings.
Journal: Communications biology
In common: pydicom, PyTorch, SciPy, 2 other tools, 2 references
[2] doi:10.1002/mrm.70050 [code]
Motion-robust $$ {\mathrm{T}}_2^{\ast } $$ quantification from low-resolution gradient echo brain MRI with physics-informed deep learning.
Journal: Magnetic resonance in medicine
In common: h5py, NiBabel, PyTorch, 3 other tools, computational, 1 reference
[3] 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
[4] doi:10.3389/fnins.2023.1165446 [code]
Quantitative susceptibility mapping using multi-channel convolutional neural networks with dipole-adaptive multi-frequency inputs.
Journal: Frontiers in neuroscience
In common: pydicom, h5py, NiBabel, 3 other tools, 1 reference
[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.1162/imag_a_00374 [code]
FONDUE: Robust resolution-invariant denoising of MR images using Nested UNets.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: h5py, NiBabel, PyTorch, 3 other tools, 1 reference
[7] doi:10.1126/sciadv.adi9327 [code]
Deep learning enabled fast 3D brain MRI at 0.055 tesla.
Journal: Science advances
In common: h5py, NiBabel, PyTorch, 3 other tools, 1 reference
[8] 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
[9] doi:10.1016/j.neuroimage.2024.120794
Quantitative gradient recalled echo (qGRE) MRI enables in vivo measurement of pre-atrophic neurodegeneration in a mouse model of Alzheimer's disease.
Journal: NeuroImage
In common: 4 references
[10] 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 medicine
In common: h5py, PyTorch, SciPy, 2 other tools, computational, 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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/doi/10.1002/mrm.70405.svg)](https://openscicode.org/badge/doi/10.1002/mrm.70405)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1002/mrm.70405.svg
   :target: https://openscicode.org/badge/doi/10.1002/mrm.70405
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1002/mrm.70405"><img src="https://openscicode.org/badge/doi/10.1002/mrm.70405.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.