Properties ¶ name stringĮverything in a PsychoPy ® experiment needs a unique name. The ioLabs button box also has a built-in voice-key, but PsychoPy ® does not have an interface for it. It might be possible for you to obtain a correction factor for your computer + button box set up, if the timing delay is highly reliable. If this takes a while, then the RT timing values are not likely to be high precision. This is what makes it capable (in theory) of high precision timing.Ĭheck the log file to see how long it takes for PsychoPy ® to reset the button box’s internal clock. The time taken is determined by a clock on the device itself. Win.saveMovieFrames('screenshot' + trial) # save with a descriptive and unique filename.A button box is a hardware device that is used to collect participant responses with high temporal precision, ideally with true ms accuracy.īoth the response (which button was pressed) and time taken to make it are returned. Win.getMovieFrame() # Defaults to front buffer, I.e. Maybe outcomment these line during production. # Draw whatever you need, probably dependent on the condition. You may organize them using ``data.TrialHandler`` or generate them yourself. ![]() It ensures that your screenshots are an accurate depiction of what's actually going on during the experiment - also if you'd make mistakes and drew things incorrectly :-) Of course, if the purpose of the screenshots are purely for the documentation, do remove/outcomment those lines as you run the actual experiment to improve performance. I'd be taking the screenshots as the actual experiment is running rather than "simulating" beforehand. You'd likely end up with a loop over conditions When you finish your script. You don't need the visual.BufferImageStim. ![]() Use win.getMovieFrame and win.saveMovieFrames as others have suggested. RoutineTimer = core.CountdownTimer() # to track time remaining of each (non-slip) routine GlobalClock = core.Clock() # to track the time since experiment started # as a list of the edges: Left Top Right Bottom, in norm units. # rect is the screen rectangle to grab, (-1,1,1,-1) is whole screen Screenshot = visual.BufferImageStim(win, stim=stimlist, rect=rect) #Get and save a screen shot" of everything in stimlist: TexRes=128, interpolate=False, depth=-3.0) Probe = visual.ImageStim(win=win, name='probe', TexRes=128, interpolate=False, depth=-2.0) Rightimage = visual.ImageStim(win=win, name='rightimage', TexRes=128, interpolate=False, depth=-1.0) Leftimage = visual.ImageStim(win=win, name='leftimage',Ĭolor=, colorSpace='rgb', opacity=1, # Initialize components for Routine "block1"įixation = visual.TextStim(win=win, ori=0, name='fixation', EIther click "2" when probe replaces left face or click "3" when probe replaces right face.', font='Arial',Ĭolor='white', colorSpace='rgb', opacity=1, Text='Respond to the probe once it appears. Text = visual.TextStim(win=win, ori=0, name='text', # Initialize components for Routine "instructions" # store frame rate of monitor if we can measure it successfullyĮxpInfo=win.getActualFrameRate()įrameDur = 1.0/round(expInfo)įrameDur = 1.0/60.0 # couldn't get a reliable measure so guess Win = visual.Window(size=(1366, 768), fullscr=True, screen=0, allowGUI=False,ĪllowStencil=False, monitor='testMonitor', color=, colorSpace='rgb') # Start Code - component code to be run before the window creation ThisExp = data.ExperimentHandler(name=expName, version='', # An ExperimentHandler isn't essential but helps with data saving (logging.WARNING) # this outputs to the screen, not a file ![]() LogFile = logging.LogFile(filename+'.log', level=logging.EXP) permissions) we will get errorįilename = 'data' + os.p + '%s_%s' %(expInfo, expInfo) Os.makedirs('data') # if this fails (e.g. If dlg.OK = False: core.quit() # user pressed cancelĮxpInfo = data.getDateStr() # add a simple timestamp # Store info about the experiment sessionĮxpInfo = ĭlg = gui.DlgFromDict(dictionary=expInfo, title=expName) Import os # handy system and path functions Import numpy as np # whole numpy lib is available, prepend 'np.'įrom numpy import sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray)įrom numpy.random import random, randint, normal, shuffle ![]() I have my code so far below: from _future_ import division # so that 1/3=0.333 instead of 1/3=0įrom psychopy import visual, core, data, event, logging, sound, guiįrom nstants import * # things like STARTED, FINISHED Ideally, I would like to have 30 images saved to my computer through this code. There are 10 different face pairs in the routine and the routine is looped 3 times. I just want a screenshot of the 1 second time period that the two faces appear on the screen. I have a fixation cross, followed by 2 faces on the left and right side of the screen, and then a dot. I am trying to capture a timed screenshot during my psychopy task.
0 Comments
Leave a Reply. |