Sender-receiver subdivisions of the default mode network in perceptual and memory-guided cognition.
The 1 match
- [1] § Materials and Methods › Procedure. ↔ n-back_task_script.py, lines 205–246 · score 0.67 · 1500–2500 ms, fixation cross, red box, 1500 ms
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 · 325 lines · 13 KB · no license · 1 match
- #!/usr/bin/env python
- # SUPPLIED WITH NO GUARANTEES!!
- ## For more information on this script please read the README.md file
- from numpy import random
- from psychopy import visual, core, event, gui
- import numpy as np
- import glob, pygame, sys
- from psychopy.misc import fromFile
- import csv, time
- from random import shuffle
- from src.experiment import Question, instructions
- from src.fileIO import load_conditions_dict, write_csv
- ########################################## Log participant details ##################################################
- #collect participant info, create logfile
- info = {'Subject':'test','datestr':time.strftime('%Y%m%d%H%M'),'In Scanner?':['Yes','No'],'Run':['1','2','3','4'],'Input method':['keyboard']}
- infoDlg = gui.DlgFromDict(info, title = 'Subject details:', order = ['Subject',], fixed=['datestr'])
- Subject = info.get('Subject')
- Input = info.get('Input method')
- Run = info.get('Run')
- #let the script know if we are in the scanner or not (true/false)
- In_scanner = info.get('In Scanner?')
- if In_scanner =='Yes':
- In_scanner=True
- slices_per_vol = 60
- dummy_vol = 3
- tr = 2
- # import serial
- # resp_device = serial
- #Create dummy period (time needed for the scanner to collect 2 volumes)
- # Dummy_timer=(dummy_vol*tr)
- else:
- In_scanner=False
- # resp_device = None
- # Dummy_timer=0
- print(In_scanner)
- #If use clicks OK continue with experiment and create a logfile with their details #else quite experiment
- if infoDlg.OK:
- logpath = 'data/%s_Run%s_%s_MRI_log.csv' %(info['Subject'],info['Run'],info['datestr'])
- f = open(logpath, 'w+') # create log file
- # f.write('%s\n' %(info['Subject'])) # write participant info
- f.write('StartTrial,Duration_Item,Image1,Image2,ConditionType,TrialType,RedBox,CorrectAnswer,Response,RT,Accuracy,StartFixation,ITI\n') # write headers
- else:
- print 'User Cancelled'
- core.quit()
- confirm = gui.Dlg(title="Confirm details")
- confirm.addText("Are you happy with your selection?",color='Blue')
- confirm.addText("Subject = %s" % (Subject))
- confirm.addText("In Scanner? = %s" % (Input))
- confirm.show()
- if confirm.OK:
- print 'correct details'
- else:
- print 'incorrect details'
- core.quit()
- ############################################Define all variables###############################################
- #create window to draw in - for full screen
- #win = visual.Window(size=(1680, 1050), fullscr=True,screen=0,monitor=u'testMonitor',units="deg")
- win = visual.Window(fullscr = True, monitor="testMonitor", units="pix")
- #win = visual.Window([1000, 800], monitor="testMonitor", units="pix")
- #create a fixation cross
- fixation = visual.TextStim(win,text='+',height=40)
- fixation_red = visual.TextStim(win,text='+',color=(1.0,-1,-1))
- #create image template you can call image.png too
- im = visual.ImageStim(win, image = None, size = (200, 200), units = 'pix')
- #create general instructions
- #create general instructions
- startmessage1 = ["""In this experiment you will be presented with pairs of images that represent either faces, scenes or objects. On certain trials the box outlining one of images will change colour, and you are to indicate which category that image is from.
- Press 1 for Faces, 2 for Scenes and 3 for Objects.
- On some trials the box will change color but there will be no image in this box. On these trials you must reponsd with what item was in that box on the previous trial.
- Once you make a selection please wait for the next trial to appear.
- Press any button to continue to the experiment :)
- """]
- startTxt = visual.TextStim(win, text = '',height=25)
- finishTxt = visual.TextStim(win, text = 'End of Experiment!',height=40)
- readyTxt = visual.TextStim(win, text = 'Waiting for scanner......',height=40)
- ############################################# Setup #############################################################
- def setup_input(input_method):
- #If input_method is 'keyboard', we don't do anything
- #If input_method is 'serial', we set up the serial port for fMRI responses
- if input_method == 'keyboard':
- # Don't do anything
- resp_device = None
- elif input_method == 'serial':
- # Serial - we need to set it up
- import serial
- resp_device = serial
- #Create dummy period (time needed for the scanner to collect 2 volumes)
- else:
- raise Exception('Unknown input method')
- return resp_device
- def clear_buffer(input_method, resp_device):
- """
- Clear whichever buffer is appropriate for our input method
- """
- if input_method == 'keyboard':
- # Clear the keyboard buffer
- event.clearEvents()
- else:
- # Clear the serial buffer
- resp_device.flushInput()
- def get_response(input_method, resp_device, timeStamped):
- #if participants don't respond we will set up a null value so we don't get an error
- thisResp = None
- thisRT = np.nan
- if input_method == 'keyboard':
- for key, RT in event.getKeys(keyList = ['escape', 'q', 'left', 'right','1','2','3'], timeStamped = timeStamped):
- if key in ['escape','q']:
- print 'User Cancelled'
- print key
- core.quit()
- else:
- thisResp = key
- thisRT = myClock.getTime()
- else:
- thisResp = resp_device.read(1)
- thisRT = timeStamped.getTime()
- if len(thisResp) == 0:
- thisResp = None
- thisRT = np.nan
- # else:
- # # Map button numbers to side
- # ## Blue == 1, Green == 3
- # if thisResp in ['1', '3']:
- # thisResp = '1'
- # elif thisResp in ['2', '4']:
- # thisResp = '2'
- # Quickly check for a 'q' response on the keyboard to quit
- for key, RT in event.getKeys(keyList = ['escape', 'q'], timeStamped = timeStamped):
- if key in ['escape', 'q']:
- print 'User cancelled'
- core.quit()
- return thisResp, thisRT# This needs to be either keyboard or serial - we then setup the response device
- input_method = Input
- resp_device = setup_input(input_method)
- #if participants don't respond we will set up a null value so we don't get an error
- thisResp = ''
- thisRT = np.nan
- # read in csv file with conditions on
- ds = 'conds/Run%s_new.csv' %(Run)
- dataFile = open(ds, 'rb')
- #ds = dataFile.sample(frac=1)
- reader = csv.reader(dataFile, delimiter = ',')
- header = dataFile.readline() #read in first line of the csv file and assign this to the variable header
- #strip the header to remove \n from the end and split this line into as many entries as there are columns in the header file (i.e., into each of the columns headers)
- hdr = header.strip().split(',')
- lines = dataFile.readlines() #assign all other information into the variable lines
- #shuffle lines so they are called in a random order.
- #shuffle(lines)
- # experience sampling questions
- RSQ_txt = './instructions/RSQ_instr.txt'
- ES_PATH = './resting_Q.csv'
- questions, q_headers = load_conditions_dict(ES_PATH)
- q_headers += ['StartTime', 'Rating', 'RT', 'IDNO']
- shuffle(questions)
- # my question module
- ESQ_instructions = instructions(window=win, instruction_txt=RSQ_txt)
- question = Question(window=win, questions=questions, color='white', font=1)
- ######################################Experiment begins##############################################################
- #present instructions
- for inst in startmessage1:
- startTxt.setText(inst)
- startTxt.draw()
- event.Mouse(visible=False)
- win.flip()
- event.waitKeys(keyList=['space', 'left', 'right', 'return','1', '2','3','esc'])
- #present the ready screen and wait for a '5' to sync with triggers
- readyTxt.draw()
- win.flip()
- event.waitKeys(keyList=['5'])
- #Dummy files this will wait 6 seconds before clock is initated and experiment starts to account for 3 x 2TR of dummy trials if in the scanner or 0 in the lab
- fixation.draw()
- win.flip()
- core.wait(6)
- #set up a clock from which we can getTime() to measure length of experiment and trials and present a fixation cross for 1 second before trials begin
- myClock = core.Clock()
- fixation.draw()
- win.flip()
- core.wait(1)
- ############################################ Run 1 ################################################################
- for line in lines: # read in row by row from csv file
- data = line.strip().split(',')
- trialType = (data[0])
- item1 = str(data[1])
- item2 = str(data[2])
- redBox = str(data[3])
- correctAns = str(data[4])
- cond = str(data[5])
- # define rectangles and image stim.
- #rect1_black = visual.Rect(win, units='pix', width=300, height=300, pos=(-250,0),lineColor='black')
- #rect2_black = visual.Rect(win, units='pix', width=300, height=300, pos=(250,0),lineColor='black')
- #rect1_red = visual.Rect(win, units='pix', width=300, height=300, pos=(-250,0),lineColor='red')
- #rect2_red = visual.Rect(win, units='pix', width=300, height=300, pos=(250,0),lineColor='red')
- #img1 = visual.ImageStim(win,units='pix',image=item1,size=[200,200], pos =(-250,0))
- #img2 = visual.ImageStim(win,units='pix',image=item2,size=[200,200], pos =(250,0))
- rect1_black = visual.Rect(win, units='pix', width=400, height=400, pos=(-300,0),lineColor='black')
- rect2_black = visual.Rect(win, units='pix', width=400, height=400, pos=(300,0),lineColor='black')
- rect1_red = visual.Rect(win, units='pix', width=400, height=400, pos=(-300,0),lineColor='red')
- rect2_red = visual.Rect(win, units='pix', width=400, height=400, pos=(300,0),lineColor='red')
- img1 = visual.ImageStim(win,units='pix',image=item1,size=[300,300], pos =(-300,0))
- img2 = visual.ImageStim(win,units='pix',image=item2,size=[300,300], pos =(300,0))
- # define ITI, duration of items.
- ITI = np.random.uniform(1.5, 2.5)
- duration_item = 2.5
- # draw boxes to dictate whether participant make no response ('none') or have to respond to the left or right image
- if redBox == 'none':
- rect1_black.draw()
- rect2_black.draw()
- elif redBox == 'left':
- rect1_red.draw()
- rect2_black.draw()
- elif redBox == 'right':
- rect1_black.draw()
- rect2_red.draw()
- # for 0-back and non-response trials two items will be presented on the screen. For 1-back trials we will skip this and just draw fixation and boxes
- if cond == '2':
- fixation.draw()
- img1.draw()
- img2.draw()
- elif cond == '0':
- fixation.draw()
- img1.draw()
- img2.draw()
- elif cond == '1':
- fixation.draw()
- #start presentation of target and collect responses.
- RT = 0 #need this to be 0 in case no response is made
- t_remain = 0
- contTrial = True #create variable contTrial
- event.clearEvents() #start each trial by clearing event buffer to prevent any previous keys interfering with the current trial
- isCorrect = 0
- thisResp = 'none'
- # take time stamp and present trial
- t1 = myClock.getTime()
- win.flip()
- #Wait for response, if no response is made in the alloted time move in, if a response is made then present fixation for the remainder of this time
- while contTrial and myClock.getTime()-t1 <=duration_item:
- thisResp, thisRT = get_response(input_method, resp_device, myClock)
- if thisResp is not None:
- contTrial = False
- RT = float(thisRT - t1)# duration = time participants took to identify
- t_remain = duration_item - RT
- ITI = t_remain + ITI
- #draw fixation for the ITI
- thisResp = str(thisResp)
- isCorrect = int(thisResp == correctAns) #determine whether participants response matches the corrAns []
- t2 = myClock.getTime()
- fixation.draw()
- win.flip()
- core.wait(ITI)
- #f.write('StartTrial,Duration_Item,Image1,Image2,ConditionType,TrialType,RedBox,CorrectAnswer,Response,RT,Accuracy,StartFixation,ITI\n') # write headers
- f.write('%f,%f,%s,%s,%s,%s,%s,%s,%s,%f,%f,%f,%f\n' %(t1, duration_item, item1, item2, cond, trialType, redBox, correctAns, thisResp, RT, isCorrect, t2, ITI))
- f.flush()
- clear_buffer(input_method, resp_device)
- #############################################Questions###############################################################
- #ESQ_instructions.show(duration=10)# changed this from 20
- ## show experience sampling questions
- #for q in questions:
- # question.set(q)
- # start_trial, score, rt = question.show(myClock)
- #
- # # save this trial
- # q['StartTime'] = start_trial
- # q['Rating'] = score
- # q['RT'] = rt
- # q['IDNO'] = info['Subject']
- # write_csv('./data/{}_ES_{}.csv'.format(info['Subject'], info['datestr']), q_headers, q)
- ############################################End Experiment###############################################################
- finishTxt.draw()
- win.flip()
- event.waitKeys(maxWait = 5)
- f.close()
- core.quit()
n-back_task_script.py, no license · at the source
Overview
- State Key Laboratory of Cognitive Science and Mental Health, Institute of Psychology, Chinese Academy of Sciences, Beijing 100101, China
- Department of Psychology, University of Chinese Academy of Sciences, Beijing 100049, China
- Department of Psychology, University of York, Heslington, York YO10 5DD, United Kingdom
- Institute for Neuroscience and Medicine, Forschungszentrum Juelich, Juelich 52425, Germany
- Department of Psychology, Queen’s University, Kingston, ON K7L 3N6, Canada
- Integrative Neuroscience and Cognition Centre, Centre National de la Recherche Scientifique and Université de Paris, Paris 75006, France
- Institute of Psychiatry, Psychology & Neuroscience, King‘s College London, London SE5 8AF, United Kingdom
Abstract
Everyday cognition depends on the brain’s capacity to shift between sensing the external world and constructing it from memory. To achieve this, large-scale cortical systems must flexibly integrate incoming sensory signals with internally generated representations. Here, we show that this flexibility is reflected in the macroscale architecture of the default mode network (DMN). Using convergent analyses across three independent fMRI datasets spanning directional connectivity, intrinsic organization, and task-evoked responses, we identify spatially distinct DMN subregions that are preferentially engaged during perceptual decisions about faces or memory-guided decisions based on previously seen images. These subregions correspond to a microarchitectural distinction, captured via directional and intrinsic connectivity profiles: regions preferentially engaged during face perception align with receiver-like, afferent-biased zones that show strong intrinsic connectivity across the heteromodal cortex, a profile that might support information integration during perceptually guided decision-making. In contrast, memory-guided, perceptually decoupled decisions differentially engage sender-like, efferent-biased zones that show broader connectivity with perceptual-motor and attentional systems beyond the DMN. This double dissociation demonstrates a systematic association between DMN connectivity and engagement during perceptually coupled versus memory-guided cognitive processes, providing an organizational account of how DMN architecture relates to flexible human thought.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
OSF 9rk6m
Availability: 1 check, the latest on 29 September 2026: the link answers (HTTP 200)
- 29 September 2026: the link answers (HTTP 200)
1 file
- n-back_task_script.py, Python, 325 lines, 1 match
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;
- 1 script, each with its path and the digest of its content;
- 1 match 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
- neurovault.org/
collections/ , at neurovault.org; found in “Data, Materials, and Software Availability”13326
Data, Materials, and Software Availability
Neuroimaging data at the group-level are openly available in Neurovault at https://
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, 29 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 5 keywords, 13 MeSH terms, 2 funders, 62 references.
Cite
This paper
Zhang, M., Paquola, C., Krieger-Redwood, K., Mckeown, B., Murphy, C., Liu, C., Margulies, D. S., Leech, R., Smallwood, J., & Jefferies, E. (2026). Sender-receiver subdivisions of the default mode network in perceptual and memory-guided cognition. Proceedings of the National Academy of Sciences of the United States of America, 123(15), e2528851123. https://
BibTeX
@article{zhang2026sender
author = {Zhang, Meichao and Paquola, Casey and Krieger-Redwood, Katya and Mckeown, Brontë and Murphy, Charlotte and Liu, Chang and Margulies, Daniel S. and Leech, Robert and Smallwood, Jonathan and Jefferies, Elizabeth},
title = {{Sender-receiver subdivisions of the default mode network in perceptual and memory-guided cognition}},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
year = {2026},
month = apr,
volume = {123},
number = {15},
pages = {e2528851123},
publisher = {National Academy of Sciences},
issn = {0027-8424},
doi = {10.1073/
url = {https://
pmid = {41945445},
pmcid = {PMC13079981}
}
RIS
TY - JOUR
AU - Zhang, Meichao
AU - Paquola, Casey
AU - Krieger-Redwood, Katya
AU - Mckeown, Brontë
AU - Murphy, Charlotte
AU - Liu, Chang
AU - Margulies, Daniel S.
AU - Leech, Robert
AU - Smallwood, Jonathan
AU - Jefferies, Elizabeth
TI - Sender-receiver subdivisions of the default mode network in perceptual and memory-guided cognition
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/
VL - 123
IS - 15
SP - e2528851123
SN - 0027-8424
PB - National Academy of Sciences
DO - 10.1073/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1073/
"type": "article-journal",
"title": "Sender-receiver subdivisions of the default mode network in perceptual and memory-guided cognition",
"container-title": "Proceedings of the National Academy of Sciences of the United States of America",
"author": [
{
"family": "Zhang",
"given": "Meichao"
},
{
"family": "Paquola",
"given": "Casey"
},
{
"family": "Krieger-Redwood",
"given": "Katya"
},
{
"family": "Mckeown",
"given": "Brontë"
},
{
"family": "Murphy",
"given": "Charlotte"
},
{
"family": "Liu",
"given": "Chang"
},
{
"family": "Margulies",
"given": "Daniel S."
},
{
"family": "Leech",
"given": "Robert"
},
{
"family": "Smallwood",
"given": "Jonathan"
},
{
"family": "Jefferies",
"given": "Elizabeth"
}
],
"container-title-short":
"volume": "123",
"issue": "15",
"page": "e2528851123",
"DOI": "10.1073/
"PMID": "41945445",
"PMCID": "PMC13079981",
"ISSN": "0027-8424",
"publisher": "National Academy of Sciences",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
7
]
]
}
}
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-75841-9 [code]
- Model-based semantic distance reveals adaptive coordination of distinct cognitive systems in flexible knowledge retrieval.Journal: Nature communicationsIn common: NumPy, cognitive, 7 references, 2 authors
- [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: NumPy, fMRI, cognitive, 13 references
- [3] doi:10.1002/hbm.70536 [code]
- The Neural Processes Underpinning Flexible Semantic Retrieval in Visual and Auditory Modalities.Journal: Human brain mappingIn common: PsychoPy, NumPy, cognitive, 5 references, author Katya Krieger-Redwood
- [4] doi:10.7554/elife.103097 [code]
- Canonical neurodevelopmental trajectories of structural and functional manifolds.Journal: eLifeIn common: NumPy, 3 references, author Daniel S Margulies
- [5] doi:10.1093/brain/awag032 [code]
- A rostral prefrontal mediolateral gradient predicts creativity in frontotemporal dementia.Journal: Brain : a journal of neurologyIn common: NumPy, fMRI, 6 references
- [6] doi:10.1038/s41467-026-73153-6 [code]
- Latent neural architecture organising shared aesthetic evaluations of visual artworks.Journal: Nature communicationsIn common: NumPy, fMRI, cognitive, 6 references
- [7] 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: NumPy, fMRI, cognitive, 4 references
- [8] 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: NumPy, cognitive, 6 references
- [9] doi:10.1186/s40708-026-00312-2 [code]
- Synergistic and redundant information dynamics exhibit dissociable alterations across schizophrenia and neurodevelopmental conditions.Journal: Brain informaticsIn common: NumPy, fMRI, 6 references
- [10] doi:10.1111/ejn.70511 [code]
- The Effect of Caffeine Consumption and Acute Withdrawal on Resting-State fMRI Brain Connectivity, Mood and Cognition.Journal: The European journal of neuroscienceIn common: fMRI, cognitive, 5 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, 1 script, and 1 match 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:57f58de0b8bf78ff…
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
[.
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.
