The effects of action-based predictions in early visual cortex.
The 4 matches
- [1] § STAR★Methods › Method details › Experimental design ↔ Code.zip/Behavioural/actPredAllTraining_v2.py, lines 125–171 · score 0.73 · wrong button, rightward gratings, passive block, clockwise, leftward, soon
- [2] § STAR★Methods › Quantification and statistical analysis › Eye tracking analysis ↔ Code.zip/fMRI/actPred_v2.py, lines 90–115 · score 0.61 · SR Research, EyeLink, calibration, eyetracker, tracking
- [3] § STAR★Methods › Method details › Experimental design ↔ Code.zip/Behavioural/actPredGratingTraining_v2.py, lines 93–117 · score 0.59 · rightward gratings, fixation dot, clockwise, leftward, counterbalanced, trained
- [4] § STAR★Methods › Quantification and statistical analysis › MRI analysis ↔ Code.zip/Behavioural/actPredGratingTraining_v2.py, lines 93–117 · score 0.54 · rightward gratings, fixation dot, leftward, space, predictors, cue
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 · 363 lines · 13 KB · CC-BY-4.0 · 2 matches
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- Created on Wed Jul 7 16:13:47 2021
- @author: bianca
- """
- ##############################################################################
- #
- # ActPred3T_WP1
- #
- # !! Updated version !!
- # Cue is now fixation dot changing colour instead of enlarging
- #
- # Script to train mapping between tone and gratings.
- #
- # BvK 07-07-2021
- ##############################################################################
- from psychopy import prefs
- prefs.hardware['audioLib'] = ['PTB']
- from psychopy import visual, core, event, sound, data, gui
- import os, datetime, random, pickle
- import numpy as np
- # Add escape and q as escape keys
- #for key in ['q', 'escape']:
- # event.globalKeys.add(key, func=core.quit)
- # Paths
- #root_dir = '/analyse/Project0281/ActPred3T/'
- #src_dir = '/analyse/Project0281/ActPred3T/Behavioural/'
- #root_dir = 'C:/Users/Bianca/Work/Experiments/Glasgow_3T/Code_exp/'
- #src_dir = 'C:/Users/Bianca/Work/Experiments/Glasgow_3T/Code_exp/Behavioural/'
- root_dir = '/home/bianca/Work/Experiments/Glasgow_3T/Code_exp/actpred3T/' #linux laptop
- src_dir = root_dir + 'Behavioural/'
- #RT_dir = '/analyse/Project0281/ActPred3T/Behavioural/'
- RT_dir = root_dir + 'Behavioural/'
- # GUI to input participant number etc
- expName = 'actpred3T_gratingtraining'
- expInfo = {'Date':data.getDateStr(), 'Run':['1','2','3','4','5'], 'Participant_number': '', 'Participant_ID':''}
- diabox = gui.DlgFromDict(dictionary=expInfo,
- title=expName,
- order=['Participant_number', 'Participant_ID', 'Run', 'Date'],
- fixed=['Date'])
- s = int(expInfo['Participant_number']);
- run = int(expInfo['Run']);
- date = expInfo['Date']
- print('expinfo:', expInfo['Participant_number'])
- print('s = ', s)
- saving_dir = src_dir + 'data/p' + str(s) +'/'
- if not os.path.exists(saving_dir):
- os.makedirs(saving_dir)
- logFile = open(saving_dir + 'gratingtraining_p' + str(s) + '_run' + str(run) +'_' + date + '.txt','w')
- logFile.write('Date: \t' + expInfo['Date'] + '\n')
- logFile.write('Participant number: \t' + expInfo['Participant_number'] + '\n')
- logFile.write('Participant_ID: \t' + expInfo['Participant_ID'] + '\n')
- logFile.write('Run: \t' + expInfo['Run'] + '\n')
- logFile.write('Start: \t' + str(datetime.datetime.now()) + '\n')
- logFile.write('trialN\tPart\tCond\tPredCueOn\tpredCueOff\tCueOn\tCueOff\tTActKeyPressed\tActKeyPressed\tRT\tOrient\tStartStim1\tStopStim1\tITI\n')
- # Window
- #win = visual.Window(monitor='Laptop', units = 'deg', fullscr = True)
- #win = visual.Window([600,600], monitor='Laptop', units = 'deg')
- win = visual.Window([600,600], monitor='HomeMon', units = 'deg')
- #win = visual.Window([800,800], monitor='WorkPC', units = 'deg')
- #win = visual.Window(monitor='WorkPC', units = 'deg', fullscr = True)
- win.mouseVisible = False
- circle_color_space = 'rgb'
- subList = list(range(1,25)) #1:24
- # Load pickle file
- subsMaps = pickle.load(open(root_dir + 'mapping', 'rb'))
- # Randomise trial order for each run
- seed = random.sample(range(1000), k=1)
- random.seed(seed[0])
- conds_act = np.array([1,1,1,1,1,2,2,2,2,2])
- random.shuffle(conds_act)
- seed = random.sample(range(1000), k=1)
- random.seed(seed[0])
- conds_pas = np.array([4,4,4,4,4,5,5,5,5,5])
- random.shuffle(conds_pas)
- # Define all screens/stimuli
- part1aScreen = visual.TextStim(win, '''Part 1 \n\nWhen you hear a high tone, you will see a leftward grating. When you hear a low tone, you will see a rightward grating. \nPay close attention to the stimuli and learn which tone predicts which grating.
- \n\nPress space bar to continue''', wrapWidth=20)
- part1bScreen = visual.TextStim(win, '''Part 1 \n\nWhen you hear a high tone, you will see a rightward grating. When you hear a low tone, you will see a leftward grating. \nPay close attention to the stimuli and learn which tone predicts which grating.
- \n\nPress space bar to continue''', wrapWidth=20)
- part2aScreen = visual.TextStim(win, '''Part 2 \n\nWhen you hear a high tone, you will see a leftward grating. When you hear a low tone, you will see a rightward grating. \nPay close attention to the stimuli and learn which tone predicts which grating.
- \n\nPress space bar to continue''', wrapWidth=20)
- part2bScreen = visual.TextStim(win, '''Part 2 \n\nWhen you hear a high tone, you will see a rightward grating. When you hear a low tone, you will see a leftward grating. \nPay close attention to the stimuli and learn which tone predicts which grating.
- \n\nPress space bar to continue''', wrapWidth=20)
- part2Screen = visual.TextStim(win, '''Part 2 \n\nWhen you hear the tone, prepare for the corresponding grating to be presented. It will be presented after the fixation dot enlarges.
- \n\nPress space bar to continue''', wrapWidth=20)
- breakScreen = visual.TextStim(win, 'Questions?')
- predCueLow = sound.Sound(400,volume = 0.846, secs = 0.3)
- predCueHigh = sound.Sound(1000,volume = 0.8, secs = 0.3)
- predCueNo = sound.Sound(100,volume = 0.8, secs = 0.3)
- fix = visual.Circle(win, radius=0.15, units='deg', edges=100, lineColorSpace=circle_color_space, lineColor=[-1,-1,-1], fillColor=[-1,-1,-1], fillColorSpace=circle_color_space)
- cue = visual.Circle(win, radius=0.15, units='deg', edges=100, lineColorSpace=circle_color_space, lineColor=[1,-1,-1], fillColor=[1,-1,-1], fillColorSpace=circle_color_space)
- refStimLeft = visual.GratingStim(win,tex='sin', mask='raisedCos', maskParams = {'fringeWidth':0.1},contrast = 0.5, units='deg', ori = -45, size = 8, sf = 1.5)
- testStimLeft = visual.GratingStim(win,tex='sin', mask='raisedCos', maskParams = {'fringeWidth':0.1},contrast = 0.5, units='deg', size = 8, sf = 1.5)
- refStimRight = visual.GratingStim(win,tex='sin', mask='raisedCos', maskParams = {'fringeWidth':0.1},contrast = 0.5, units='deg', ori = 45, size = 8, sf = 1.5)
- testStimRight = visual.GratingStim(win,tex='sin', mask='raisedCos', maskParams = {'fringeWidth':0.1},contrast = 0.5, units='deg', size = 8, sf = 1.5)
- annulus = visual.Circle(win, radius=0.25, units='deg', edges=100, lineWidth = 0, fillColor = [0,0,0])
- refSound = sound.Sound(400, volume = 0.8, secs = 0.5)
- quest = visual.TextStim(win, 'Clockwise or counterclockwise?', wrapWidth=20)
- endScreen = visual.TextStim(win, 'End of run')
- def trial_sequence(cue_type, button, orient):
- pred_cue(cue_type)
- pas_trial()
- present_grating(orient)
- ITI()
- def pred_cue(cue_type):
- fix.draw()
- win.flip()
- if cue_type == 'high':
- predCueHigh.play()
- elif cue_type == 'low':
- predCueLow.play()
- elif cue_type == 'no':
- predCueNo.play()
- predCueOn = globalClock.getTime()
- cueClock.reset()
- cueClock.add(0.3)
- while cueClock.getTime() < 0:
- pass
- predCueOff = globalClock.getTime()
- logFile.write('\t'.join([str(predCueOn), str(predCueOff)])+'\t')
- def present_grating(orient):
- stimClock.reset()
- stimClock.add(0.2)
- while stimClock.getTime() < 0:
- pass
- if orient == 'left':
- refStimLeft.draw()
- elif orient == 'right':
- refStimRight.draw()
- annulus.draw()
- fix.draw()
- win.flip()
- stim1On = globalClock.getTime()
- stimClock.reset()
- stimClock.add(0.5)
- while stimClock.getTime() < 0:
- pass
- stim1Off = globalClock.getTime()
- if orient == 'left':
- logFile.write('\t'.join([str(-45), str(stim1On), str(stim1Off)])+'\t')
- elif orient == 'right':
- logFile.write('\t'.join([str(45), str(stim1On), str(stim1Off)])+'\t')
- def pas_trial():
- fix.draw()
- win.flip()
- fixClock.reset()
- fixClock.add(3)
- while fixClock.getTime() < 0:
- pass
- cue.draw()
- win.flip()
- cueOn = globalClock.getTime()
- cueClock.reset()
- cueClock.add(0.3)
- while cueClock.getTime() < 0:
- pass
- cueOff = globalClock.getTime()
- fix.draw()
- win.flip()
- RTClock.reset()
- #RTClock.add(RT_act)
- RTClock.add(1-0.2)
- while RTClock.getTime() < 0:
- pass
- logFile.write('\t'.join([str(cueOn), str(cueOff), str(-1), str(0), str(-1)])+'\t')
- def ITI():
- fix.draw()
- win.flip()
- ITIClock.reset()
- ITIClock.add(1.5)
- while ITIClock.getTime() < 0:
- pass
- logFile.write('\t'.join([str(1.5)])+'\n')
- globalClock = core.Clock()
- blockClock = core.Clock()
- cueClock = core.Clock()
- RTClock = core.Clock()
- stimClock = core.Clock()
- fixClock = core.Clock()
- isiClock = core.Clock()
- questClock = core.Clock()
- ITIClock = core.Clock()
- exit = False
- if subsMaps[s] == 1 or subsMaps[s] == 3:
- part1aScreen.draw()
- elif subsMaps[s] == 2 or subsMaps[s] == 4:
- part1bScreen.draw()
- win.flip()
- keys = ['']
- while keys[0] not in ['escape', 'space']:
- keys = event.waitKeys()
- if keys[0] == 'space':
- pass
- elif keys[0] == 'escape':
- exit = True
- win.close()
- core.quit()
- fix.draw()
- win.flip()
- blockClock.reset()
- blockClock.add(3)
- while blockClock.getTime() < 0:
- pass
- counterL = 0
- counterR = 0
- counterAct = 0
- counterPas = 0
- for trial, cond in enumerate(conds_pas,1):
- part = 1
- logFile.write('\t'.join([str(trial), str(part), str(cond)])+'\t')
- if cond == 4:
- if subsMaps[s] == 1:
- trial_sequence('high', 'left', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 2:
- trial_sequence('low', 'right', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 3:
- trial_sequence('high', 'right', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 4:
- trial_sequence('low', 'left', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif cond == 5:
- if subsMaps[s] == 1:
- trial_sequence('low', 'right', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 2:
- trial_sequence('high', 'left', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 3:
- trial_sequence('low', 'left', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 4:
- trial_sequence('high', 'right', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- #Break
- breakScreen.draw()
- win.flip()
- keys = event.waitKeys()
- #Prepare part2
- if subsMaps[s] == 1 or subsMaps[s] == 3:
- part2aScreen.draw()
- elif subsMaps[s] == 2 or subsMaps[s] == 4:
- part2bScreen.draw()
- win.flip()
- keys = ['not pressed']
- while keys[0] not in ['escape', 'space']:
- keys = event.waitKeys()
- if keys[0] == 'space':
- pass
- elif keys[0] == 'escape':
- exit = True
- win.close()
- core.quit()
- fix.draw()
- win.flip()
- blockClock.reset()
- blockClock.add(3)
- while blockClock.getTime() < 0:
- pass
- counterL = 0
- counterR = 0
- counterAct = 0
- counterPas = 0
- for trial, cond in enumerate(conds_pas,1):
- part = 2
- logFile.write('\t'.join([str(trial), str(part), str(cond)])+'\t')
- if cond == 4:
- if subsMaps[s] == 1:
- trial_sequence('high', 'left', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 2:
- trial_sequence('low', 'right', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 3:
- trial_sequence('high', 'right', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 4:
- trial_sequence('low', 'left', 'left')
- counterL = counterL + 1
- counterPas = counterPas + 1
- elif cond == 5:
- if subsMaps[s] == 1:
- trial_sequence('low', 'right', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 2:
- trial_sequence('high', 'left', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 3:
- trial_sequence('low', 'left', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- elif subsMaps[s] == 4:
- trial_sequence('high', 'right', 'right')
- counterR = counterR + 1
- counterPas = counterPas + 1
- endScreen.draw()
- win.flip()
- event.waitKeys(keyList=['escape'])
- win.close()
- core.quit()
actPredGratingTraining_v2.py, under CC-BY-4.0 · at the source
Overview
- Center for Psychiatry, Justus Liebig University Giessen, Klinikstrasse 36, 35392 Giessen, Germany
- Centre for Cognitive Neuroimaging (CCNi), School of Psychology and Neuroscience, University of Glasgow, 62 Hillhead Street, Glasgow, UK
Abstract
Voluntary action typically results in reduced sensitivity to sensory action outcomes. The forward model theory proposes that this is due to neural suppression. However, this theory has recently been challenged by the pre-activation account, sharpening, and opposing process theory. In this fMRI study, we compared these theories by using univariate and multivariate analyses. Participants performed a visual orientation discrimination task on two sequential gratings, which were presented automatically (passive condition) or triggered by button press (active condition). Decoding of predicted stimulus orientation from early visual cortex activity prior to stimulus presentation was significantly above chance in both active and passive conditions. During stimulus presentation, actively generated stimuli elicited larger blood-oxygen-level-depen
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 4 matches between paragraphs and lines of code.
Zenodo 20507627
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
8 files
- Code.zip/
Behavioural/ , Python, 676 lines, 1 matchactPredAllTraining_v2.py - Code.zip/
Behavioural/ , Python, 525 linesactPredBehav_Demo_v2.py - Code.zip/
Behavioural/ , Python, 519 linesactPredBehav_v2.py - Code.zip/
Behavioural/ , Python, 393 linesactPredButtonTraining_v2 .py - Code.zip/
Behavioural/ , Python, 363 lines, 2 matchesactPredGratingTraining_v 2.py - Code.zip/
Behavioural/ , Python, 526 linesactPredRefresher_v2.py - Code.zip/
fMRI/ , Python, 137 linesactPredStimLoc_gratings. py - Code.zip/
fMRI/ , Python, 628 lines, 1 matchactPred_v2.py
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;
- 8 scripts, each with its path and the digest of its content;
- 4 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
No dataset and no data link were found in the paper.
Data and code availability
• Data have been deposited at Zenodo and are publicly available as of the date of publication 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 2, 28 September 2026
- Authors: added Bianca M. van Kemenade (0000-0002-8631-9893); removed Bianca M. van Kemenade
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 4 keywords, 3 funders, 54 references, 4 RRIDs.
Cite
This paper
van Kemenade, B. M., & Muckli, L. F. (2026). The effects of action-based predictions in early visual cortex. iScience, 29(9), 117074. https://
BibTeX
@article{vankemenade2026
author = {van Kemenade, Bianca M. and Muckli, Lars F.},
title = {{The effects of action-based predictions in early visual cortex}},
journal = {iScience},
year = {2026},
month = aug,
volume = {29},
number = {9},
pages = {117074},
publisher = {Elsevier},
issn = {2589-0042},
doi = {10.1016/
url = {https://
pmid = {42662421},
pmcid = {PMC13520625}
}
RIS
TY - JOUR
AU - van Kemenade, Bianca M.
AU - Muckli, Lars F.
TI - The effects of action-based predictions in early visual cortex
T2 - iScience
J2 - iScience
PY - 2026
DA - 2026/
VL - 29
IS - 9
SP - 117074
SN - 2589-0042
PB - Elsevier
DO - 10.1016/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1016/
"type": "article-journal",
"title": "The effects of action-based predictions in early visual cortex",
"container-title": "iScience",
"author": [
{
"family": "van Kemenade",
"given": "Bianca M."
},
{
"family": "Muckli",
"given": "Lars F."
}
],
"container-title-short":
"volume": "29",
"issue": "9",
"page": "117074",
"DOI": "10.1016/
"PMID": "42662421",
"PMCID": "PMC13520625",
"ISSN": "2589-0042",
"publisher": "Elsevier",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
18
]
]
}
}
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.1523/jneurosci.0889-25.2026 [code]
- Neural Evidence for Action-Related Somatosensory Predictions.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: 15 references
- [2] doi:10.7554/elife.103689 [code]
- Dissociable dynamic effects of expectation during statistical learning.Journal: eLifeIn common: 6 references
- [3] doi:10.1523/jneurosci.0154-26.2026 [code]
- Faster but less precise: expectation enhances response speed while reducing sensory fidelity.Journal: The Journal of neuroscience : the official journal of the Society for NeuroscienceIn common: 6 references
- [4] doi:10.1016/j.neuroimage.2026.122004
- Preventing visual feedback of the moving limb during grasping preferentially activates parietofrontal premotor areas.Journal: NeuroImageIn common: fMRI, systems, 2 references
- [5] doi:10.1038/s41467-026-74824-0 [code]
- Learning regularities in noise engages both neural predictive activity and representational changes.Journal: Nature communicationsIn common: NumPy, 2 references
- [6] doi:10.3758/s13428-026-03150-6 [code]
- Tetrix: A novel Tetris-based paradigm for neuroimaging research and clinical applications.Journal: Behavior research methodsIn common: PsychoPy, NumPy, fMRI
- [7] doi:10.1016/j.dcn.2026.101791 [code]
- Age-related differences in hippocampal network engagement during safety processing in adolescents.Journal: Developmental cognitive neuroscienceIn common: PsychoPy, NumPy, fMRI
- [8] doi:10.1162/nol.a.271 [code]
- Compositional Complexity in Text and Images.Journal: Neurobiology of language (Cambridge, Mass.)In common: PsychoPy, NumPy, fMRI
- [9] doi:10.1038/s41380-026-03694-1 [code]
- Targeting cortico-striatal-amygdal
ar networks via theta-band frontoparietal synchronization in opioid use disorder: a randomized tACS-fMRI Trial. Journal: Molecular psychiatryIn common: PsychoPy, NumPy, fMRI - [10] doi:10.1038/s41467-026-72605-3 [code]
- Resolving mesoscale brainstem-prefrontal-str
iatal pathways underlying decisions upon salient events using submillimeter-resolution fMRI. Journal: Nature communicationsIn common: PsychoPy, NumPy, fMRI
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, 8 scripts, and 4 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:a369803f6358404e…
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.
