This repository contains MATLAB, Python, R, and shell scripts supporting the following work:
Individualized network topography in pre-adolescent children and adults using naturalistic precision fMRI
First-author and script creation: Shefali Rai Under Review BioRxiv DOI: https://doi.org/10.64898/2026.03.05.709899
For the individualized network topography analyses using naturalistic precision fMRI data, we have included scripts for the generation of individual-level network maps, comparison with HCP templates, surface area and density maps, and network similarity between adults and children.
PreciseKids_IndividualizedTopography/
├── scripts/ # MATLAB, Python, R, and shell scripts
├── data/ # Supporting data files
└── README.md
- MATLAB R2021b or later
- Python 3 (for vertex-wise assignment)
- R (for VertexwiseR TFCE analyses and plotting)
- Connectome Workbench (
wb_view,wb_command) was used for all cortical surface visualization cifti-matlabandgifti-1.6should be in your MATLAB path
MatchedCensoring_NetworkMaps_Allsubs.m
Censors data across all video stimuli and sessions, then randomly draws usable and censored data that is matched in quantity across stimuli and sessions. Note: since sampling is still within-session, this is split-half iterative sampling rather than true test-retest.
createMaxDice_WinnerTakeAll.m
Creates a group-average network map using a winner-take-all approach across participants. Used to generate the visual children and adult average maps.
HCP_overlapbetweentemplates.m
Overlap between the Dworetsky HCP adult template and the HCP 8-9 year old template.
HCP_overlaptemplate_creation.m
Overlap map between the two HCP templates for visualization.
HCPOverlap_AllDiceValues_ExtractNetworkValues.m
Dice overlap per network for each participant. This becomes the input for VertexwiseR TFCE analyses.
ExtractBinaryNetworks_HCPoverlapnetworks.m
Extracts each network column as a binary mask and saves it separately as a .dscalar.nii file.
NetworkPropDiff_Sample1.m
For each vertex, computes the proportion of children and adults assigned to each network, then visualize the difference as a .dscalar map. Uses outputs from EachVertex_ProportionAssignment.py.
EachVertex_ProportionAssignment.py (Python)
Child minus adult network assignment proportions at each vertex and outputs a differences.txt file used by NetworkPropDiff_Sample1.m.
SurfaceArea_Gradiation.m
Computes surface area and HCP overlap network assignment for each participant to create density maps across all individuals — this is not averaged across participants.
- Open
.dscalar.niioutput files in Connectome Workbench (wb_view) - We visualize with the
inflated.32k_fs_LR.surf.giifor both hemispheres
If you use these scripts, for now please cite our bio archive doi: https://doi.org/10.64898/2026.03.05.709899