Neonatal brain-age models in full- and preterm infants.
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
- """
- 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/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
- [2] doi:10.7554/elife.103097 [code]
- Canonical neurodevelopmental trajectories of structural and functional manifolds.Journal: eLifeIn common: statsmodels, NiBabel, 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 behaviorIn 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 communicationsIn common: statsmodels, NiBabel, 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 communicationsIn common: NiBabel, seaborn, scikit-learn, 4 other tools, 6 references
- [7] doi:10.1038/s41467-026-71428-6 [code]
- Binding items to contexts through conjunctive neural representations with the method of loci.Journal: Nature communicationsIn common: statsmodels, NiBabel, seaborn, 5 other tools, 5 references
- [8] 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
- [9] doi:10.1038/s41467-026-71555-0 [code]
- A deep representation learning model to predict response to vagus nerve stimulation.Journal: Nature communicationsIn common: NiBabel, seaborn, scikit-learn, 4 other tools, structural MRI / diffusion, 5 references
- [10] doi:10.1126/sciadv.aec2348 [code]
- Congenital blindness reduces myelination in human visual cortex.Journal: Science advancesIn common: NiBabel, pandas, NumPy, structural MRI / diffusion, other condition, 7 references
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:babe0c5e6319bccd…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
