OSCR

Neonatal brain-age models in full- and preterm infants.

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 · 134 lines · 5.3 KB · MIT

  1. """
  2. The confounds module contains code to handle and account for
  3. confounds in pattern analyses.
  4. """
  5. import numpy as np
  6. from sklearn.base import BaseEstimator, TransformerMixin
  7. class ConfoundRegressor(BaseEstimator, TransformerMixin):
  8. """ Fits a confound onto each feature in X and returns their residuals."""
  9. def __init__(self, confound, X, cross_validate=True, precise=False,
  10. stack_intercept=True):
  11. """ Regresses out a variable (confound) from each feature in X.
  12. Parameters
  13. ----------
  14. confound : numpy array
  15. Array of length (n_samples, n_confounds) to regress out of each
  16. feature; May have multiple columns for multiple confounds.
  17. X : numpy array
  18. Array of length (n_samples, n_features), from which the confound
  19. will be regressed. This is used to determine how the
  20. confound-models should be cross-validated (which is necessary
  21. to use in in scikit-learn Pipelines).
  22. cross_validate : bool
  23. Whether to cross-validate the confound-parameters (y~confound)
  24. estimated from the train-set to the test set (cross_validate=True)
  25. or whether to fit the confound regressor separately on the test-set
  26. (cross_validate=False). Setting this parameter to True is equivalent
  27. to "foldwise confound regression" (FwCR) as described in our paper
  28. (https://www.biorxiv.org/content/early/2018/03/28/290684). Setting
  29. this parameter to False, however, is NOT equivalent to "whole
  30. dataset confound regression" (WDCR) as it does not apply confound
  31. regression to the *full* dataset, but simply refits the confound
  32. model on the test-set. We recommend setting this parameter to True.
  33. precise: bool
  34. Transformer-objects in scikit-learn only allow to pass the data
  35. (X) and optionally the target (y) to the fit and transform methods.
  36. However, we need to index the confound accordingly as well. To do so,
  37. we compare the X during initialization (self.X) with the X passed to
  38. fit/transform. As such, we can infer which samples are passed to the
  39. methods and index the confound accordingly. When setting precise to
  40. True, the arrays are compared feature-wise, which is accurate, but
  41. relatively slow. When setting precise to False, it will infer the index
  42. by looking at the sum of all the features, which is less accurate, but much
  43. faster. For dense data, this should work just fine. Also, to aid the
  44. accuracy, we remove the features which are constant (0) across samples.
  45. stack_intercept : bool
  46. Whether to stack an intercept to the confound (default is True)
  47. Attributes
  48. ----------
  49. weights_ : numpy array
  50. Array with weights for the confound(s).
  51. """
  52. self.confound = confound
  53. self.cross_validate = cross_validate
  54. self.X = X
  55. self.precise = precise
  56. self.stack_intercept = stack_intercept
  57. self.weights_ = None
  58. self.nonzero_X_ = None
  59. def fit(self, X, y=None):
  60. """ Fits the confound-regressor to X.
  61. Parameters
  62. ----------
  63. X : numpy array
  64. An array of shape (n_samples, n_features), which should correspond
  65. to your train-set only!
  66. y : None
  67. Included for compatibility; does nothing.
  68. """
  69. if self.stack_intercept:
  70. icept = np.ones(self.confound.shape[0])
  71. self.confound = np.c_[icept, self.confound]
  72. # Find nonzero voxels (i.e., voxels which have not all zero
  73. # values across samples)
  74. if self.nonzero_X_ is None:
  75. self.nonzero_X_ = np.sum(self.X, axis=0) != 0
  76. self.X = self.X[:, self.nonzero_X_]
  77. X_nz = X[:, self.nonzero_X_]
  78. confound = self.confound
  79. if self.precise:
  80. tmp = np.in1d(self.X, X_nz).reshape(self.X.shape)
  81. fit_idx = tmp.sum(axis=1) == self.X.shape[1]
  82. else:
  83. fit_idx = np.in1d(self.X.sum(axis=1), X_nz.sum(axis=1))
  84. confound_fit = confound[fit_idx, :]
  85. # Vectorized implementation estimating weights for all features
  86. self.weights_ = np.linalg.lstsq(confound_fit, X_nz, rcond=None)[0]
  87. return self
  88. def transform(self, X):
  89. """ Regresses out confound from X.
  90. Parameters
  91. ----------
  92. X : numpy array
  93. An array of shape (n_samples, n_features), which should correspond
  94. to your train-set only!
  95. Returns
  96. -------
  97. X_new : ndarray
  98. ndarray with confound-regressed features
  99. """
  100. if not self.cross_validate:
  101. self.fit(X)
  102. X_nz = X[:, self.nonzero_X_]
  103. if self.precise:
  104. tmp = np.in1d(self.X, X_nz).reshape(self.X.shape)
  105. transform_idx = tmp.sum(axis=1) == self.X.shape[1]
  106. else:
  107. transform_idx = np.in1d(self.X.sum(axis=1), X_nz.sum(axis=1))
  108. confound_transform = self.confound[transform_idx]
  109. X_new = X - confound_transform.dot(self.weights_)
  110. X_corr = np.zeros_like(X)
  111. X_corr[:, self.nonzero_X_] = X_new
  112. return X_corr

confounds.py at commit dd19414, under MIT · at the source

Overview

Authors: Howard Chiu1, Adam C. Richie-Halford1,2, Molly F. Lazarus2,3, Ariel Rokem4,5, Rocio Velasco Poblaciones2, Virginia A. Marchman2,6, Katherine E. Travis2,3, Melissa L. Scala7, Heidi M. Feldman2, Jason D. Yeatman1,2,6
  1. Graduate School of Education, Stanford University, Stanford, CA, USA
  2. Division of Developmental Behavioral Pediatrics, Stanford University School of Medicine, Stanford, CA, USA
  3. Burke-Cornell Medical Research Institute, Department of Pediatrics, Weill Medical College, Cornell University, New York, NY, USA
  4. Department of Psychology, University of Washington, Seattle, WA, USA
  5. eScience Institute, University of Washington, Seattle, WA, USA
  6. Department of Psychology, Stanford University, Stanford, CA, USA
  7. Department of Pediatrics, Division of Neonatology, Stanford University, Stanford, CA, USA
Institutions: Stanford University (United States); Stanford Medicine (United States); Cornell University (United States); University of Washington (United States)
Journal: Developmental cognitive neuroscience, volume 80, article 101775
Dates: received 22 January 2026; accepted 1 July 2026; published online 4 July 2026; in print August 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1016/j.dcn.2026.101775 · PMID 42400972 · PMCID PMC13355775 · OpenAlex W7167273249
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), other condition (population), developmental (subfield)
Methods: Connectivity, Smoothing, state filtering, decompositions, Machine learning, Statistics, fMRI & imaging
Keywords: Prematurity, Brain development, White matter, Diffusion imaging, Tractometry, Brain-age, Neonatal
MeSH: Brain*, Infant, Premature*, White Matter*, Connectome, Diffusion Magnetic Resonance Imaging, Female, Gestational Age, Humans, Infant, Infant, Newborn, Male, Neurodevelopment (* major topic)
Topic: Neonatal and fetal brain pathology (Pediatrics, Perinatology and Child Health, Medicine), according to OpenAlex
Funding: Stanford Graduate Fellowship; U.S. Department of Health & Human Services | NIH | Eunice Kennedy Shriver National Institute of Child Health and Human Development (NICHD) (5R00-HD8474904, 2R01-HD069150, R01HD095861, R01HD116845, R01EB027585)
Citations: not cited yet (Europe PMC); 72 references in the paper
Research resources: RRID:SCR_001362, which is based on Nipype 1.9.1 RRID:SCR_002502

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

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

lukassnoek/mvca

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: dd194140a5babb4605b9248d34508b9d9e4f799c, 24 August 2018
Languages: Python (13), Jupyter (6)
Size: 95 files, 19 scripts
Software Heritage: not archived
Found in: the text, “Brain-age models”
Holds: README, license file, environment (requirements.txt), 6 notebooks
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (15 files), SciPy (12 files), scikit-learn (11 files), Matplotlib (8 files), pandas (7 files), seaborn (7 files), statsmodels (6 files), NiBabel (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
21 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;
  • 19 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

No dataset and no data link were found in the paper.

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • no repository, dataset or request procedure was recognized in it

Read it in the paper: doi.org/10.1016/j.dcn.2026.101775.

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, 10 authors, 7 keywords, 12 MeSH terms, 2 funders, 68 references, 2 RRIDs.

Cite

This paper

Chiu, H., Richie-Halford, A. C., Lazarus, M. F., Rokem, A., Poblaciones, R. V., Marchman, V. A., Travis, K. E., Scala, M. L., Feldman, H. M., & Yeatman, J. D. (2026). Neonatal brain-age models in full- and preterm infants. Developmental cognitive neuroscience, 80, 101775. https://doi.org/10.1016/j.dcn.2026.101775

BibTeX

@article{chiu2026neonatal,
author = {Chiu, Howard and Richie-Halford, Adam C. and Lazarus, Molly F. and Rokem, Ariel and Poblaciones, Rocio Velasco and Marchman, Virginia A. and Travis, Katherine E. and Scala, Melissa L. and Feldman, Heidi M. and Yeatman, Jason D.},
title = {{Neonatal brain-age models in full- and preterm infants}},
journal = {Developmental cognitive neuroscience},
year = {2026},
month = jul,
volume = {80},
pages = {101775},
publisher = {Elsevier},
issn = {1878-9293},
doi = {10.1016/j.dcn.2026.101775},
url = {https://doi.org/10.1016/j.dcn.2026.101775},
pmid = {42400972},
pmcid = {PMC13355775}
}

RIS

TY - JOUR
AU - Chiu, Howard
AU - Richie-Halford, Adam C.
AU - Lazarus, Molly F.
AU - Rokem, Ariel
AU - Poblaciones, Rocio Velasco
AU - Marchman, Virginia A.
AU - Travis, Katherine E.
AU - Scala, Melissa L.
AU - Feldman, Heidi M.
AU - Yeatman, Jason D.
TI - Neonatal brain-age models in full- and preterm infants
T2 - Developmental cognitive neuroscience
J2 - Dev Cogn Neurosci
PY - 2026
DA - 2026/07/04
VL - 80
SP - 101775
SN - 1878-9293
PB - Elsevier
DO - 10.1016/j.dcn.2026.101775
UR - https://doi.org/10.1016/j.dcn.2026.101775
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.dcn.2026.101775",
"type": "article-journal",
"title": "Neonatal brain-age models in full- and preterm infants",
"container-title": "Developmental cognitive neuroscience",
"author": [
{
"family": "Chiu",
"given": "Howard"
},
{
"family": "Richie-Halford",
"given": "Adam C."
},
{
"family": "Lazarus",
"given": "Molly F."
},
{
"family": "Rokem",
"given": "Ariel"
},
{
"family": "Poblaciones",
"given": "Rocio Velasco"
},
{
"family": "Marchman",
"given": "Virginia A."
},
{
"family": "Travis",
"given": "Katherine E."
},
{
"family": "Scala",
"given": "Melissa L."
},
{
"family": "Feldman",
"given": "Heidi M."
},
{
"family": "Yeatman",
"given": "Jason D."
}
],
"container-title-short": "Dev Cogn Neurosci",
"volume": "80",
"page": "101775",
"DOI": "10.1016/j.dcn.2026.101775",
"PMID": "42400972",
"PMCID": "PMC13355775",
"ISSN": "1878-9293",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.dcn.2026.101775",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
4
]
]
}
}

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/s41467-026-73366-9 [code]
Cortical and white matter myelination proceed in concert during early infancy.
Journal: Nature communications
In common: NiBabel, statsmodels, seaborn, 5 other tools, developmental, 9 references
[2] doi:10.7554/elife.103097 [code]
Canonical neurodevelopmental trajectories of structural and functional manifolds.
Journal: eLife
In common: NiBabel, statsmodels, scikit-learn, 3 other tools, developmental, structural MRI / diffusion, 8 references
[3] doi:10.1002/brb3.71515
Structural Connectivity of Functionally Defined Episodic Memory Networks: A Large-Scale Connectome-Behavior Study.
Journal: Brain and behavior
In common: structural MRI / diffusion, 12 references
[4] doi:10.1038/s41467-026-73072-6 [code]
Mapping the spatiotemporal continuum of structural connectivity development across the human connectome in youth.
Journal: Nature communications
In common: NiBabel, statsmodels, pandas, 1 other tool, developmental, structural MRI / diffusion, 8 references
[5] doi:10.1162/imag.a.1325 [code]
Decoding everyday levels of musical training from subcortical white-matter architecture.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: statsmodels, seaborn, pandas, 3 other tools, structural MRI / diffusion, 7 references
[6] doi:10.1038/s41467-026-71918-7 [code]
Developmental disinhibition gates language lateralization in childhood.
Journal: Nature communications
In common: NiBabel, seaborn, scikit-learn, 4 other tools, 6 references
[7] doi:10.1162/imag.a.1341 [code]
Massively parallelized brain tractography using compute clusters, supercomputers, and graphics processing units.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: NiBabel, pandas, SciPy, 2 other tools, structural MRI / diffusion, 6 references
[8] doi:10.1038/s41467-026-71428-6 [code]
Binding items to contexts through conjunctive neural representations with the method of loci.
Journal: Nature communications
In common: NiBabel, statsmodels, seaborn, 5 other tools, 5 references
[9] doi:10.1038/s41467-026-71555-0 [code]
A deep representation learning model to predict response to vagus nerve stimulation.
Journal: Nature communications
In common: NiBabel, seaborn, scikit-learn, 4 other tools, structural MRI / diffusion, 5 references
[10] doi:10.1016/j.dcn.2026.101703 [code]
Visual Word Form Area demonstrates individual and task-agnostic consistency but inter-individual variability.
Journal: Developmental cognitive neuroscience
In common: NiBabel, seaborn, pandas, 3 other tools, 1 reference, author Jason D. Yeatman

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.