Neonatal brain-age models in full- and preterm infants.
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 · 134 lines · 5.3 KB · MIT
- """
- The confounds module contains code to handle and account for
- confounds in pattern analyses.
- """
- import numpy as np
- from sklearn.base import BaseEstimator, TransformerMixin
- class ConfoundRegressor(BaseEstimator, TransformerMixin):
- """ Fits a confound onto each feature in X and returns their residuals."""
- def __init__(self, confound, X, cross_validate=True, precise=False,
- stack_intercept=True):
- """ Regresses out a variable (confound) from each feature in X.
- Parameters
- ----------
- confound : numpy array
- Array of length (n_samples, n_confounds) to regress out of each
- feature; May have multiple columns for multiple confounds.
- X : numpy array
- Array of length (n_samples, n_features), from which the confound
- will be regressed. This is used to determine how the
- confound-models should be cross-validated (which is necessary
- to use in in scikit-learn Pipelines).
- cross_validate : bool
- Whether to cross-validate the confound-parameters (y~confound)
- estimated from the train-set to the test set (cross_validate=True)
- or whether to fit the confound regressor separately on the test-set
- (cross_validate=False). Setting this parameter to True is equivalent
- to "foldwise confound regression" (FwCR) as described in our paper
- (https://www.biorxiv.org/content/early/2018/03/28/290684). Setting
- this parameter to False, however, is NOT equivalent to "whole
- dataset confound regression" (WDCR) as it does not apply confound
- regression to the *full* dataset, but simply refits the confound
- model on the test-set. We recommend setting this parameter to True.
- precise: bool
- Transformer-objects in scikit-learn only allow to pass the data
- (X) and optionally the target (y) to the fit and transform methods.
- However, we need to index the confound accordingly as well. To do so,
- we compare the X during initialization (self.X) with the X passed to
- fit/transform. As such, we can infer which samples are passed to the
- methods and index the confound accordingly. When setting precise to
- True, the arrays are compared feature-wise, which is accurate, but
- relatively slow. When setting precise to False, it will infer the index
- by looking at the sum of all the features, which is less accurate, but much
- faster. For dense data, this should work just fine. Also, to aid the
- accuracy, we remove the features which are constant (0) across samples.
- stack_intercept : bool
- Whether to stack an intercept to the confound (default is True)
- Attributes
- ----------
- weights_ : numpy array
- Array with weights for the confound(s).
- """
- self.confound = confound
- self.cross_validate = cross_validate
- self.X = X
- self.precise = precise
- self.stack_intercept = stack_intercept
- self.weights_ = None
- self.nonzero_X_ = None
- def fit(self, X, y=None):
- """ Fits the confound-regressor to X.
- Parameters
- ----------
- X : numpy array
- An array of shape (n_samples, n_features), which should correspond
- to your train-set only!
- y : None
- Included for compatibility; does nothing.
- """
- if self.stack_intercept:
- icept = np.ones(self.confound.shape[0])
- self.confound = np.c_[icept, self.confound]
- # Find nonzero voxels (i.e., voxels which have not all zero
- # values across samples)
- if self.nonzero_X_ is None:
- self.nonzero_X_ = np.sum(self.X, axis=0) != 0
- self.X = self.X[:, self.nonzero_X_]
- X_nz = X[:, self.nonzero_X_]
- confound = self.confound
- if self.precise:
- tmp = np.in1d(self.X, X_nz).reshape(self.X.shape)
- fit_idx = tmp.sum(axis=1) == self.X.shape[1]
- else:
- fit_idx = np.in1d(self.X.sum(axis=1), X_nz.sum(axis=1))
- confound_fit = confound[fit_idx, :]
- # Vectorized implementation estimating weights for all features
- self.weights_ = np.linalg.lstsq(confound_fit, X_nz, rcond=None)[0]
- return self
- def transform(self, X):
- """ Regresses out confound from X.
- Parameters
- ----------
- X : numpy array
- An array of shape (n_samples, n_features), which should correspond
- to your train-set only!
- Returns
- -------
- X_new : ndarray
- ndarray with confound-regressed features
- """
- if not self.cross_validate:
- self.fit(X)
- X_nz = X[:, self.nonzero_X_]
- if self.precise:
- tmp = np.in1d(self.X, X_nz).reshape(self.X.shape)
- transform_idx = tmp.sum(axis=1) == self.X.shape[1]
- else:
- transform_idx = np.in1d(self.X.sum(axis=1), X_nz.sum(axis=1))
- confound_transform = self.confound[transform_idx]
- X_new = X - confound_transform.dot(self.weights_)
- X_corr = np.zeros_like(X)
- X_corr[:, self.nonzero_X_] = X_new
- return X_corr
confounds.py at commit dd19414, under MIT · at the source
Overview
- Graduate School of Education, Stanford University, Stanford, CA, USA
- Division of Developmental Behavioral Pediatrics, Stanford University School of Medicine, Stanford, CA, USA
- Burke-Cornell Medical Research Institute, Department of Pediatrics, Weill Medical College, Cornell University, New York, NY, USA
- Department of Psychology, University of Washington, Seattle, WA, USA
- eScience Institute, University of Washington, Seattle, WA, USA
- Department of Psychology, Stanford University, Stanford, CA, USA
- Department of Pediatrics, Division of Neonatology, Stanford University, Stanford, CA, USA
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
dd194140a5babb4605b9248d34508b9d9e4f799c, 24 August 2018Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
21 files
- analyses/
confounds.py , Python, 134 lines - analyses/
counterbalance.py , Python, 254 lines - analyses/
empirical_analysis_gende , Jupyter, 1,619 linesr_classification.ipynb - analyses/
simulation_confound_meth , Jupyter, 2,875 linesods.ipynb - analyses/
suppl_simulations/ , Jupyter, 59 linesanalytic_corr_dist.ipynb - analyses/
suppl_simulations/ , Jupyter, 477 linesbrain_data_vs_brainsize. ipynb - analyses/
suppl_simulations/ , Python, 198 linescb_random.py - analyses/
suppl_simulations/ , Python, 134 linesconfounds.py - analyses/
suppl_simulations/ , Python, 254 linescounterbalance.py - analyses/
suppl_simulations/ , Jupyter, 1,672 linesfunctional_MRI_simulatio n.ipynb - analyses/
suppl_simulations/ , Python, 525 linesrun_autocorr_sims.py - analyses/
suppl_simulations/ , Python, 858 linesrun_random_search_cb.py - analyses/
suppl_simulations/ , Jupyter, 74 linessupression_MVPA.ipynb - analyses/
suppl_simulations/ , Python, 148 linesutils.py - analyses/
utils.py , Python, 148 lines - download_data.py, Python, 41 lines
- scripts/
append_runinfo_to_id1000 , Python, 23 lines_files.py - scripts/
extract_bval_bvec.py , Python, 42 lines - scripts/
run_eddy_correct.py , Python, 14 lines - LICENSE, License, 21 lines
- README.md, Text, 48 lines
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://
BibTeX
@article{chiu2026neonata
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/
url = {https://
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/
VL - 80
SP - 101775
SN - 1878-9293
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"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":
"volume": "80",
"page": "101775",
"DOI": "10.1016/
"PMID": "42400972",
"PMCID": "PMC13355775",
"ISSN": "1878-9293",
"publisher": "Elsevier",
"URL": "https://
"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/s41597-022-01695-7 [code]
- An analysis-ready and quality controlled resource for pediatric brain white-matter research.Journal: Scientific dataIn common: NiBabel, seaborn, scikit-learn, 4 other tools, structural MRI / diffusion, 14 references, author Jason D. Yeatman
- [2] doi:10.1371/journal.pcbi.1013323 [code]
- A software ecosystem for brain tractometry processing, analysis, and insight.Journal: PLoS computational biologyIn common: NiBabel, scikit-learn, pandas, 2 other tools, structural MRI / diffusion, 11 references, author Jason D. Yeatman
- [3] doi:10.1038/s41467-026-68714-8 [code]
- Two axes of white matter development.Journal: Nature communicationsIn common: NiBabel, scikit-learn, pandas, 3 other tools, developmental, structural MRI / diffusion, 10 references, author Jason D. Yeatman
- [4] doi:10.1371/journal.pone.0309574 [code]
- Assessing white matter plasticity in a randomized controlled trial of early literacy training in preschoolers.Journal: PloS oneIn common: statsmodels, seaborn, pandas, 3 other tools, 10 references, author Jason D. Yeatman
- [5] doi:10.1162/imag.a.991 [code]
- Free water elimination tractometry for aging brains.Journal: Imaging neuroscience (Cambridge, Mass.)In common: NiBabel, seaborn, scikit-learn, 4 other tools, structural MRI / diffusion, 12 references
- [6] doi:10.1038/s41467-026-73366-9 [code]
- Cortical and white matter myelination proceed in concert during early infancy.Journal: Nature communicationsIn common: statsmodels, NiBabel, seaborn, 5 other tools, developmental, 9 references
- [7] doi:10.1162/imag_a_00542 [code]
- Development of the arcuate fasciculus is linked to learning gains in reading.Journal: Imaging neuroscience (Cambridge, Mass.)In common: seaborn, scikit-learn, pandas, 2 other tools, structural MRI / diffusion, 10 references, author Jason D. Yeatman
- [8] doi:10.1162/imag_a_00470 [code]
- Fast and reliable quantitative measures of white matter development with magnetic resonance fingerprinting.Journal: Imaging neuroscience (Cambridge, Mass.)In common: SciPy, Matplotlib, NumPy, developmental, structural MRI / diffusion, 9 references, author Jason D. Yeatman
- [9] doi:10.1038/s41467-022-28326-4 [code]
- White matter myelination during early infancy is linked to spatial gradients and myelin content at birth.Journal: Nature communicationsIn common: statsmodels, NiBabel, seaborn, 4 other tools, developmental, structural MRI / diffusion, 5 references, author Jason D. Yeatman
- [10] doi:10.1073/pnas.2303491120 [code]
- Human white matter myelinates faster in utero than ex utero.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: statsmodels, NiBabel, seaborn, 5 other tools, 4 references, 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 19 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:735e0652844b6f57…
Add the badge to the code's README
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 -->
[](https://openscicode.org/badge/doi/10.1016/j.dcn.2026.101775)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1016/j.dcn.2026.101775.svg
:target: https://openscicode.org/badge/doi/10.1016/j.dcn.2026.101775
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1016/j.dcn.2026.101775"><img src="https://openscicode.org/badge/doi/10.1016/j.dcn.2026.101775.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.
