<i>From concept to proof:</i> developing a neurofeedback-fNIRS protocol to train self-regulation for music performance anxiety in adolescent musicians.
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 · 1,881 lines · 77 KB · no license
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- This experiment was created using PsychoPy3 Experiment Builder (v2024.2.4),
- on June 11, 2025, at 16:41
- If you publish work using this script the most relevant publication is:
- Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019)
- PsychoPy2: Experiments in behavior made easy Behav Res 51: 195.
- https://doi.org/10.3758/s13428-018-01193-y
- """
- # --- Import packages ---
- from psychopy import locale_setup
- from psychopy import prefs
- from psychopy import plugins
- plugins.activatePlugins()
- prefs.hardware['audioLib'] = 'ptb'
- prefs.hardware['audioLatencyMode'] = '3'
- from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout, hardware
- from psychopy.tools import environmenttools
- from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED,
- STOPPED, FINISHED, PRESSED, RELEASED, FOREVER, priority)
- import numpy as np # whole numpy lib is available, prepend 'np.'
- from numpy import (sin, cos, tan, log, log10, pi, average,
- sqrt, std, deg2rad, rad2deg, linspace, asarray)
- from numpy.random import random, randint, normal, shuffle, choice as randchoice
- import os # handy system and path functions
- import sys # to get file system encoding
- import psychopy.iohub as io
- from psychopy.hardware import keyboard
- # Run 'Before Experiment' code from code
- import random
- from pylsl import StreamInfo, StreamOutlet # import required classes
- situations = {
- "Situation1": './BIN/Recordings/Situation1/',
- "Situation2": './BIN/Recordings/Situation2/',
- "Situation3": './BIN/Recordings/Situation3/',
- "Situation4": './BIN/Recordings/Situation4/',
- "Situation5": './BIN/Recordings/Situation5/',
- "Situation6": './BIN/Recordings/Situation6/',
- "Situation7": './BIN/Recordings/Situation7/',
- "Situation8": './BIN/Recordings/Situation8/',
- "Situation9": './BIN/Recordings/Situation9/',
- "Situation10": './BIN/Recordings/Situation10/',
- "Situation11": './BIN/Recordings/Situation11/',
- "Situation12": './BIN/Recordings/Situation12/',
- "Situation13": './BIN/Recordings/Situation13/',
- "Situation14": './BIN/Recordings/Situation14/',
- "Situation15": './BIN/Recordings/Situation15/',
- "Situation16": './BIN/Recordings/Situation16/',
- "Situation17": './BIN/Recordings/Situation17/',
- "Situation18": './BIN/Recordings/Situation18/',
- "Situation19": './BIN/Recordings/Situation19/'
- }
- iteration = 0
- iteration_ctr = 0
- ctr_lst = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
- str_lst = [1,2,3,4,5]
- # Run 'Before Experiment' code from code_7
- import time
- # --- Setup global variables (available in all functions) ---
- # create a device manager to handle hardware (keyboards, mice, mirophones, speakers, etc.)
- deviceManager = hardware.DeviceManager()
- # ensure that relative paths start from the same directory as this script
- _thisDir = os.path.dirname(os.path.abspath(__file__))
- # store info about the experiment session
- psychopyVersion = '2024.2.4'
- expName = 'Model of training' # from the Builder filename that created this script
- # information about this experiment
- expInfo = {
- 'participant': f"{randint(0, 999999):06.0f}",
- 'session': '001',
- 'Situation': '',
- 'date|hid': data.getDateStr(),
- 'expName|hid': expName,
- 'psychopyVersion|hid': psychopyVersion,
- }
- # --- Define some variables which will change depending on pilot mode ---
- '''
- To run in pilot mode, either use the run/pilot toggle in Builder, Coder and Runner,
- or run the experiment with `--pilot` as an argument. To change what pilot
- #mode does, check out the 'Pilot mode' tab in preferences.
- '''
- # work out from system args whether we are running in pilot mode
- PILOTING = core.setPilotModeFromArgs()
- # start off with values from experiment settings
- _fullScr = False
- _winSize = [800, 900]
- # if in pilot mode, apply overrides according to preferences
- if PILOTING:
- # force windowed mode
- if prefs.piloting['forceWindowed']:
- _fullScr = False
- # set window size
- _winSize = prefs.piloting['forcedWindowSize']
- def showExpInfoDlg(expInfo):
- """
- Show participant info dialog.
- Parameters
- ==========
- expInfo : dict
- Information about this experiment.
- Returns
- ==========
- dict
- Information about this experiment.
- """
- # show participant info dialog
- dlg = gui.DlgFromDict(
- dictionary=expInfo, sortKeys=False, title=expName, alwaysOnTop=True
- )
- if dlg.OK == False:
- core.quit() # user pressed cancel
- # return expInfo
- return expInfo
- def setupData(expInfo, dataDir=None):
- """
- Make an ExperimentHandler to handle trials and saving.
- Parameters
- ==========
- expInfo : dict
- Information about this experiment, created by the `setupExpInfo` function.
- dataDir : Path, str or None
- Folder to save the data to, leave as None to create a folder in the current directory.
- Returns
- ==========
- psychopy.data.ExperimentHandler
- Handler object for this experiment, contains the data to save and information about
- where to save it to.
- """
- # remove dialog-specific syntax from expInfo
- for key, val in expInfo.copy().items():
- newKey, _ = data.utils.parsePipeSyntax(key)
- expInfo[newKey] = expInfo.pop(key)
- # data file name stem = absolute path + name; later add .psyexp, .csv, .log, etc
- if dataDir is None:
- dataDir = _thisDir
- filename = u'data/%s_%s_%s' % (expInfo['participant'], expName, expInfo['date'])
- # make sure filename is relative to dataDir
- if os.path.isabs(filename):
- dataDir = os.path.commonprefix([dataDir, filename])
- filename = os.path.relpath(filename, dataDir)
- # an ExperimentHandler isn't essential but helps with data saving
- thisExp = data.ExperimentHandler(
- name=expName, version='',
- extraInfo=expInfo, runtimeInfo=None,
- originPath='C:\\Users\\User\\Desktop\\Musa\\Musa - Protocolo Pedro\\Model of training_lastrun.py',
- savePickle=True, saveWideText=True,
- dataFileName=dataDir + os.sep + filename, sortColumns='time'
- )
- thisExp.setPriority('thisRow.t', priority.CRITICAL)
- thisExp.setPriority('expName', priority.LOW)
- # return experiment handler
- return thisExp
- def setupLogging(filename):
- """
- Setup a log file and tell it what level to log at.
- Parameters
- ==========
- filename : str or pathlib.Path
- Filename to save log file and data files as, doesn't need an extension.
- Returns
- ==========
- psychopy.logging.LogFile
- Text stream to receive inputs from the logging system.
- """
- # set how much information should be printed to the console / app
- if PILOTING:
- logging.console.setLevel(
- prefs.piloting['pilotConsoleLoggingLevel']
- )
- else:
- logging.console.setLevel('warning')
- # save a log file for detail verbose info
- logFile = logging.LogFile(filename+'.log')
- if PILOTING:
- logFile.setLevel(
- prefs.piloting['pilotLoggingLevel']
- )
- else:
- logFile.setLevel(
- logging.getLevel('info')
- )
- return logFile
- def setupWindow(expInfo=None, win=None):
- """
- Setup the Window
- Parameters
- ==========
- expInfo : dict
- Information about this experiment, created by the `setupExpInfo` function.
- win : psychopy.visual.Window
- Window to setup - leave as None to create a new window.
- Returns
- ==========
- psychopy.visual.Window
- Window in which to run this experiment.
- """
- if win is None:
- # if not given a window to setup, make one
- win = visual.Window(
- size=_winSize, fullscr=_fullScr, screen=0,
- winType='pyglet', allowGUI=True, allowStencil=False,
- monitor='testMonitor', color=[0,0,0], colorSpace='rgb',
- backgroundImage='', backgroundFit='none',
- blendMode='avg', useFBO=True,
- units='height',
- checkTiming=False # we're going to do this ourselves in a moment
- )
- else:
- # if we have a window, just set the attributes which are safe to set
- win.color = [0,0,0]
- win.colorSpace = 'rgb'
- win.backgroundImage = ''
- win.backgroundFit = 'none'
- win.units = 'height'
- if expInfo is not None:
- # get/measure frame rate if not already in expInfo
- if win._monitorFrameRate is None:
- win._monitorFrameRate = win.getActualFrameRate(infoMsg='Attempting to measure frame rate of screen, please wait...')
- expInfo['frameRate'] = win._monitorFrameRate
- win.hideMessage()
- # show a visual indicator if we're in piloting mode
- if PILOTING and prefs.piloting['showPilotingIndicator']:
- win.showPilotingIndicator()
- return win
- def setupDevices(expInfo, thisExp, win):
- """
- Setup whatever devices are available (mouse, keyboard, speaker, eyetracker, etc.) and add them to
- the device manager (deviceManager)
- Parameters
- ==========
- expInfo : dict
- Information about this experiment, created by the `setupExpInfo` function.
- thisExp : psychopy.data.ExperimentHandler
- Handler object for this experiment, contains the data to save and information about
- where to save it to.
- win : psychopy.visual.Window
- Window in which to run this experiment.
- Returns
- ==========
- bool
- True if completed successfully.
- """
- # --- Setup input devices ---
- ioConfig = {}
- # Setup iohub keyboard
- ioConfig['Keyboard'] = dict(use_keymap='psychopy')
- # Setup iohub experiment
- ioConfig['Experiment'] = dict(filename=thisExp.dataFileName)
- # Start ioHub server
- ioServer = io.launchHubServer(window=win, **ioConfig)
- # store ioServer object in the device manager
- deviceManager.ioServer = ioServer
- # create a default keyboard (e.g. to check for escape)
- if deviceManager.getDevice('defaultKeyboard') is None:
- deviceManager.addDevice(
- deviceClass='keyboard', deviceName='defaultKeyboard', backend='iohub'
- )
- if deviceManager.getDevice('key_resp') is None:
- # initialise key_resp
- key_resp = deviceManager.addDevice(
- deviceClass='keyboard',
- deviceName='key_resp',
- )
- # create speaker 'sound_1'
- deviceManager.addDevice(
- deviceName='sound_1',
- deviceClass='psychopy.hardware.speaker.SpeakerDevice',
- index=-1
- )
- # create speaker 'sound_2'
- deviceManager.addDevice(
- deviceName='sound_2',
- deviceClass='psychopy.hardware.speaker.SpeakerDevice',
- index=-1
- )
- # create speaker 'sound_3'
- deviceManager.addDevice(
- deviceName='sound_3',
- deviceClass='psychopy.hardware.speaker.SpeakerDevice',
- index=-1
- )
- # return True if completed successfully
- return True
- def pauseExperiment(thisExp, win=None, timers=[], playbackComponents=[]):
- """
- Pause this experiment, preventing the flow from advancing to the next routine until resumed.
- Parameters
- ==========
- thisExp : psychopy.data.ExperimentHandler
- Handler object for this experiment, contains the data to save and information about
- where to save it to.
- win : psychopy.visual.Window
- Window for this experiment.
- timers : list, tuple
- List of timers to reset once pausing is finished.
- playbackComponents : list, tuple
- List of any components with a `pause` method which need to be paused.
- """
- # if we are not paused, do nothing
- if thisExp.status != PAUSED:
- return
- # start a timer to figure out how long we're paused for
- pauseTimer = core.Clock()
- # pause any playback components
- for comp in playbackComponents:
- comp.pause()
- # make sure we have a keyboard
- defaultKeyboard = deviceManager.getDevice('defaultKeyboard')
- if defaultKeyboard is None:
- defaultKeyboard = deviceManager.addKeyboard(
- deviceClass='keyboard',
- deviceName='defaultKeyboard',
- backend='ioHub',
- )
- # run a while loop while we wait to unpause
- while thisExp.status == PAUSED:
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=['escape']):
- endExperiment(thisExp, win=win)
- # sleep 1ms so other threads can execute
- clock.time.sleep(0.001)
- # if stop was requested while paused, quit
- if thisExp.status == FINISHED:
- endExperiment(thisExp, win=win)
- # resume any playback components
- for comp in playbackComponents:
- comp.play()
- # reset any timers
- for timer in timers:
- timer.addTime(-pauseTimer.getTime())
- def run(expInfo, thisExp, win, globalClock=None, thisSession=None):
- """
- Run the experiment flow.
- Parameters
- ==========
- expInfo : dict
- Information about this experiment, created by the `setupExpInfo` function.
- thisExp : psychopy.data.ExperimentHandler
- Handler object for this experiment, contains the data to save and information about
- where to save it to.
- psychopy.visual.Window
- Window in which to run this experiment.
- globalClock : psychopy.core.clock.Clock or None
- Clock to get global time from - supply None to make a new one.
- thisSession : psychopy.session.Session or None
- Handle of the Session object this experiment is being run from, if any.
- """
- # mark experiment as started
- thisExp.status = STARTED
- # make sure window is set to foreground to prevent losing focus
- win.winHandle.activate()
- # make sure variables created by exec are available globally
- exec = environmenttools.setExecEnvironment(globals())
- # get device handles from dict of input devices
- ioServer = deviceManager.ioServer
- # get/create a default keyboard (e.g. to check for escape)
- defaultKeyboard = deviceManager.getDevice('defaultKeyboard')
- if defaultKeyboard is None:
- deviceManager.addDevice(
- deviceClass='keyboard', deviceName='defaultKeyboard', backend='ioHub'
- )
- eyetracker = deviceManager.getDevice('eyetracker')
- # make sure we're running in the directory for this experiment
- os.chdir(_thisDir)
- # get filename from ExperimentHandler for convenience
- filename = thisExp.dataFileName
- frameTolerance = 0.001 # how close to onset before 'same' frame
- endExpNow = False # flag for 'escape' or other condition => quit the exp
- # get frame duration from frame rate in expInfo
- if 'frameRate' in expInfo and expInfo['frameRate'] is not None:
- frameDur = 1.0 / round(expInfo['frameRate'])
- else:
- frameDur = 1.0 / 60.0 # could not measure, so guess
- # Start Code - component code to be run after the window creation
- # --- Initialize components for Routine "Prep" ---
- # Run 'Begin Experiment' code from code
- info = StreamInfo(name='Trigger', type='Markers', channel_count=1, channel_format='int32', source_id='Example')
- outlet = StreamOutlet(info)
- group = expInfo['Situation']
- sess = expInfo['session']
- if group == "1":
- folder = situations["Situation1"]
- elif group == "2":
- folder = situations["Situation2"]
- elif group == "3":
- folder = situations["Situation3"]
- elif group == "4":
- folder = situations["Situation4"]
- elif group == "5":
- folder = situations["Situation5"]
- elif group == "6":
- folder = situations["Situation6"]
- elif group == "7":
- folder = situations["Situation7"]
- elif group == "8":
- folder = situations["Situation8"]
- elif group == "9":
- folder = situations["Situation9"]
- elif group == "10":
- folder = situations["Situation10"]
- elif group == "11":
- folder = situations["Situation11"]
- elif group == "12":
- folder = situations["Situation12"]
- elif group == "13":
- folder = situations["Situation13"]
- elif group == "14":
- folder = situations["Situation14"]
- elif group == "15":
- folder = situations["Situation15"]
- elif group == "16":
- folder = situations["Situation16"]
- elif group == "17":
- folder = situations["Situation17"]
- elif group == "18":
- folder = situations["Situation18"]
- elif group == "19":
- folder = situations["Situation19"]
- random.shuffle(ctr_lst)
- random.shuffle(str_lst)
- # --- Initialize components for Routine "check_lsl" ---
- key_resp = keyboard.Keyboard(deviceName='key_resp')
- text_4 = visual.TextStim(win=win, name='text_4',
- text='Por favor verifique se a luz verde de trigger está presente no programa aurora antes de avançar.\n\nApós verificar o trigger pode explicar ao participante como procederá a sessão. Explique a tarefa de linha de base:\n\n"Por favor sente-se relaxado e como os olhos fechados durante os próximos 3 minutos, eu aviso quando o tempo chegar ao fim."\n\nApós verificar pode começar o protocolo com a barra de espaços.',
- font='Arial',
- pos=(0, 0), draggable=False, height=0.05, wrapWidth=None, ori=0.0,
- color='white', colorSpace='rgb', opacity=None,
- languageStyle='LTR',
- depth=-1.0);
- # --- Initialize components for Routine "baseline" ---
- polygon = visual.ShapeStim(
- win=win, name='polygon', vertices='cross',
- size=(0.5, 0.5),
- ori=0.0, pos=(0, 0), draggable=False, anchor='center',
- lineWidth=1.0,
- colorSpace='rgb', lineColor='white', fillColor='white',
- opacity=None, depth=-1.0, interpolate=True)
- # --- Initialize components for Routine "present_situation" ---
- sound_1 = sound.Sound(
- 'A',
- secs=-1,
- stereo=True,
- hamming=True,
- speaker='sound_1', name='sound_1'
- )
- sound_1.setVolume(1.0)
- text = visual.TextStim(win=win, name='text',
- text='Explicação de contexto a decorrer\n',
- font='Arial',
- pos=(0, 0), draggable=False, height=0.05, wrapWidth=None, ori=0.0,
- color='white', colorSpace='rgb', opacity=None,
- languageStyle='LTR',
- depth=-2.0);
- # --- Initialize components for Routine "it_setter" ---
- # --- Initialize components for Routine "stressor" ---
- sound_2 = sound.Sound(
- 'A',
- secs=-1,
- stereo=True,
- hamming=True,
- speaker='sound_2', name='sound_2'
- )
- sound_2.setVolume(1.0)
- text_2 = visual.TextStim(win=win, name='text_2',
- text='A apresentar stressor',
- font='Arial',
- pos=(0, 0), draggable=False, height=0.05, wrapWidth=None, ori=0.0,
- color='white', colorSpace='rgb', opacity=None,
- languageStyle='LTR',
- depth=-2.0);
- # --- Initialize components for Routine "it_ctr" ---
- # --- Initialize components for Routine "control" ---
- sound_3 = sound.Sound(
- 'A',
- secs=-1,
- stereo=True,
- hamming=True,
- speaker='sound_3', name='sound_3'
- )
- sound_3.setVolume(1.0)
- text_3 = visual.TextStim(win=win, name='text_3',
- text='A apresentar controlo',
- font='Arial',
- pos=(0, 0), draggable=False, height=0.05, wrapWidth=None, ori=0.0,
- color='white', colorSpace='rgb', opacity=None,
- languageStyle='LTR',
- depth=-2.0);
- # --- Initialize components for Routine "ender" ---
- text_7 = visual.TextStim(win=win, name='text_7',
- text='Sessão finalizada\n',
- font='Arial',
- pos=(0, 0), draggable=False, height=0.05, wrapWidth=None, ori=0.0,
- color='white', colorSpace='rgb', opacity=None,
- languageStyle='LTR',
- depth=-1.0);
- # create some handy timers
- # global clock to track the time since experiment started
- if globalClock is None:
- # create a clock if not given one
- globalClock = core.Clock()
- if isinstance(globalClock, str):
- # if given a string, make a clock accoridng to it
- if globalClock == 'float':
- # get timestamps as a simple value
- globalClock = core.Clock(format='float')
- elif globalClock == 'iso':
- # get timestamps in ISO format
- globalClock = core.Clock(format='%Y-%m-%d_%H:%M:%S.%f%z')
- else:
- # get timestamps in a custom format
- globalClock = core.Clock(format=globalClock)
- if ioServer is not None:
- ioServer.syncClock(globalClock)
- logging.setDefaultClock(globalClock)
- # routine timer to track time remaining of each (possibly non-slip) routine
- routineTimer = core.Clock()
- win.flip() # flip window to reset last flip timer
- # store the exact time the global clock started
- expInfo['expStart'] = data.getDateStr(
- format='%Y-%m-%d %Hh%M.%S.%f %z', fractionalSecondDigits=6
- )
- # --- Prepare to start Routine "Prep" ---
- # create an object to store info about Routine Prep
- Prep = data.Routine(
- name='Prep',
- components=[],
- )
- Prep.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code
- outlet.push_sample(x=[0])
- # store start times for Prep
- Prep.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- Prep.tStart = globalClock.getTime(format='float')
- Prep.status = STARTED
- thisExp.addData('Prep.started', Prep.tStart)
- Prep.maxDuration = None
- # keep track of which components have finished
- PrepComponents = Prep.components
- for thisComponent in Prep.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "Prep" ---
- Prep.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- Prep.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in Prep.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "Prep" ---
- for thisComponent in Prep.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for Prep
- Prep.tStop = globalClock.getTime(format='float')
- Prep.tStopRefresh = tThisFlipGlobal
- thisExp.addData('Prep.stopped', Prep.tStop)
- thisExp.nextEntry()
- # the Routine "Prep" was not non-slip safe, so reset the non-slip timer
- routineTimer.reset()
- # --- Prepare to start Routine "check_lsl" ---
- # create an object to store info about Routine check_lsl
- check_lsl = data.Routine(
- name='check_lsl',
- components=[key_resp, text_4],
- )
- check_lsl.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # create starting attributes for key_resp
- key_resp.keys = []
- key_resp.rt = []
- _key_resp_allKeys = []
- # store start times for check_lsl
- check_lsl.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- check_lsl.tStart = globalClock.getTime(format='float')
- check_lsl.status = STARTED
- thisExp.addData('check_lsl.started', check_lsl.tStart)
- check_lsl.maxDuration = None
- # keep track of which components have finished
- check_lslComponents = check_lsl.components
- for thisComponent in check_lsl.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "check_lsl" ---
- check_lsl.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # *key_resp* updates
- waitOnFlip = False
- # if key_resp is starting this frame...
- if key_resp.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- key_resp.frameNStart = frameN # exact frame index
- key_resp.tStart = t # local t and not account for scr refresh
- key_resp.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(key_resp, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'key_resp.started')
- # update status
- key_resp.status = STARTED
- # keyboard checking is just starting
- waitOnFlip = True
- win.callOnFlip(key_resp.clock.reset) # t=0 on next screen flip
- win.callOnFlip(key_resp.clearEvents, eventType='keyboard') # clear events on next screen flip
- if key_resp.status == STARTED and not waitOnFlip:
- theseKeys = key_resp.getKeys(keyList=['space'], ignoreKeys=["escape"], waitRelease=False)
- _key_resp_allKeys.extend(theseKeys)
- if len(_key_resp_allKeys):
- key_resp.keys = _key_resp_allKeys[-1].name # just the last key pressed
- key_resp.rt = _key_resp_allKeys[-1].rt
- key_resp.duration = _key_resp_allKeys[-1].duration
- # a response ends the routine
- continueRoutine = False
- # *text_4* updates
- # if text_4 is starting this frame...
- if text_4.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- text_4.frameNStart = frameN # exact frame index
- text_4.tStart = t # local t and not account for scr refresh
- text_4.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(text_4, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_4.started')
- # update status
- text_4.status = STARTED
- text_4.setAutoDraw(True)
- # if text_4 is active this frame...
- if text_4.status == STARTED:
- # update params
- pass
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- check_lsl.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in check_lsl.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "check_lsl" ---
- for thisComponent in check_lsl.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for check_lsl
- check_lsl.tStop = globalClock.getTime(format='float')
- check_lsl.tStopRefresh = tThisFlipGlobal
- thisExp.addData('check_lsl.stopped', check_lsl.tStop)
- # check responses
- if key_resp.keys in ['', [], None]: # No response was made
- key_resp.keys = None
- thisExp.addData('key_resp.keys',key_resp.keys)
- if key_resp.keys != None: # we had a response
- thisExp.addData('key_resp.rt', key_resp.rt)
- thisExp.addData('key_resp.duration', key_resp.duration)
- thisExp.nextEntry()
- # the Routine "check_lsl" was not non-slip safe, so reset the non-slip timer
- routineTimer.reset()
- # --- Prepare to start Routine "baseline" ---
- # create an object to store info about Routine baseline
- baseline = data.Routine(
- name='baseline',
- components=[polygon],
- )
- baseline.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code_7
- outlet.push_sample(x=[1])
- start = time.time()
- texted = 0
- # store start times for baseline
- baseline.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- baseline.tStart = globalClock.getTime(format='float')
- baseline.status = STARTED
- thisExp.addData('baseline.started', baseline.tStart)
- baseline.maxDuration = None
- # keep track of which components have finished
- baselineComponents = baseline.components
- for thisComponent in baseline.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "baseline" ---
- baseline.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine and routineTimer.getTime() < 180.0:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # Run 'Each Frame' code from code_7
- timer = time.time() - start
- texted = f'{timer}'
- if timer > 180:
- continueRoutine = False
- # *polygon* updates
- # if polygon is starting this frame...
- if polygon.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- polygon.frameNStart = frameN # exact frame index
- polygon.tStart = t # local t and not account for scr refresh
- polygon.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(polygon, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'polygon.started')
- # update status
- polygon.status = STARTED
- polygon.setAutoDraw(True)
- # if polygon is active this frame...
- if polygon.status == STARTED:
- # update params
- pass
- # if polygon is stopping this frame...
- if polygon.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > polygon.tStartRefresh + 180-frameTolerance:
- # keep track of stop time/frame for later
- polygon.tStop = t # not accounting for scr refresh
- polygon.tStopRefresh = tThisFlipGlobal # on global time
- polygon.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'polygon.stopped')
- # update status
- polygon.status = FINISHED
- polygon.setAutoDraw(False)
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- baseline.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in baseline.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "baseline" ---
- for thisComponent in baseline.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for baseline
- baseline.tStop = globalClock.getTime(format='float')
- baseline.tStopRefresh = tThisFlipGlobal
- thisExp.addData('baseline.stopped', baseline.tStop)
- # Run 'End Routine' code from code_7
- outlet.push_sample(x=[2])
- # using non-slip timing so subtract the expected duration of this Routine (unless ended on request)
- if baseline.maxDurationReached:
- routineTimer.addTime(-baseline.maxDuration)
- elif baseline.forceEnded:
- routineTimer.reset()
- else:
- routineTimer.addTime(-180.000000)
- thisExp.nextEntry()
- # --- Prepare to start Routine "present_situation" ---
- # create an object to store info about Routine present_situation
- present_situation = data.Routine(
- name='present_situation',
- components=[sound_1, text],
- )
- present_situation.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code_2
- outlet.push_sample(x=[3])
- sound_1.setSound(f'{folder}situation.wav', secs=60, hamming=True)
- sound_1.setVolume(1.0, log=False)
- sound_1.seek(0)
- # store start times for present_situation
- present_situation.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- present_situation.tStart = globalClock.getTime(format='float')
- present_situation.status = STARTED
- thisExp.addData('present_situation.started', present_situation.tStart)
- present_situation.maxDuration = None
- # keep track of which components have finished
- present_situationComponents = present_situation.components
- for thisComponent in present_situation.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "present_situation" ---
- present_situation.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine and routineTimer.getTime() < 60.0:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # *sound_1* updates
- # if sound_1 is starting this frame...
- if sound_1.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- sound_1.frameNStart = frameN # exact frame index
- sound_1.tStart = t # local t and not account for scr refresh
- sound_1.tStartRefresh = tThisFlipGlobal # on global time
- # add timestamp to datafile
- thisExp.addData('sound_1.started', tThisFlipGlobal)
- # update status
- sound_1.status = STARTED
- sound_1.play(when=win) # sync with win flip
- # if sound_1 is stopping this frame...
- if sound_1.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > sound_1.tStartRefresh + 60-frameTolerance or sound_1.isFinished:
- # keep track of stop time/frame for later
- sound_1.tStop = t # not accounting for scr refresh
- sound_1.tStopRefresh = tThisFlipGlobal # on global time
- sound_1.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'sound_1.stopped')
- # update status
- sound_1.status = FINISHED
- sound_1.stop()
- # *text* updates
- # if text is starting this frame...
- if text.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- text.frameNStart = frameN # exact frame index
- text.tStart = t # local t and not account for scr refresh
- text.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(text, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text.started')
- # update status
- text.status = STARTED
- text.setAutoDraw(True)
- # if text is active this frame...
- if text.status == STARTED:
- # update params
- pass
- # if text is stopping this frame...
- if text.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > text.tStartRefresh + 60-frameTolerance:
- # keep track of stop time/frame for later
- text.tStop = t # not accounting for scr refresh
- text.tStopRefresh = tThisFlipGlobal # on global time
- text.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text.stopped')
- # update status
- text.status = FINISHED
- text.setAutoDraw(False)
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[sound_1]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- present_situation.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in present_situation.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "present_situation" ---
- for thisComponent in present_situation.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for present_situation
- present_situation.tStop = globalClock.getTime(format='float')
- present_situation.tStopRefresh = tThisFlipGlobal
- thisExp.addData('present_situation.stopped', present_situation.tStop)
- # Run 'End Routine' code from code_2
- outlet.push_sample(x=[4])
- sound_1.pause() # ensure sound has stopped at end of Routine
- # using non-slip timing so subtract the expected duration of this Routine (unless ended on request)
- if present_situation.maxDurationReached:
- routineTimer.addTime(-present_situation.maxDuration)
- elif present_situation.forceEnded:
- routineTimer.reset()
- else:
- routineTimer.addTime(-60.000000)
- thisExp.nextEntry()
- # set up handler to look after randomisation of conditions etc
- trials = data.TrialHandler2(
- name='trials',
- nReps=5.0,
- method='random',
- extraInfo=expInfo,
- originPath=-1,
- trialList=[None],
- seed=None,
- )
- thisExp.addLoop(trials) # add the loop to the experiment
- thisTrial = trials.trialList[0] # so we can initialise stimuli with some values
- # abbreviate parameter names if possible (e.g. rgb = thisTrial.rgb)
- if thisTrial != None:
- for paramName in thisTrial:
- globals()[paramName] = thisTrial[paramName]
- if thisSession is not None:
- # if running in a Session with a Liaison client, send data up to now
- thisSession.sendExperimentData()
- for thisTrial in trials:
- currentLoop = trials
- thisExp.timestampOnFlip(win, 'thisRow.t', format=globalClock.format)
- if thisSession is not None:
- # if running in a Session with a Liaison client, send data up to now
- thisSession.sendExperimentData()
- # abbreviate parameter names if possible (e.g. rgb = thisTrial.rgb)
- if thisTrial != None:
- for paramName in thisTrial:
- globals()[paramName] = thisTrial[paramName]
- # --- Prepare to start Routine "it_setter" ---
- # create an object to store info about Routine it_setter
- it_setter = data.Routine(
- name='it_setter',
- components=[],
- )
- it_setter.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code_3
- iteration = str_lst.pop(0)
- stressvar = f'stressvar{iteration}'
- # store start times for it_setter
- it_setter.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- it_setter.tStart = globalClock.getTime(format='float')
- it_setter.status = STARTED
- thisExp.addData('it_setter.started', it_setter.tStart)
- it_setter.maxDuration = None
- # keep track of which components have finished
- it_setterComponents = it_setter.components
- for thisComponent in it_setter.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "it_setter" ---
- # if trial has changed, end Routine now
- if isinstance(trials, data.TrialHandler2) and thisTrial.thisN != trials.thisTrial.thisN:
- continueRoutine = False
- it_setter.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- it_setter.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in it_setter.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "it_setter" ---
- for thisComponent in it_setter.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for it_setter
- it_setter.tStop = globalClock.getTime(format='float')
- it_setter.tStopRefresh = tThisFlipGlobal
- thisExp.addData('it_setter.stopped', it_setter.tStop)
- # the Routine "it_setter" was not non-slip safe, so reset the non-slip timer
- routineTimer.reset()
- # --- Prepare to start Routine "stressor" ---
- # create an object to store info about Routine stressor
- stressor = data.Routine(
- name='stressor',
- components=[sound_2, text_2],
- )
- stressor.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code_4
- outlet.push_sample(x=[5])
- sound_2.setSound(f'./BIN/Recordings/Session/Session{sess}/{stressvar}.wav', secs=30, hamming=True)
- sound_2.setVolume(1.0, log=False)
- sound_2.seek(0)
- # store start times for stressor
- stressor.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- stressor.tStart = globalClock.getTime(format='float')
- stressor.status = STARTED
- thisExp.addData('stressor.started', stressor.tStart)
- stressor.maxDuration = None
- # keep track of which components have finished
- stressorComponents = stressor.components
- for thisComponent in stressor.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "stressor" ---
- # if trial has changed, end Routine now
- if isinstance(trials, data.TrialHandler2) and thisTrial.thisN != trials.thisTrial.thisN:
- continueRoutine = False
- stressor.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine and routineTimer.getTime() < 30.0:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # *sound_2* updates
- # if sound_2 is starting this frame...
- if sound_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- sound_2.frameNStart = frameN # exact frame index
- sound_2.tStart = t # local t and not account for scr refresh
- sound_2.tStartRefresh = tThisFlipGlobal # on global time
- # add timestamp to datafile
- thisExp.addData('sound_2.started', tThisFlipGlobal)
- # update status
- sound_2.status = STARTED
- sound_2.play(when=win) # sync with win flip
- # if sound_2 is stopping this frame...
- if sound_2.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > sound_2.tStartRefresh + 30-frameTolerance or sound_2.isFinished:
- # keep track of stop time/frame for later
- sound_2.tStop = t # not accounting for scr refresh
- sound_2.tStopRefresh = tThisFlipGlobal # on global time
- sound_2.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'sound_2.stopped')
- # update status
- sound_2.status = FINISHED
- sound_2.stop()
- # *text_2* updates
- # if text_2 is starting this frame...
- if text_2.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- text_2.frameNStart = frameN # exact frame index
- text_2.tStart = t # local t and not account for scr refresh
- text_2.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(text_2, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_2.started')
- # update status
- text_2.status = STARTED
- text_2.setAutoDraw(True)
- # if text_2 is active this frame...
- if text_2.status == STARTED:
- # update params
- pass
- # if text_2 is stopping this frame...
- if text_2.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > text_2.tStartRefresh + 30-frameTolerance:
- # keep track of stop time/frame for later
- text_2.tStop = t # not accounting for scr refresh
- text_2.tStopRefresh = tThisFlipGlobal # on global time
- text_2.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_2.stopped')
- # update status
- text_2.status = FINISHED
- text_2.setAutoDraw(False)
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[sound_2]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- stressor.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in stressor.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "stressor" ---
- for thisComponent in stressor.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for stressor
- stressor.tStop = globalClock.getTime(format='float')
- stressor.tStopRefresh = tThisFlipGlobal
- thisExp.addData('stressor.stopped', stressor.tStop)
- # Run 'End Routine' code from code_4
- outlet.push_sample(x=[6])
- sound_2.pause() # ensure sound has stopped at end of Routine
- # using non-slip timing so subtract the expected duration of this Routine (unless ended on request)
- if stressor.maxDurationReached:
- routineTimer.addTime(-stressor.maxDuration)
- elif stressor.forceEnded:
- routineTimer.reset()
- else:
- routineTimer.addTime(-30.000000)
- # set up handler to look after randomisation of conditions etc
- trials_2 = data.TrialHandler2(
- name='trials_2',
- nReps=5.0,
- method='random',
- extraInfo=expInfo,
- originPath=-1,
- trialList=[None],
- seed=None,
- )
- thisExp.addLoop(trials_2) # add the loop to the experiment
- thisTrial_2 = trials_2.trialList[0] # so we can initialise stimuli with some values
- # abbreviate parameter names if possible (e.g. rgb = thisTrial_2.rgb)
- if thisTrial_2 != None:
- for paramName in thisTrial_2:
- globals()[paramName] = thisTrial_2[paramName]
- if thisSession is not None:
- # if running in a Session with a Liaison client, send data up to now
- thisSession.sendExperimentData()
- for thisTrial_2 in trials_2:
- currentLoop = trials_2
- thisExp.timestampOnFlip(win, 'thisRow.t', format=globalClock.format)
- if thisSession is not None:
- # if running in a Session with a Liaison client, send data up to now
- thisSession.sendExperimentData()
- # abbreviate parameter names if possible (e.g. rgb = thisTrial_2.rgb)
- if thisTrial_2 != None:
- for paramName in thisTrial_2:
- globals()[paramName] = thisTrial_2[paramName]
- # --- Prepare to start Routine "it_ctr" ---
- # create an object to store info about Routine it_ctr
- it_ctr = data.Routine(
- name='it_ctr',
- components=[],
- )
- it_ctr.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code_6
- iteration_ctr = ctr_lst.pop(0)
- print(iteration_ctr)
- controlvar = f'controlvar{iteration_ctr}'
- # store start times for it_ctr
- it_ctr.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- it_ctr.tStart = globalClock.getTime(format='float')
- it_ctr.status = STARTED
- thisExp.addData('it_ctr.started', it_ctr.tStart)
- it_ctr.maxDuration = None
- # keep track of which components have finished
- it_ctrComponents = it_ctr.components
- for thisComponent in it_ctr.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "it_ctr" ---
- # if trial has changed, end Routine now
- if isinstance(trials_2, data.TrialHandler2) and thisTrial_2.thisN != trials_2.thisTrial.thisN:
- continueRoutine = False
- it_ctr.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- it_ctr.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in it_ctr.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "it_ctr" ---
- for thisComponent in it_ctr.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for it_ctr
- it_ctr.tStop = globalClock.getTime(format='float')
- it_ctr.tStopRefresh = tThisFlipGlobal
- thisExp.addData('it_ctr.stopped', it_ctr.tStop)
- # the Routine "it_ctr" was not non-slip safe, so reset the non-slip timer
- routineTimer.reset()
- # --- Prepare to start Routine "control" ---
- # create an object to store info about Routine control
- control = data.Routine(
- name='control',
- components=[sound_3, text_3],
- )
- control.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # Run 'Begin Routine' code from code_5
- outlet.push_sample(x=[7])
- sound_3.setSound(f'./BIN/Recordings/Session/Session{sess}/{controlvar}.wav', secs=30, hamming=True)
- sound_3.setVolume(1.0, log=False)
- sound_3.seek(0)
- # store start times for control
- control.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- control.tStart = globalClock.getTime(format='float')
- control.status = STARTED
- thisExp.addData('control.started', control.tStart)
- control.maxDuration = None
- # keep track of which components have finished
- controlComponents = control.components
- for thisComponent in control.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "control" ---
- # if trial has changed, end Routine now
- if isinstance(trials_2, data.TrialHandler2) and thisTrial_2.thisN != trials_2.thisTrial.thisN:
- continueRoutine = False
- control.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine and routineTimer.getTime() < 30.0:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # *sound_3* updates
- # if sound_3 is starting this frame...
- if sound_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- sound_3.frameNStart = frameN # exact frame index
- sound_3.tStart = t # local t and not account for scr refresh
- sound_3.tStartRefresh = tThisFlipGlobal # on global time
- # add timestamp to datafile
- thisExp.addData('sound_3.started', tThisFlipGlobal)
- # update status
- sound_3.status = STARTED
- sound_3.play(when=win) # sync with win flip
- # if sound_3 is stopping this frame...
- if sound_3.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > sound_3.tStartRefresh + 30-frameTolerance or sound_3.isFinished:
- # keep track of stop time/frame for later
- sound_3.tStop = t # not accounting for scr refresh
- sound_3.tStopRefresh = tThisFlipGlobal # on global time
- sound_3.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'sound_3.stopped')
- # update status
- sound_3.status = FINISHED
- sound_3.stop()
- # *text_3* updates
- # if text_3 is starting this frame...
- if text_3.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- text_3.frameNStart = frameN # exact frame index
- text_3.tStart = t # local t and not account for scr refresh
- text_3.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(text_3, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_3.started')
- # update status
- text_3.status = STARTED
- text_3.setAutoDraw(True)
- # if text_3 is active this frame...
- if text_3.status == STARTED:
- # update params
- pass
- # if text_3 is stopping this frame...
- if text_3.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > text_3.tStartRefresh + 30-frameTolerance:
- # keep track of stop time/frame for later
- text_3.tStop = t # not accounting for scr refresh
- text_3.tStopRefresh = tThisFlipGlobal # on global time
- text_3.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_3.stopped')
- # update status
- text_3.status = FINISHED
- text_3.setAutoDraw(False)
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[sound_3]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- control.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in control.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "control" ---
- for thisComponent in control.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for control
- control.tStop = globalClock.getTime(format='float')
- control.tStopRefresh = tThisFlipGlobal
- thisExp.addData('control.stopped', control.tStop)
- # Run 'End Routine' code from code_5
- outlet.push_sample(x=[8])
- sound_3.pause() # ensure sound has stopped at end of Routine
- # using non-slip timing so subtract the expected duration of this Routine (unless ended on request)
- if control.maxDurationReached:
- routineTimer.addTime(-control.maxDuration)
- elif control.forceEnded:
- routineTimer.reset()
- else:
- routineTimer.addTime(-30.000000)
- thisExp.nextEntry()
- # completed 5.0 repeats of 'trials_2'
- if thisSession is not None:
- # if running in a Session with a Liaison client, send data up to now
- thisSession.sendExperimentData()
- thisExp.nextEntry()
- # completed 5.0 repeats of 'trials'
- if thisSession is not None:
- # if running in a Session with a Liaison client, send data up to now
- thisSession.sendExperimentData()
- # --- Prepare to start Routine "ender" ---
- # create an object to store info about Routine ender
- ender = data.Routine(
- name='ender',
- components=[text_7],
- )
- ender.status = NOT_STARTED
- continueRoutine = True
- # update component parameters for each repeat
- # store start times for ender
- ender.tStartRefresh = win.getFutureFlipTime(clock=globalClock)
- ender.tStart = globalClock.getTime(format='float')
- ender.status = STARTED
- thisExp.addData('ender.started', ender.tStart)
- ender.maxDuration = None
- # keep track of which components have finished
- enderComponents = ender.components
- for thisComponent in ender.components:
- thisComponent.tStart = None
- thisComponent.tStop = None
- thisComponent.tStartRefresh = None
- thisComponent.tStopRefresh = None
- if hasattr(thisComponent, 'status'):
- thisComponent.status = NOT_STARTED
- # reset timers
- t = 0
- _timeToFirstFrame = win.getFutureFlipTime(clock="now")
- frameN = -1
- # --- Run Routine "ender" ---
- ender.forceEnded = routineForceEnded = not continueRoutine
- while continueRoutine and routineTimer.getTime() < 5.0:
- # get current time
- t = routineTimer.getTime()
- tThisFlip = win.getFutureFlipTime(clock=routineTimer)
- tThisFlipGlobal = win.getFutureFlipTime(clock=None)
- frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
- # update/draw components on each frame
- # *text_7* updates
- # if text_7 is starting this frame...
- if text_7.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
- # keep track of start time/frame for later
- text_7.frameNStart = frameN # exact frame index
- text_7.tStart = t # local t and not account for scr refresh
- text_7.tStartRefresh = tThisFlipGlobal # on global time
- win.timeOnFlip(text_7, 'tStartRefresh') # time at next scr refresh
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_7.started')
- # update status
- text_7.status = STARTED
- text_7.setAutoDraw(True)
- # if text_7 is active this frame...
- if text_7.status == STARTED:
- # update params
- pass
- # if text_7 is stopping this frame...
- if text_7.status == STARTED:
- # is it time to stop? (based on global clock, using actual start)
- if tThisFlipGlobal > text_7.tStartRefresh + 5-frameTolerance:
- # keep track of stop time/frame for later
- text_7.tStop = t # not accounting for scr refresh
- text_7.tStopRefresh = tThisFlipGlobal # on global time
- text_7.frameNStop = frameN # exact frame index
- # add timestamp to datafile
- thisExp.timestampOnFlip(win, 'text_7.stopped')
- # update status
- text_7.status = FINISHED
- text_7.setAutoDraw(False)
- # check for quit (typically the Esc key)
- if defaultKeyboard.getKeys(keyList=["escape"]):
- thisExp.status = FINISHED
- if thisExp.status == FINISHED or endExpNow:
- endExperiment(thisExp, win=win)
- return
- # pause experiment here if requested
- if thisExp.status == PAUSED:
- pauseExperiment(
- thisExp=thisExp,
- win=win,
- timers=[routineTimer],
- playbackComponents=[]
- )
- # skip the frame we paused on
- continue
- # check if all components have finished
- if not continueRoutine: # a component has requested a forced-end of Routine
- ender.forceEnded = routineForceEnded = True
- break
- continueRoutine = False # will revert to True if at least one component still running
- for thisComponent in ender.components:
- if hasattr(thisComponent, "status") and thisComponent.status != FINISHED:
- continueRoutine = True
- break # at least one component has not yet finished
- # refresh the screen
- if continueRoutine: # don't flip if this routine is over or we'll get a blank screen
- win.flip()
- # --- Ending Routine "ender" ---
- for thisComponent in ender.components:
- if hasattr(thisComponent, "setAutoDraw"):
- thisComponent.setAutoDraw(False)
- # store stop times for ender
- ender.tStop = globalClock.getTime(format='float')
- ender.tStopRefresh = tThisFlipGlobal
- thisExp.addData('ender.stopped', ender.tStop)
- # Run 'End Routine' code from code_8
- outlet.push_sample(x=[99])
- # using non-slip timing so subtract the expected duration of this Routine (unless ended on request)
- if ender.maxDurationReached:
- routineTimer.addTime(-ender.maxDuration)
- elif ender.forceEnded:
- routineTimer.reset()
- else:
- routineTimer.addTime(-5.000000)
- thisExp.nextEntry()
- # mark experiment as finished
- endExperiment(thisExp, win=win)
- def saveData(thisExp):
- """
- Save data from this experiment
- Parameters
- ==========
- thisExp : psychopy.data.ExperimentHandler
- Handler object for this experiment, contains the data to save and information about
- where to save it to.
- """
- filename = thisExp.dataFileName
- # these shouldn't be strictly necessary (should auto-save)
- thisExp.saveAsWideText(filename + '.csv', delim='auto')
- thisExp.saveAsPickle(filename)
- def endExperiment(thisExp, win=None):
- """
- End this experiment, performing final shut down operations.
- This function does NOT close the window or end the Python process - use `quit` for this.
- Parameters
- ==========
- thisExp : psychopy.data.ExperimentHandler
- Handler object for this experiment, contains the data to save and information about
- where to save it to.
- win : psychopy.visual.Window
- Window for this experiment.
- """
- if win is not None:
- # remove autodraw from all current components
- win.clearAutoDraw()
- # Flip one final time so any remaining win.callOnFlip()
- # and win.timeOnFlip() tasks get executed
- win.flip()
- # return console logger level to WARNING
- logging.console.setLevel(logging.WARNING)
- # mark experiment handler as finished
- thisExp.status = FINISHED
- logging.flush()
- def quit(thisExp, win=None, thisSession=None):
- """
- Fully quit, closing the window and ending the Python process.
- Parameters
- ==========
- win : psychopy.visual.Window
- Window to close.
- thisSession : psychopy.session.Session or None
- Handle of the Session object this experiment is being run from, if any.
- """
- thisExp.abort() # or data files will save again on exit
- # make sure everything is closed down
- if win is not None:
- # Flip one final time so any remaining win.callOnFlip()
- # and win.timeOnFlip() tasks get executed before quitting
- win.flip()
- win.close()
- logging.flush()
- if thisSession is not None:
- thisSession.stop()
- # terminate Python process
- core.quit()
- # if running this experiment as a script...
- if __name__ == '__main__':
- # call all functions in order
- expInfo = showExpInfoDlg(expInfo=expInfo)
- thisExp = setupData(expInfo=expInfo)
- logFile = setupLogging(filename=thisExp.dataFileName)
- win = setupWindow(expInfo=expInfo)
- setupDevices(expInfo=expInfo, thisExp=thisExp, win=win)
- run(
- expInfo=expInfo,
- thisExp=thisExp,
- win=win,
- globalClock='float'
- )
- saveData(thisExp=thisExp)
- quit(thisExp=thisExp, win=win)
Model of training_lastrun.py at commit 0bf72a3, no license · at the source
Overview
- University of Aveiro, Institute of Ethnomusicology – Centre for Studies in Music and Dance (INET-md), Department of Communication and Arts, Aveiro, Portugal
- Universidade Católica Portuguesa, Human Neurobehavioral Laboratory (HNL), Porto, Portugal
- Universidade Católica Portuguesa, Faculty of Education and Psychology (FEP), Porto, Portugal
- Universidade Católica Portuguesa, Research Centre for Human Development (CEDH), Porto, Portugal
- University of the Azores, Department of Psychology, Ponta Delgada, Portugal
- University of Coimbra, CEIS20 – Centre for Interdisciplinary Studies, Faculty of Arts and Humanities, Coimbra, Portugal
- NOVA University of Lisbon, INET-md, Lisbon, Portugal
Abstract
Introduction: Music Performance Anxiety (MPA) is a prevalent phenomenon among young musicians, affecting both well-being and artistic performance. Despite its early onset and impact, effective interventions supporting the development of self-regulation of MPA in adolescents remain limited, particularly in relation to neurofeedback-based approaches. In response, this study investigates the feasibility of a Neurofeedback–Functional
Methods: The protocol alternated MPA induction and regulation within audio-guided sessions conducted in school settings to ensure ecological validity and to integrate top-down control with gradual exposure to performance contexts. The conceptual development and operationalization of the protocol resulted in a theoretical–methodologic
Results: The procedure demonstrated technical feasibility, hemodynamic signal stability, and participants’ gradual adaptation to the training. fNIRS data revealed increased modulation of the dorsolateral prefrontal cortex, consistent with top-down self-regulatory learning mechanisms. Researchers’ reflective journals emphasized practical aspects such as equipment calibration, session duration, and participant engagement.
Discussion: Altogether, the findings indicate that NFDK-fNIRS represents a technically feasible and ecologically applicable approach for training self-regulation of MPA in adolescents, providing a solid foundation for future studies involving larger samples and controlled validation of the protocol.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
pedrorribeiro/MUSA-Neurofeedback-training
0bf72a3c72014b24d45bba7320965e8a25242660, 13 November 2025Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
1 file
- Model of training_lastrun.py, Python, 1,881 lines
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;
- no match between paragraphs and code yet;
- 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 availability statement
The raw data supporting the conclusions of this article will be made available by the authors, for research purposes, upon request.
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, 30 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 9 authors, 5 keywords, 106 references.
Cite
This paper
Borges, N., Ribeiro, P. R., Serra, S., Veríssimo, L., Dias, P., Moura, N., Silva, I., Raimundo, I., & Oliveira-Silva, P. (2026). &
BibTeX
@article{borges2026lt,
author = {Borges, Nery and Ribeiro, Pedro Rodrigues and Serra, Sofia and Veríssimo, Lurdes and Dias, Pedro and Moura, Nádia and Silva, Inês and Raimundo, Isaac and Oliveira-Silva, Patrícia},
title = {{\&
journal = {Frontiers in psychology},
year = {2026},
month = apr,
volume = {17},
pages = {1746761},
publisher = {Frontiers Media SA},
issn = {1664-1078},
doi = {10.3389/
url = {https://
pmid = {42137087},
pmcid = {PMC13170606}
}
RIS
TY - JOUR
AU - Borges, Nery
AU - Ribeiro, Pedro Rodrigues
AU - Serra, Sofia
AU - Veríssimo, Lurdes
AU - Dias, Pedro
AU - Moura, Nádia
AU - Silva, Inês
AU - Raimundo, Isaac
AU - Oliveira-Silva, Patrícia
TI - &
T2 - Frontiers in psychology
J2 - Front Psychol
PY - 2026
DA - 2026/
VL - 17
SP - 1746761
SN - 1664-1078
PB - Frontiers Media SA
DO - 10.3389/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3389/
"type": "article-journal",
"title": "&
"container-title": "Frontiers in psychology",
"author": [
{
"family": "Borges",
"given": "Nery"
},
{
"family": "Ribeiro",
"given": "Pedro Rodrigues"
},
{
"family": "Serra",
"given": "Sofia"
},
{
"family": "Veríssimo",
"given": "Lurdes"
},
{
"family": "Dias",
"given": "Pedro"
},
{
"family": "Moura",
"given": "Nádia"
},
{
"family": "Silva",
"given": "Inês"
},
{
"family": "Raimundo",
"given": "Isaac"
},
{
"family": "Oliveira-Silva",
"given": "Patrícia"
}
],
"container-title-short":
"volume": "17",
"page": "1746761",
"DOI": "10.3389/
"PMID": "42137087",
"PMCID": "PMC13170606",
"ISSN": "1664-1078",
"publisher": "Frontiers Media SA",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
29
]
]
}
}
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.1117/1.nph.13.3.035009
- Single-subject detection of speech network activation using functional near-infrared spectroscopy.Journal: NeurophotonicsIn common: fNIRS, 3 references
- [2] doi:10.1371/journal.pbio.3003666 [code]
- Emotion regulation success involves systematic gradient-based reconfigurations of large-scale activation patterns in the human brain.Journal: PLoS biologyIn common: NumPy, 3 references
- [3] doi:10.1038/s41598-026-49157-z
- Supportive neural mechanisms underlying successful emotion regulation for reappraisal success.Journal: Scientific reportsIn common: 3 references
- [4] doi:10.3389/fnhum.2026.1806951 [code]
- The theta paradox-delayed reduction of frontal midline theta following downregulation neurofeedback training.Journal: Frontiers in human neuroscienceIn common: 3 references
- [5] doi:10.1016/j.dcn.2026.101737 [code]
- Being praised and criticized in adolescents and adults: Age-related changes in neural responses to social evaluations.Journal: Developmental cognitive neuroscienceIn common: NumPy, developmental, 2 references
- [6] doi:10.1007/s00221-026-07354-2 [code]
- Transcutaneous auricular vagus nerve stimulation during a 3-back task: a high-density functional near-infrared spectroscopy study.Journal: Experimental brain researchIn common: fNIRS, 2 references
- [7] doi:10.1002/brb3.71581 [code]
- Blunted Reward Responsiveness During Social Feedback: Associations with Peer Victimization and Anhedonia in Socially Anxious Adolescents.Journal: Brain and behaviorIn common: PsychoPy, NumPy, developmental, other condition
- [8] doi:10.1017/s0033291726104309 [code]
- A visual cortex origin of trauma memory intrusions: integrated evidence from TMS and fMRI.Journal: Psychological medicineIn common: NumPy, other condition, 2 references
- [9] doi:10.3389/fpsyt.2026.1757213 [code]
- A novel music-based real-time fMRI neurofeedback interface modulates interhemispheric connectivity and enhances mood.Journal: Frontiers in psychiatryIn common: NumPy, 2 references
- [10] doi:10.1038/s41467-026-74331-2 [code]
- Trial-by-trial fMRI-neurofeedback dissociates fusiform and occipital contributions to face detection and recognition.Journal: Nature communicationsIn common: NumPy, 2 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 0 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:8467f96bcf5a5c2f…
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.
