Binding items to contexts through conjunctive neural representations with the method of loci.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 6 matches · 1 of them tie a paragraph to a whole file without given lines: a weak match, whose lines are not tinted
- [1] § Methods › fMRI preprocessing › Functional data preprocessing ↔ post_fmriprep.ipynb, lines 56 to 199 · score 0.95 · framewise displacement, motion outliers, preprocessed BOLD, brain mask, CompCor, aseg · Report a mismatch
- [2] § Methods › Activity pattern extraction ↔ post_fmriprep.ipynb, lines 56 to 199 · score 0.82 · motion outlier, linear regression, zero, cosine, derivatives, signals · Report a mismatch
- [3] § Methods › Relating the similarity of encoding residuals to the similarity of stories (Fig. 3) ↔ scripts/rsa.ipynb, lines 487 to 521 · score 0.82 · neural semantic correlation, semantic correlation matrices, Spearman correlation, lower triangles, encoding residual, permutation · Report a mismatch
- [4] § Results › Encoding residuals track idiosyncratic semantic combinations of loci and items ↔ scripts/rsa.ipynb, lines 487 to 521 · score 0.66 · Spearman correlation, lower triangles, neural representations, encoding residual, semantic, cross · Report a mismatch
- [5] § Methods › fMRI preprocessing › Functional data preprocessing ↔ runSingularity.sh, the whole file · a weak match · score 0.62 · MNI152NLin2009cAsym, singular, fMRIPrep, fsaverage6, space, variable · block
oscr:b:VZM985REDKH3R-G· Report a mismatch - [6] § Results › Relationship between conjunctive representation in the DMN and training and behavior ↔ scripts/hipp_sem.ipynb, lines 328 to 370 · score 0.55 · univariate activity, story deviation, duration, ROIs, neural, AG · Report a mismatch
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
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 Portfolio},
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 Portfolio
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 Portfolio",
"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.1038/s41562-025-02379-z [code]
- Spatial contexts with reliable neural representations support reinstatement of subsequently placed objects.Journal: Nature human behaviourIn common: Nilearn, h5py, statsmodels, 7 other tools, 22 references, 2 authors
- [2] doi:10.1038/s44271-025-00211-y [code]
- Neural codes track prior events in a narrative and predict subsequent memory for details.Journal: Communications psychologyIn common: Nilearn, statsmodels, NiBabel, 6 other tools, 25 references, author Kenneth A Norman
- [3] doi:10.7554/elife.69430 [code]
- Developmental changes in story-evoked responses in the neocortex and hippocampus.Journal: eLifeIn common: Nilearn, h5py, statsmodels, 7 other tools, 14 references, author Christopher Baldassano
- [4] doi:10.1038/s41467-023-36805-5 [code]
- Flexible reuse of cortico-hippocampal representations during encoding and recall of naturalistic events.Journal: Nature communicationsIn common: statsmodels, seaborn, pandas, 3 other tools, 20 references
- [5] doi:10.1038/s41467-024-55459-5 [code]
- Network structure influences the strength of learned neural representations.Journal: Nature communicationsIn common: fMRIPrep, lmerTest, Nilearn, 9 other tools, systems, 14 references
- [6] doi:10.7554/elife.82566 [code]
- Statistical inference on representational geometries.Journal: eLifeIn common: fMRIPrep, Nilearn, h5py, 8 other tools, 14 references
- [7] doi:10.7554/elife.79045 [code]
- Neural representations of naturalistic events are updated as our understanding of the past changes.Journal: eLifeIn common: systems, 16 references, author Kenneth A Norman
- [8] doi:10.1038/s41539-025-00348-9 [code]
- Dynamic reconfiguration of brain coactivation states associated with active and lecture-based learning of university physics.Journal: NPJ science of learningIn common: lmerTest, Nilearn, Plotly, 10 other tools, 11 references
- [9] doi:10.1016/j.neuroimage.2021.118843 [code]
- Functional brain network community structure in childhood: Unfinished territories and fuzzy boundaries.Journal: NeuroImageIn common: fMRIPrep, Nilearn, lme4, 9 other tools, 12 references
- [10] doi:10.1038/s41467-022-33517-0 [code]
- Schemas provide a scaffold for neocortical integration of new memories over time.Journal: Nature communicationsIn common: lmerTest, lme4, ggplot2, 1 other tool, systems, 13 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:dc6e68531349e990…
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.1038/s41467-026-71428-6)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-71428-6.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-71428-6
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-71428-6"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-71428-6.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.
