OSCR

Initial organization and progressive expansion of the math-responsive brain network during the first school years.

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; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 136 lines · 5.8 KB · no license

  1. import nilearn
  2. import nilearn.image
  3. import nilearn.plotting
  4. import nilearn.glm
  5. import nilearn.glm.first_level
  6. import nilearn.reporting
  7. from matplotlib import pyplot as plt
  8. import numpy as np
  9. from nilearn.glm.first_level import make_first_level_design_matrix
  10. from nilearn.plotting import plot_design_matrix
  11. from nilearn.glm.first_level import FirstLevelModel
  12. from nilearn.glm.second_level import SecondLevelModel
  13. from nilearn.image import threshold_img
  14. from nilearn.glm import threshold_stats_img
  15. from nilearn import datasets
  16. from nilearn import surface
  17. from matplotlib.colors import ListedColormap, LinearSegmentedColormap
  18. from nilearn import plotting, image
  19. from matplotlib import cm
  20. from nilearn.interfaces.bids import save_glm_to_bids
  21. from nilearn.glm.second_level import make_second_level_design_matrix
  22. from nilearn.surface import vol_to_surf
  23. import pandas as pd
  24. from scipy.stats import norm
  25. import pickle
  26. from nilearn.reporting import get_clusters_table
  27. from sklearn.preprocessing import PolynomialFeatures
  28. from pathlib import Path
  29. import json
  30. from tqdm import tqdm
  31. # Path for the first-level contrasts
  32. deriv_root = Path("../Data/derivatives/firstlevel")
  33. task = "sentences"
  34. view = ["lateral","posterior","medial"]
  35. contrastAll = ["maths_vs_nonmath","social_vs_nonsocial"]
  36. z_thresh = norm.isf(0.001)
  37. sessions = ["01","02","03"]
  38. #____________________________________________________________________________________________________
  39. # Compute the second level model
  40. # Figure 2A : Activations for math vs. non-math sentences (top row)
  41. # Figure S5A: Activations for social vs. non-social sentences (top row)
  42. #____________________________________________________________________________________________________
  43. for contrastName in tqdm(contrastAll, total = 2, desc = "Contrasts"):
  44. # ---- 1. Collect subject-level maps ----
  45. contrast_maps = []
  46. for ses in sessions:
  47. contrast_maps.extend(
  48. deriv_root.glob(
  49. f"sub-*/ses-{ses}/func/"
  50. f"*desc-{contrastName}_stat-es.nii.gz"
  51. )
  52. )
  53. contrast_maps = sorted(contrast_maps)
  54. # ---- 2. Compute the second-level design matrix ----
  55. design_matrix = pd.DataFrame({
  56. "intercept": [1] * len(contrast_maps)
  57. })
  58. # ---- 3. Compute second-level analysis ----
  59. second_level_model = SecondLevelModel(smoothing_fwhm=8)
  60. second_level_model = second_level_model.fit(contrast_maps,
  61. design_matrix = design_matrix)
  62. # ---- 4. Compute contrast ----
  63. zmap = second_level_model.compute_contrast(second_level_contrast = "intercept",
  64. output_type="z_score")
  65. zmap_corrected, threshold1 = threshold_stats_img(zmap, alpha=0.01,
  66. height_control="fdr",
  67. two_sided=True)
  68. # ---- 5. Plotting in surface ----
  69. nilearn.plotting.plot_img_on_surf(zmap_corrected,
  70. views=view,
  71. hemispheres=['left', 'right'],
  72. colorbar=True,
  73. title = "1st Level : " + contrastName,
  74. threshold = z_thresh,
  75. inflate = True)
  76. nilearn.plotting.show()
  77. # ---- 5. Plotting in volumes (z-axis) ----
  78. nilearn.plotting.plot_stat_map(zmap_corrected, colorbar=True,
  79. threshold = z_thresh,
  80. title = "1st Level : " + contrastName,
  81. display_mode = "z",
  82. cut_coords = [-20, -10, 0, 10, 20, 30, 40, 50, 60])
  83. nilearn.plotting.show()
  84. #____________________________________________________________________________________________________
  85. # In each period separately
  86. # Figure 2A : Activations for math vs. non-math sentences (bottom row)
  87. # Figure S5A: Activations for social vs. non-social sentences (bottom row)
  88. # #____________________________________________________________________________________________________
  89. for ses in sessions:
  90. for contrastName in tqdm(contrastAll, total=2, desc="Contrasts"):
  91. # ---- 1. Collect subject-level maps ----
  92. contrast_maps = []
  93. contrast_maps.extend(
  94. deriv_root.glob(
  95. f"sub-*/ses-{ses}/func/"
  96. f"*desc-{contrastName}_stat-es.nii.gz"))
  97. contrast_maps = sorted(contrast_maps)
  98. design_matrix = pd.DataFrame({
  99. "intercept": [1] * len(contrast_maps)
  100. })
  101. # ---- 2. Compute second-level analysis ----
  102. second_level_model = SecondLevelModel(smoothing_fwhm=8)
  103. second_level_model = second_level_model.fit(contrast_maps,
  104. design_matrix=design_matrix)
  105. # ---- 3. Compute contrast ----
  106. zmap = second_level_model.compute_contrast(second_level_contrast="intercept")
  107. zmap_corrected, threshold1 = threshold_stats_img(zmap, alpha=0.1,
  108. height_control="fdr",
  109. two_sided=True)
  110. # ---- 4. Plotting in surface ----
  111. nilearn.plotting.plot_img_on_surf(zmap_corrected,
  112. views=view,
  113. hemispheres=['left', 'right'],
  114. colorbar=True,
  115. title = "1st Level : " + contrastName + ", Period: " + ses,
  116. threshold = z_thresh,
  117. vmax = 6.5,
  118. inflate = True)
  119. nilearn.plotting.show()

secondLevelEstimation.py, no license · at the source

Overview

Authors: Théo Morfoisse1,2, Séverine Becuwe2, Marie Palu2, Cassandra Potier-Watkins1, Ghislaine Dehaene-Lambertz2, Stanislas Dehaene1,2
  1. Chair of Experimental Cognitive Psychology, Collège de France, Paris 75005, France
  2. Cognitive NeuroImaging Unit, Commissariat à l’Energie atomique et aux énergies alternatives, INSERM, Université Paris-Sud, Université Paris-Saclay, NeuroSpin Center, Gif-sur-Yvette 91191, France
Institutions: Collège de France (France); Université Paris-Saclay (France)
Dates: received 23 January 2026; accepted 19 May 2026; published online 2 July 2026; in print 7 July 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1073/pnas.2602515123 · PMID 42391394 · PMCID PMC13342980 · OpenAlex W7167060396
Open access: hybrid, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: fMRI (modality), human (organism)
Methods: Statistics, fMRI & imaging
Keywords: cognitive development, mathematical cognition, longitudinal study, education, fMRI
MeSH: Brain*, Child Development*, Mathematics*, Nerve Net*, Brain Mapping, Child, Child, Preschool, Cognition, Female, Humans, Longitudinal Studies, Magnetic Resonance Imaging, Male (* major topic)
Journal subjects: Biological Sciences, Neuroscience
Topic: Cognitive and developmental aspects of mathematical skills (Developmental and Educational Psychology, Psychology), according to OpenAlex
Funding: ERC (ERC-2022-ADG101095866); France 2030 program (ANR-23-IAHU-0010)
Citations: not cited yet (Europe PMC); 92 references in the paper

Abstract

The neural mechanisms by which the developing brain acquires higher mathematical concepts from elementary intuitions remain poorly understood. Through a large-scale longitudinal functional MRI study of children from preschool through first and second grade, we tracked how neural responses to mathematical and nonmathematical statements change in the first 2 y of formal schooling, and we used these data to evaluate several theories of developmental change. Before school, when listening to math statements, children already engaged an adult-like cortical network, with partial specialization for geometry. Over the first 2 y of school, we observed an overall increase in math-related activation, a small recruitment of additional neural territory, reduced activation for facts that get better known, and a small overall increase in the dimensionality of representational space. fMRI responses to individual sentences suggest that these mechanisms, particularly in left inferior frontal gyrus and bilateral intraparietal sulcus, all contribute to children’s growing mastery of mathematical concepts.

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

Repository

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

OSF 5kvd9

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: Python (3)
Size: 238 files, 3 scripts
Software Heritage: not checked
Found in: “Data, Materials, and Software Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: Matplotlib (3 files), Nilearn (3 files), NumPy (3 files), pandas (3 files), SciPy (3 files), scikit-learn (2 files)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
3 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;
  • 3 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.

Data, Materials, and Software Availability

All code used for data preprocessing, statistical analyses, and figure generation is available on the Open Science Framework (OSF) at https://osf.io/5kvd9/overview?view_only=52f336a5f13f446eb569ada6c798cf31 (92). All other data are included in the manuscript and/or SI Appendix (http://www.pnas.org/lookup/doi/10.1073/pnas.2602515123#supplementary-materials).

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, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 5 keywords, 13 MeSH terms, 2 funders, 84 references.

Cite

This paper

Morfoisse, T., Becuwe, S., Palu, M., Potier-Watkins, C., Dehaene-Lambertz, G., & Dehaene, S. (2026). Initial organization and progressive expansion of the math-responsive brain network during the first school years. Proceedings of the National Academy of Sciences of the United States of America, 123(27), e2602515123. https://doi.org/10.1073/pnas.2602515123

BibTeX

@article{morfoisse2026initial,
author = {Morfoisse, Théo and Becuwe, Séverine and Palu, Marie and Potier-Watkins, Cassandra and Dehaene-Lambertz, Ghislaine and Dehaene, Stanislas},
title = {{Initial organization and progressive expansion of the math-responsive brain network during the first school years}},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
year = {2026},
month = jul,
volume = {123},
number = {27},
pages = {e2602515123},
publisher = {National Academy of Sciences},
issn = {0027-8424},
doi = {10.1073/pnas.2602515123},
url = {https://doi.org/10.1073/pnas.2602515123},
pmid = {42391394},
pmcid = {PMC13342980}
}

RIS

TY - JOUR
AU - Morfoisse, Théo
AU - Becuwe, Séverine
AU - Palu, Marie
AU - Potier-Watkins, Cassandra
AU - Dehaene-Lambertz, Ghislaine
AU - Dehaene, Stanislas
TI - Initial organization and progressive expansion of the math-responsive brain network during the first school years
T2 - Proceedings of the National Academy of Sciences of the United States of America
J2 - Proc Natl Acad Sci U S A
PY - 2026
DA - 2026/07/02
VL - 123
IS - 27
SP - e2602515123
SN - 0027-8424
PB - National Academy of Sciences
DO - 10.1073/pnas.2602515123
UR - https://doi.org/10.1073/pnas.2602515123
LA - en
ER -

CSL-JSON

{
"id": "10.1073/pnas.2602515123",
"type": "article-journal",
"title": "Initial organization and progressive expansion of the math-responsive brain network during the first school years",
"container-title": "Proceedings of the National Academy of Sciences of the United States of America",
"author": [
{
"family": "Morfoisse",
"given": "Théo"
},
{
"family": "Becuwe",
"given": "Séverine"
},
{
"family": "Palu",
"given": "Marie"
},
{
"family": "Potier-Watkins",
"given": "Cassandra"
},
{
"family": "Dehaene-Lambertz",
"given": "Ghislaine"
},
{
"family": "Dehaene",
"given": "Stanislas"
}
],
"container-title-short": "Proc Natl Acad Sci U S A",
"volume": "123",
"issue": "27",
"page": "e2602515123",
"DOI": "10.1073/pnas.2602515123",
"PMID": "42391394",
"PMCID": "PMC13342980",
"ISSN": "0027-8424",
"publisher": "National Academy of Sciences",
"URL": "https://doi.org/10.1073/pnas.2602515123",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
2
]
]
}
}

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.1016/j.dcn.2026.101717 [code]
Number words recruit numerosity-related cortex in 3- to 5-year-old children.
Journal: Developmental cognitive neuroscience
In common: 18 references
[2] doi:10.1038/s41539-026-00419-5 [code]
Home numeracy experiences are associated with number-related brain activity and connectivity in early childhood.
Journal: NPJ science of learning
In common: NumPy, 14 references
[3] doi:10.1038/s42003-025-08395-z [code]
Distinct neural representational geometries of numerosity in early visual and association regions across visual streams.
Journal: Communications biology
In common: Nilearn, scikit-learn, pandas, 3 other tools, fMRI, 11 references
[4] doi:10.1162/jocn.a.81 [code]
The Neural Bases of Graphical Perception: A Novel Instance of Cultural Recycling?
Journal: Journal of cognitive neuroscience
In common: Nilearn, pandas, SciPy, 2 other tools, 11 references
[5] doi:10.1073/pnas.2213430120
Evaluating the impact of short educational videos on the cortical networks for mathematics.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: fMRI, 10 references, author Stanislas Dehaene
[6] doi:10.7554/elife.106464 [code]
A geometric shape regularity effect in the human brain.
Journal: eLife
In common: Nilearn, scikit-learn, pandas, 3 other tools, 10 references
[7] doi:10.1371/journal.pbio.3003820 [code]
A cortical semantic map integrates fractions and integers in the human brain.
Journal: PLoS biology
In common: Nilearn, scikit-learn, pandas, 3 other tools, fMRI, 9 references
[8] doi:10.1111/desc.70042 [code]
Developmental Changes in Nonsymbolic and Symbolic Fractions Processing: A Cross-Sectional fMRI Study.
Journal: Developmental science
In common: fMRI, 11 references
[9] doi:10.1038/s41467-025-63259-8
Neurodevelopmental commonalities in cognitive control networks for mathematics and reading in meta-analysis of 3308 participants.
Journal: Nature communications
In common: 11 references
[10] doi:10.1073/pnas.2507291122 [code]
From retinotopic to ordinal coding: Dissecting the cortical stages of visual word recognition.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: Nilearn, scikit-learn, SciPy, 2 other tools, fMRI, 5 references, author Stanislas Dehaene

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.1073/pnas.2602515123.svg)](https://openscicode.org/badge/doi/10.1073/pnas.2602515123)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1073/pnas.2602515123.svg
   :target: https://openscicode.org/badge/doi/10.1073/pnas.2602515123
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1073/pnas.2602515123"><img src="https://openscicode.org/badge/doi/10.1073/pnas.2602515123.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

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)

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.