OSCR

Predicting categorical and continuous Alzheimer's disease outcomes from a single MRI scan.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 201 lines · 6.4 KB · MIT

  1. '''
  2. Dataset for training
  3. Written by Whalechen
  4. '''
  5. import math
  6. import os
  7. import random
  8. import numpy as np
  9. from torch.utils.data import Dataset
  10. import nibabel
  11. from scipy import ndimage
  12. class BrainS18Dataset(Dataset):
  13. def __init__(self, root_dir, img_list, sets):
  14. with open(img_list, 'r') as f:
  15. self.img_list = [line.strip() for line in f]
  16. print("Processing {} datas".format(len(self.img_list)))
  17. self.root_dir = root_dir
  18. self.input_D = sets.input_D
  19. self.input_H = sets.input_H
  20. self.input_W = sets.input_W
  21. self.phase = sets.phase
  22. def __nii2tensorarray__(self, data):
  23. [z, y, x] = data.shape
  24. new_data = np.reshape(data, [1, z, y, x])
  25. new_data = new_data.astype("float32")
  26. return new_data
  27. def __len__(self):
  28. return len(self.img_list)
  29. def __getitem__(self, idx):
  30. if self.phase == "train":
  31. # read image and labels
  32. ith_info = self.img_list[idx].split(" ")
  33. img_name = os.path.join(self.root_dir, ith_info[0])
  34. label_name = os.path.join(self.root_dir, ith_info[1])
  35. assert os.path.isfile(img_name)
  36. assert os.path.isfile(label_name)
  37. img = nibabel.load(img_name) # We have transposed the data from WHD format to DHW
  38. assert img is not None
  39. mask = nibabel.load(label_name)
  40. assert mask is not None
  41. # data processing
  42. img_array, mask_array = self.__training_data_process__(img, mask)
  43. # 2 tensor array
  44. img_array = self.__nii2tensorarray__(img_array)
  45. mask_array = self.__nii2tensorarray__(mask_array)
  46. assert img_array.shape == mask_array.shape, "img shape:{} is not equal to mask shape:{}".format(img_array.shape, mask_array.shape)
  47. return img_array, mask_array
  48. elif self.phase == "test":
  49. # read image
  50. ith_info = self.img_list[idx].split(" ")
  51. img_name = os.path.join(self.root_dir, ith_info[0])
  52. print(img_name)
  53. assert os.path.isfile(img_name)
  54. img = nibabel.load(img_name)
  55. assert img is not None
  56. # data processing
  57. img_array = self.__testing_data_process__(img)
  58. # 2 tensor array
  59. img_array = self.__nii2tensorarray__(img_array)
  60. return img_array
  61. def __drop_invalid_range__(self, volume, label=None):
  62. """
  63. Cut off the invalid area
  64. """
  65. zero_value = volume[0, 0, 0]
  66. non_zeros_idx = np.where(volume != zero_value)
  67. [max_z, max_h, max_w] = np.max(np.array(non_zeros_idx), axis=1)
  68. [min_z, min_h, min_w] = np.min(np.array(non_zeros_idx), axis=1)
  69. if label is not None:
  70. return volume[min_z:max_z, min_h:max_h, min_w:max_w], label[min_z:max_z, min_h:max_h, min_w:max_w]
  71. else:
  72. return volume[min_z:max_z, min_h:max_h, min_w:max_w]
  73. def __random_center_crop__(self, data, label):
  74. from random import random
  75. """
  76. Random crop
  77. """
  78. target_indexs = np.where(label>0)
  79. [img_d, img_h, img_w] = data.shape
  80. [max_D, max_H, max_W] = np.max(np.array(target_indexs), axis=1)
  81. [min_D, min_H, min_W] = np.min(np.array(target_indexs), axis=1)
  82. [target_depth, target_height, target_width] = np.array([max_D, max_H, max_W]) - np.array([min_D, min_H, min_W])
  83. Z_min = int((min_D - target_depth*1.0/2) * random())
  84. Y_min = int((min_H - target_height*1.0/2) * random())
  85. X_min = int((min_W - target_width*1.0/2) * random())
  86. Z_max = int(img_d - ((img_d - (max_D + target_depth*1.0/2)) * random()))
  87. Y_max = int(img_h - ((img_h - (max_H + target_height*1.0/2)) * random()))
  88. X_max = int(img_w - ((img_w - (max_W + target_width*1.0/2)) * random()))
  89. Z_min = np.max([0, Z_min])
  90. Y_min = np.max([0, Y_min])
  91. X_min = np.max([0, X_min])
  92. Z_max = np.min([img_d, Z_max])
  93. Y_max = np.min([img_h, Y_max])
  94. X_max = np.min([img_w, X_max])
  95. Z_min = int(Z_min)
  96. Y_min = int(Y_min)
  97. X_min = int(X_min)
  98. Z_max = int(Z_max)
  99. Y_max = int(Y_max)
  100. X_max = int(X_max)
  101. return data[Z_min: Z_max, Y_min: Y_max, X_min: X_max], label[Z_min: Z_max, Y_min: Y_max, X_min: X_max]
  102. def __itensity_normalize_one_volume__(self, volume):
  103. """
  104. normalize the itensity of an nd volume based on the mean and std of nonzeor region
  105. inputs:
  106. volume: the input nd volume
  107. outputs:
  108. out: the normalized nd volume
  109. """
  110. pixels = volume[volume > 0]
  111. mean = pixels.mean()
  112. std = pixels.std()
  113. out = (volume - mean)/std
  114. out_random = np.random.normal(0, 1, size = volume.shape)
  115. out[volume == 0] = out_random[volume == 0]
  116. return out
  117. def __resize_data__(self, data):
  118. """
  119. Resize the data to the input size
  120. """
  121. [depth, height, width] = data.shape
  122. scale = [self.input_D*1.0/depth, self.input_H*1.0/height, self.input_W*1.0/width]
  123. data = ndimage.interpolation.zoom(data, scale, order=0)
  124. return data
  125. def __crop_data__(self, data, label):
  126. """
  127. Random crop with different methods:
  128. """
  129. # random center crop
  130. data, label = self.__random_center_crop__ (data, label)
  131. return data, label
  132. def __training_data_process__(self, data, label):
  133. # crop data according net input size
  134. data = data.get_data()
  135. label = label.get_data()
  136. # drop out the invalid range
  137. data, label = self.__drop_invalid_range__(data, label)
  138. # crop data
  139. data, label = self.__crop_data__(data, label)
  140. # resize data
  141. data = self.__resize_data__(data)
  142. label = self.__resize_data__(label)
  143. # normalization datas
  144. data = self.__itensity_normalize_one_volume__(data)
  145. return data, label
  146. def __testing_data_process__(self, data):
  147. # crop data according net input size
  148. data = data.get_data()
  149. # resize data
  150. data = self.__resize_data__(data)
  151. # normalization datas
  152. data = self.__itensity_normalize_one_volume__(data)
  153. return data

brains18.py at commit 20f76aa, under MIT · at the source

Overview

Authors: Daren Ma1, Christabelle Pabalan2, Abhejit Rajagopal1, Akanksha Akanksha2, Yannet Interian2, Yang Yang1, Ashish Raj1,3
  1. Department of Radiology and Biomedical Imaging, University of California San Francisco,San Francisco, CA USA
  2. Data Institute, University of San Francisco,San Francsico, CA USA
  3. Bakar Computational Health Sciences Institute, University of California San Francisco,San Francisco, USA
Institutions: University of California, San Francisco (United States); University of San Francisco (United States)
Journal: Nature aging, volume 6, issue 5, pages 1121-1137
Dates: received 4 September 2024; accepted 1 April 2026; published online 18 May 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s43587-026-01121-2 · PMID 42151377 · PMCID PMC13190282 · OpenAlex W7161568978
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), Alzheimer's / dementia (population), clinical / translational (subfield)
Methods: Connectivity, Statistics, Smoothing, state filtering, decompositions, Machine learning, Preprocessing, fMRI & imaging
Keywords: Alzheimer's disease, Cognitive ageing
MeSH: Alzheimer Disease*, Deep Learning*, Magnetic Resonance Imaging*, Brain, Cognition, Female, Humans, Neuroimaging, Prediction Algorithms, Predictive Learning Models, Prognosis (* major topic)
Topic: Dementia and Cognitive Impairment Research (Psychiatry and Mental health, Medicine), according to OpenAlex
Funding: National Institute on Aging (R21AG087921, RF1AG087302)
Citations: cited by 2 papers (Europe PMC); 90 references in the paper

Abstract

Deep learning (DL) has shown success in predicting Alzheimer’s disease (AD) diagnosis, yet continuous measures such as cognitive assessment remain critical for richer prognosis, trajectory tracking and clinical trial enrichment. Current neurocognitive batteries are time-consuming, and the few DL models predicting cognition require expensive multimodal neuroimaging and longitudinal data. Although magnetic resonance imaging (MRI) is the most clinically accessible modality, on its own it struggles to capture AD heterogeneity in modern DL frameworks. We propose a multitask DL strategy integrating domain knowledge with large pretrained models to predict cognitive scores using only baseline MRI and demographics. By customizing loss functions and leveraging tissue segmentation-tuned latent representations as regularization features, our approach bypasses the need for longitudinal, multimodal or specialized neuroimaging data. This knowledge-informed multitask framework produces accurate diagnosis, segmentation and both current and future cognitive scores from a single baseline scan, with broad implications for early diagnosis, prognosis and clinical trial design.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repositories

Its files are read in the Code ↔ Paper reader above.

Tencent/MedicalNet

License: MIT
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 20f76aaab5cac8056eaf50b79ed97c09dbfbd3bd, 27 November 2025
Languages: Python (9)
Size: 23 files, 9 scripts
Software Heritage: not archived
Found in: the text, “Image model architecture 2: MedicalNet”
Holds: README, license file, environment (requirements.txt), continuous integration
Not found: CITATION.cff, tests, documentation
Tools: PyTorch (5 files), NumPy (3 files), SciPy (3 files), NiBabel (2 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
11 files

darenma/MultitaskCognition

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: a65cbf6f2cdb817c25dbe4de05da158ec87469d7, 18 March 2026
Languages: Jupyter (11), Python (3)
Size: 26 files, 14 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, 10 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
1 file
  • 01-datasets.ipynb, Jupyter, 134 lines
  • repository limit reached (2,000 files or 30 MB): the rest is at the source (14 files)

Code availability

Code for the analyses are available via GitHub at https://github.com/darenma/MultitaskCognition. All analyses were implemented using Python v.3.10. Python dependencies are included in the repository.

Reproduced under the paper's license (CC BY), from the paper cited above.

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:

  • 2 repositories 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;
  • no match between paragraphs and code yet;
  • 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

Datasets cited

Data availability

The public datasets in this study are available from ADNI (https://adni.loni.usc.edu/), HCP–YA (https://www.humanconnectome.org/study/hcp-young-adult) and DLBS (https://openneuro.org/datasets/ds004856/versions/1.2.0). All other data 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 2, 28 September 2026

  • Publisher: n/a → Nature Portfolio

Version 1, 28 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 2 keywords, 11 MeSH terms, 1 funder, 75 references.

Cite

This paper

Ma, D., Pabalan, C., Rajagopal, A., Akanksha, A., Interian, Y., Yang, Y., & Raj, A. (2026). Predicting categorical and continuous Alzheimer's disease outcomes from a single MRI scan. Nature aging, 6(5), 1121-1137. https://doi.org/10.1038/s43587-026-01121-2

BibTeX

@article{ma2026predicting,
author = {Ma, Daren and Pabalan, Christabelle and Rajagopal, Abhejit and Akanksha, Akanksha and Interian, Yannet and Yang, Yang and Raj, Ashish},
title = {{Predicting categorical and continuous Alzheimer's disease outcomes from a single MRI scan}},
journal = {Nature aging},
year = {2026},
month = may,
volume = {6},
number = {5},
pages = {1121--1137},
publisher = {Nature Portfolio},
issn = {2662-8465},
doi = {10.1038/s43587-026-01121-2},
url = {https://doi.org/10.1038/s43587-026-01121-2},
pmid = {42151377},
pmcid = {PMC13190282}
}

RIS

TY - JOUR
AU - Ma, Daren
AU - Pabalan, Christabelle
AU - Rajagopal, Abhejit
AU - Akanksha, Akanksha
AU - Interian, Yannet
AU - Yang, Yang
AU - Raj, Ashish
TI - Predicting categorical and continuous Alzheimer's disease outcomes from a single MRI scan
T2 - Nature aging
J2 - Nat Aging
PY - 2026
DA - 2026/05/18
VL - 6
IS - 5
SP - 1121
EP - 1137
SN - 2662-8465
PB - Nature Portfolio
DO - 10.1038/s43587-026-01121-2
UR - https://doi.org/10.1038/s43587-026-01121-2
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s43587-026-01121-2",
"type": "article-journal",
"title": "Predicting categorical and continuous Alzheimer's disease outcomes from a single MRI scan",
"container-title": "Nature aging",
"author": [
{
"family": "Ma",
"given": "Daren"
},
{
"family": "Pabalan",
"given": "Christabelle"
},
{
"family": "Rajagopal",
"given": "Abhejit"
},
{
"family": "Akanksha",
"given": "Akanksha"
},
{
"family": "Interian",
"given": "Yannet"
},
{
"family": "Yang",
"given": "Yang"
},
{
"family": "Raj",
"given": "Ashish"
}
],
"container-title-short": "Nat Aging",
"volume": "6",
"issue": "5",
"page": "1121-1137",
"DOI": "10.1038/s43587-026-01121-2",
"PMID": "42151377",
"PMCID": "PMC13190282",
"ISSN": "2662-8465",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s43587-026-01121-2",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
18
]
]
}
}

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/s41586-026-10454-2 [code]
White matter micro- and macrostructure brain charts for the human lifespan.
Journal: Nature
In common: SciPy, NumPy, OpenNeuro ds004856, humanconnectome.org/study/hcp-young-adult, 1 reference
[2] doi:10.1162/imag.a.1338 [code]
Systematic fMRI signal differences across cohorts alter lifespan trajectories of functional brain networks.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: NumPy, OpenNeuro ds004856, humanconnectome.org/study/hcp-young-adult, 1 reference
[3] doi:10.1038/s41398-026-04426-3 [code]
Resting-state brain age is associated with cognitive and sensorimotor abnormalities in schizophrenia spectrum disorders: a validation & longitudinal study.
Journal: Translational psychiatry
In common: NiBabel, NumPy, OpenNeuro ds004856, structural MRI / diffusion, 2 references
[4] doi:10.1002/dad2.70360 [code]
Investigating the amyloid-tau-neurodegeneration framework in Alzheimer's disease using semi-supervised multimodal imaging data fusion.
Journal: Alzheimer's & dementia (Amsterdam, Netherlands)
In common: NiBabel, PyTorch, SciPy, 1 other tool, Alzheimer's / dementia, 3 references
[5] doi:10.1186/s40708-026-00316-y [code]
Generalizable and explainable deep learning for brain MRI: a multi-cohort evaluation of 3D architectures for age and sex prediction.
Journal: Brain informatics
In common: PyTorch, SciPy, NumPy, OpenNeuro ds004856, structural MRI / diffusion, 1 reference
[6] doi:10.1002/nbm.70277 [code]
Hierarchical Bayesian Modelling Improves Microstructural Parameter Mapping in Diffusion and Exchange MRI Data.
Journal: NMR in biomedicine
In common: NiBabel, SciPy, NumPy, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion, 2 references
[7] doi:10.1002/hbm.70483 [code]
Untamed: Unconstrained Tensor Decomposition and Graph Node Embedding for Cortical Parcellation.
Journal: Human brain mapping
In common: NiBabel, PyTorch, SciPy, 1 other tool, humanconnectome.org/study/hcp-young-adult, 1 reference
[8] doi:10.21203/rs.3.rs-9326213/v1 [code]
Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brain
Journal: Research Square (preprint)
In common: NiBabel, PyTorch, SciPy, 1 other tool, humanconnectome.org/study/hcp-young-adult, 1 reference
[9] doi:10.64898/2026.03.09.710558 [code]
Multi-task fMRI outperforms resting-state fMRI for revealing task-invariant organization of the human brain
Journal: bioRxiv (preprint)
In common: NiBabel, PyTorch, SciPy, 1 other tool, humanconnectome.org/study/hcp-young-adult, 1 reference
[10] doi:10.1016/j.isci.2026.116671 [code]
A high-resolution functional network-organized atlas of human superficial white matter from ultra-high-field diffusion MRI.
Journal: iScience
In common: NiBabel, PyTorch, SciPy, 1 other tool, humanconnectome.org/study/hcp-young-adult, structural MRI / diffusion

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.