Binding items to contexts through conjunctive neural representations with the method of loci.
The 6 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Methods › fMRI preprocessing › Functional data preprocessing ↔ post_fmriprep.ipynb, lines 56–199 · score 0.95 · framewise displacement, motion outliers, preprocessed BOLD, brain mask, CompCor, aseg
- [2] § Methods › Activity pattern extraction ↔ post_fmriprep.ipynb, lines 56–199 · score 0.82 · motion outlier, linear regression, zero, cosine, derivatives, signals
- [3] § Methods › Relating the similarity of encoding residuals to the similarity of stories (Fig. 3) ↔ scripts/rsa.ipynb, lines 487–521 · score 0.82 · neural semantic correlation, semantic correlation matrices, Spearman correlation, lower triangles, encoding residual, permutation
- [4] § Results › Encoding residuals track idiosyncratic semantic combinations of loci and items ↔ scripts/rsa.ipynb, lines 487–521 · score 0.66 · Spearman correlation, lower triangles, neural representations, encoding residual, semantic, cross
- [5] § Methods › fMRI preprocessing › Functional data preprocessing ↔ runSingularity.sh, the whole file · a weak match · score 0.62 · MNI152NLin2009cAsym, singular, fMRIPrep, fsaverage6, space, variable
- [6] § Results › Relationship between conjunctive representation in the DMN and training and behavior ↔ scripts/hipp_sem.ipynb, lines 328–370 · score 0.55 · univariate activity, story deviation, duration, ROIs, neural, AG
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
Jupyter notebook · 200 lines · 8.3 KB · no license · 2 matches
- # %%
- import nibabel as nib
- import os
- import h5py
- from sklearn import linear_model
- from scipy import stats
- import numpy as np
- import json
- import glob
- #path to data (change to your path)
- fmripreppath = '/data/MoL_clean/fmriprep/'
- #path to output (change to your path)
- prepath = '/data/MoL_clean/preprocessed/'
- #list of sessions
- sesslist=['ses-01','ses-02','ses-03']
- #list of tasks/#runs in each session
- tasklist = [[('Loci', 2),('Item',2),('Encode',1),('Retrieve',1)],
- [('Loci', 2),('Item',2),('Encode',1),('Retrieve',1)],
- [('Loci', 2),('Item',2),('Encode',1),('Retrieve',1)]]
- #list of subjects
- subs= ['sub-%02d' % i for i in range(1,26)]
- # %%
- os.path.exists(os.path.exists(sess_prefix + '_task-' + task[0] + ('_run-%.2d' % offset) + '_desc-confounds_timeseries.tsv'))
- # %%
- # identify group masks for hippocampus
- regional_mask_filenames = sorted([f for f in glob.glob(fmripreppath+'*/ses-01/func/*_ses-01_task-Loci_run-01_space-MNI152NLin2009cAsym_desc-aseg_dseg.nii.gz') ])
- regional_mask_filenames = regional_mask_filenames[:10]+regional_mask_filenames[16:]
- regional_masks = []
- hippo_masks = []
- for regional_mask_fname in regional_mask_filenames:
- regional_mask = nib.load(regional_mask_fname).get_fdata()
- regional_masks.append(regional_mask)
- hippo_masks.append(np.where(np.logical_or(regional_mask == 17, regional_mask == 53)))
- hippo_group_mask_template = np.zeros(regional_mask.shape)
- hippo_group_mask = np.zeros(regional_mask.shape)
- for hippo_mask in hippo_masks:
- hippo_group_mask_template[hippo_mask] += 1
- hippo_group_mask[hippo_group_mask_template==25] = 1
- anterior_group,posterior_group = hippo_group_mask.copy(),hippo_group_mask.copy()
- anterior_group[:,55:,:] = False
- posterior_group[:,:55,:] = False
- anterior_group = anterior_group.astype(bool)
- posterior_group = posterior_group.astype(bool)
- hippo_group_mask = hippo_group_mask.astype(bool)
- # %%
- for sub in subs:
- print('Processing subject:', sub)
- for sess_ind, sess in enumerate(sesslist):
- print('session:', sess)
- if sess == '':
- sess_prefix = os.path.join(fmripreppath, sub, sess, 'func', sub)
- else:
- sess_prefix = os.path.join(fmripreppath, sub, sess, 'func', sub + '_' + sess)
- sess_tasknames = []
- for task in tasklist[sess_ind]:
- if task[1] == 1:
- sess_tasknames.append(task[0]+'_run-01')
- else:
- # For run numbers that don't start at zero
- offset = 0
- while not os.path.exists(sess_prefix + '_task-' + task[0] + ('_run-%.2d' % offset) + '_desc-confounds_timeseries.tsv'):
- print('looping')
- offset += 1
- if offset>10:
- print("something is wrong")
- break
- for r in range(task[1]):
- sess_tasknames.append('%s_run-%.2d' % (task[0], r+offset))
- for task_name in sess_tasknames:
- print('task:', task_name)
- task_prefix = sess_prefix + '_task-' + task_name
- D = dict()
- for hem in ['L', 'R', 'Vol']:
- if hem == 'Vol':
- # Load all timecourses in the 3d brain mask
- fname = task_prefix + '_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz'
- print(' Loading ', fname)
- nii_4d = nib.load(fname).get_fdata()
- mask_fname = task_prefix + '_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz'
- mask_3d = nib.load(mask_fname).get_fdata().astype(bool)
- regional_mask_fname = task_prefix + '_space-MNI152NLin2009cAsym_desc-aseg_dseg.nii.gz'
- regional_mask = nib.load(regional_mask_fname).get_fdata()
- hippo_mask = np.logical_or(regional_mask == 17, regional_mask == 53)
- anterior,posterior = hippo_mask.copy(),hippo_mask.copy()
- anterior[:,55:,:] = False
- posterior[:,:55,:] = False
- D['anterior_hipp'] = nii_4d[anterior]
- D['posterior_hipp'] = nii_4d[posterior]
- D['hippo'] = nii_4d[hippo_mask]
- D['anterior_hipp_group'] = nii_4d[anterior_group]
- D['posterior_hipp_group'] = nii_4d[posterior_group]
- D['hippo_group'] = nii_4d[hippo_group_mask]
- D[hem] = nii_4d[mask_3d]
- else:
- # Load all timecourses for one cortical hemisphere
- fname = task_prefix +'_hemi-'+hem+'_space-fsaverage6_bold.func.gii'
- print(' Loading ', fname)
- gi = nib.load(fname)
- D[hem] = np.column_stack([gi.darrays[t].data for t in range(len(gi.darrays))])
- # Load confound regressors
- conf = np.genfromtxt(task_prefix + '_desc-confounds_timeseries.tsv', names=True)
- conf_json = json.load(open(task_prefix + '_desc-confounds_timeseries.json'))
- # Find first combined compcor regressor
- first_cc = 0
- while True:
- if conf_json['a_comp_cor_%02d' % first_cc]['Mask'] == 'combined':
- break
- first_cc += 1
- reg = np.column_stack((
- # Motion and motion derivatives
- conf['trans_x'],
- conf['trans_x_derivative1'],
- conf['trans_y'],
- conf['trans_y_derivative1'],
- conf['trans_z'],
- conf['trans_z_derivative1'],
- conf['rot_x'],
- conf['rot_x_derivative1'],
- conf['rot_y'],
- conf['rot_y_derivative1'],
- conf['rot_z'],
- conf['rot_z_derivative1'],
- conf['framewise_displacement'],
- # First six compcor components (white matter + CSF signals)
- conf['a_comp_cor_%02d' % first_cc],
- conf['a_comp_cor_%02d' % (first_cc+1)],
- conf['a_comp_cor_%02d' % (first_cc+2)],
- conf['a_comp_cor_%02d' % (first_cc+3)],
- conf['a_comp_cor_%02d' % (first_cc+4)],
- conf['a_comp_cor_%02d' % (first_cc+5)],
- # Cosine (drift) and motion spikes
- np.column_stack([conf[k] for k in conf.dtype.names if ('cosine' in k) or ('motion_outlier' in k)])))
- # Remove nans, e.g. from framewise_displacement
- reg = np.nan_to_num(reg)
- print(' Cleaning and zscoring')
- for hem in ['L', 'R', 'Vol', 'anterior_hipp','posterior_hipp','hippo','anterior_hipp_group','posterior_hipp_group','hippo_group']:
- # Regress out confounds from data
- regr = linear_model.LinearRegression()
- regr.fit(reg, D[hem].T)
- D[hem] = D[hem] - np.dot(regr.coef_, reg.T) - regr.intercept_[:, np.newaxis]
- # Note 8% of values on cortical surface are NaNs, and the following will therefore throw an error
- D[hem] = stats.zscore(D[hem], axis=1)
- # Save hdf5 file
- if sess == '':
- savepath = os.path.join(prepath, sub + '_' + task_name + '.h5')
- else:
- savepath = os.path.join(prepath, sub + '_' + sess + '_' + task_name + '.h5')
- with h5py.File(savepath,'w') as hf:
- grp = hf.create_group(task_name)
- grp.create_dataset('L', data=D['L'])
- grp.create_dataset('R', data=D['R'])
- grp.create_dataset('Vol', data=D['Vol'])
- grp.create_dataset('anterior_hipp', data=D['anterior_hipp'])
- grp.create_dataset('posterior_hipp', data=D['posterior_hipp'])
- grp.create_dataset('hippo', data=D['hippo'])
- grp.create_dataset('anterior_hipp_group', data=D['anterior_hipp_group'])
- grp.create_dataset('posterior_hipp_group', data=D['posterior_hipp_group'])
- grp.create_dataset('hippo_group', data=D['hippo_group'])
- grp.create_dataset('reg',data=reg)
- grp.create_dataset('mask', data=mask_3d)
- grp.create_dataset('hippo_mask', data=hippo_mask)
- print(' saved hdf5 file')
post_fmriprep.ipynb at commit 1cf2ce5, no license · at the source
Overview
- Department of Psychology, Columbia University, New York, NY USA
- Baycrest Health Sciences, Rotman Research Institute, Toronto, ON Canada
- Department of Psychology, Glendon Campus, York University, Toronto, ON, Canada
- Department of Brain and Cognitive Sciences, MIT, Cambridge, MA USA
- McGovern Institute for Brain Research, MIT, Cambridge, MA USA
- Department of Psychology, Rutgers University, New Brunswick, NJ USA
- Department of Computer Science, Rutgers University, New Brunswick, NJ USA
- Princeton Neuroscience Institute, Princeton University, Princeton, NJ USA
- Department of Psychology, Princeton University, Princeton, NJ 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.
Repositories
Its files are read in the Code ↔ Paper reader above, with 6 matches between paragraphs and lines of code.
dpmlab/MoL_code
1cf2ce5193614e9146343e217b2273a4ad94b49c, 4 August 2025Availability: 1 check, the latest on 29 September 2026: the link answers
- 29 September 2026: the link answers
11 files
- post_fmriprep.ipynb, Jupyter, 200 lines, 2 matches
- runSingularity.sh, Shell, 19 lines, 1 match
- scripts/
analysis_notebook.Rmd , R, 613 lines - scripts/
get_beta.ipynb , Jupyter, 343 lines - scripts/
hipp_sem.ipynb , Jupyter, 529 lines, 1 match - scripts/
pat_sim_analysis.ipynb , Jupyter, 738 lines - scripts/
performance_scoring.ipyn , Jupyter, 182 linesb - scripts/
rsa.ipynb , Jupyter, 687 lines, 2 matches - scripts/
util.py , Python, 160 lines - scripts/
visualization_mac.ipynb , Jupyter, 296 lines - README.md, Text, 22 lines
Zenodo 17703712
Availability: 1 check, the latest on 29 September 2026: the link answers (HTTP 200)
- 29 September 2026: the link answers (HTTP 200)
11 files
- post_fmriprep.ipynb, Jupyter, 200 lines
- runSingularity.sh, Shell, 19 lines
- scripts/
analysis_notebook.Rmd , R, 613 lines - scripts/
get_beta.ipynb , Jupyter, 343 lines - scripts/
hipp_sem.ipynb , Jupyter, 529 lines - scripts/
pat_sim_analysis.ipynb , Jupyter, 738 lines - scripts/
performance_scoring.ipyn , Jupyter, 182 linesb - scripts/
rsa.ipynb , Jupyter, 687 lines - scripts/
util.py , Python, 160 lines - scripts/
visualization_mac.ipynb , Jupyter, 296 lines - README.md, Text, 22 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: dpmlab/
MoL_code
Read it in the paper: doi.org/10.1038/s41467-026-71428-6.
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:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 20 scripts, each with its path and the digest of its content;
- 6 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- 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
Datasets cited
- doi:10.18112/
openneuro.ds005894.v1.0. , at OpenNeuro; found in “Data availability”0 - openneuro:ds005894, at OpenNeuro; found in “Data availability”
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:
- it points to 2 datasets: OpenNeuro 10.18112/
openneuro.ds005894.v1.0. , OpenNeuro ds0058940 - it points to the authors' code: dpmlab/
MoL_code
Read it in the paper: doi.org/10.1038/s41467-026-71428-6.
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, 29 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 2 keywords, 10 MeSH terms, 1 funder, 85 references, 8 RRIDs.
Cite
This paper
Huang, J., Manglik, A., Dutra, N., Tarder-Stoll, H., Chamberlain, T., Ajemian, R., Zhang, Q., Norman, K. A., & Baldassano, C. (2026). Binding items to contexts through conjunctive neural representations with the method of loci. Nature communications, 17(1), 5347. https://
BibTeX
@article{huang2026bindin
author = {Huang, Jiawen and Manglik, Akshay and Dutra, Nick and Tarder-Stoll, Hannah and Chamberlain, Taylor and Ajemian, Robert and Zhang, Qiong and Norman, Kenneth A and Baldassano, Christopher},
title = {{Binding items to contexts through conjunctive neural representations with the method of loci}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5347},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {41997927},
pmcid = {PMC13273176}
}
RIS
TY - JOUR
AU - Huang, Jiawen
AU - Manglik, Akshay
AU - Dutra, Nick
AU - Tarder-Stoll, Hannah
AU - Chamberlain, Taylor
AU - Ajemian, Robert
AU - Zhang, Qiong
AU - Norman, Kenneth A
AU - Baldassano, Christopher
TI - Binding items to contexts through conjunctive neural representations with the method of loci
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 5347
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Binding items to contexts through conjunctive neural representations with the method of loci",
"container-title": "Nature communications",
"author": [
{
"family": "Huang",
"given": "Jiawen"
},
{
"family": "Manglik",
"given": "Akshay"
},
{
"family": "Dutra",
"given": "Nick"
},
{
"family": "Tarder-Stoll",
"given": "Hannah"
},
{
"family": "Chamberlain",
"given": "Taylor"
},
{
"family": "Ajemian",
"given": "Robert"
},
{
"family": "Zhang",
"given": "Qiong"
},
{
"family": "Norman",
"given": "Kenneth A"
},
{
"family": "Baldassano",
"given": "Christopher"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "5347",
"DOI": "10.1038/
"PMID": "41997927",
"PMCID": "PMC13273176",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
17
]
]
}
}
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.1371/journal.pbio.3003755 [code]
- Action information is integrated into entorhinal representations of conceptual space and is reflected in eye movements.Journal: PLoS biologyIn common: Nilearn, NiBabel, statsmodels, 5 other tools, 14 references
- [2] doi:10.1371/journal.pbio.3003684 [code]
- The retrieval of previously learned motor memories is facilitated by the reinstatement of default mode network manifold structures.Journal: PLoS biologyIn common: Nilearn, NiBabel, seaborn, 5 other tools, 15 references
- [3] doi:10.1073/pnas.2512071123 [code]
- Narrative "twist" shifts within-individual neural representations of dissociable story features.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: lmerTest, Nilearn, lme4, 8 other tools, 7 references
- [4] doi:10.1038/s41467-026-71151-2 [code]
- Common and distinct neural correlates of social interaction processing and theory of mind in narratives.Journal: Nature communicationsIn common: fMRIPrep, Nilearn, NiBabel, 7 other tools, 10 references
- [5] doi:10.1523/eneuro.0370-25.2026 [code]
- Pretraining for Large-Scale Functional Connectome Fingerprinting Supports Generalization and Transfer Learning in Functional Neuroimaging.Journal: eNeuroIn common: Nilearn, scikit-learn, pandas, 2 other tools, 14 references
- [6] doi:10.1162/netn.a.547 [code]
- An evaluation of the efficacy of single-echo and multi-echo fMRI denoising strategies.Journal: Network neuroscience (Cambridge, Mass.)In common: fMRIPrep, Nilearn, NiBabel, 7 other tools, 8 references
- [7] doi:10.7554/elife.103097 [code]
- Canonical neurodevelopmental trajectories of structural and functional manifolds.Journal: eLifeIn common: Nilearn, Plotly, h5py, 8 other tools, 6 references
- [8] doi:10.1162/imag.a.1347 [code]
- Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm.Journal: Imaging neuroscience (Cambridge, Mass.)In common: fMRIPrep, lmerTest, Nilearn, 9 other tools, 3 references
- [9] doi:10.1162/imag.a.1321 [code]
- Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.Journal: Imaging neuroscience (Cambridge, Mass.)In common: lmerTest, Nilearn, Plotly, 9 other tools, 3 references
- [10] doi:10.1016/j.isci.2026.117180 [code]
- Developmental changes in similarity between neural representations of mental arithmetic and artificial neural networks.Journal: iScienceIn common: Nilearn, h5py, NiBabel, 7 other tools, 6 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: 2 repositories of the authors' code, each at its verified commit and with its license, 20 scripts, and 6 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:cb38d643292cbede…
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.
