bookhoogl.blogg.se

Stimulus duration framen psychopy
Stimulus duration framen psychopy














Sends a request to save the latest camera image that has been transferred to the Recorder PC.

#Stimulus duration framen psychopy Pc

When space key on the Presentation PC is pressed, cameraDelayEstimationHelper() cameraDelayEstimationHelper ( screen, tracker )Īs shown in Figure 1, these sample script shows a counter on the center of a PsychoPy/VisionEgg window. setReceiveImageSize (( 640, 480 )) tracker. getController ( backend = 'VisionEgg' ) tracker. #For VisionEgg users import VisionEgg.Core import GazeParser.TrackingTools tracker = GazeParser. To use cameraDelayEstimationHelper(), adjust camera position so that the center of the display can be captured by the camera (Figure 1). It is difficult to estimate these delay exactly, total delay can be roughly estimated by capturing stimuli on the display by the camera. 1/60sec) at worst.ĭelay in transferring captured imaget to the Recorder PC.ĭelay in transferring a message from the Presentation PC to the Recorder PC. For example, if sampling frequency of the camera is 60Hz, capture may be delayed about 16.7ms (i.e. However, unfortunately, there are many processes that would cause delay.įollowing processes are main sources of delay.ĭelay from calling flip (PsychoPy) or swap_buffers (VisionEgg) to updating the displayĭelay from updating the display to capturing image by the camera. This measurement would be simple if there was no delay but participant's response latency in these process: Participant's eye movement is captured by a camera and sent to the Recorder PC. Participant detects the dot and makes a saccade to it. The dot is drawn on the back buffer and then the buffer is flipped to show the dot on the display.Īfter flip is finished, a message is sent to the Recorder PC to record the onset time of the dot. Sti = visual.Suppose that we want to measure saccade lateny to a small dot briefly presented on a display using GazeParser and SimpleGazeTracker. Win = visual.Window(monitor = "testMonitor", allowGUI = False, units = "deg")įixation = visual.GratingStim(win, tex = None, mask = "circle", color = -1, size =. #myDlg = gui.Dlg(title="Setting experiment") It uses some helper functions that I created grouped in the module psychopyHelp.py that it could be placed in the same folder as the template. The relevant information needs to be included only once in the list \(vars\). Sti = visual.PatchStim(myWin,tex='None',mask='circle',size=.2)īelow a template that I used to run experiments using the method of constant stimuli. MyWin = visual.Window(monitor='testMonitor',units='deg') # creating the matrix that contain the coordinates of each point # defining the dimensions of the main structure data # reading the first line of the file contains the general information of the animation from psychopy import *įramesFile = open('walker.txt','r') #open the file that contains the coordinates of each point In the demo bellow the coordinates of each point are in the file walker.txt that should be included in the same folder that the psychopy file. Stimulus = visual.PatchStim(myWin,tex='None')įlag=repite(frame,duration=10,numberStates=3,start=13) MyWin = visual.Window(monitor='testMonitor') If counter>=i*duration and counter<(i+1)*duration: StartP=numberStates*duration-start%(numberStates*duration)Ĭounter=(frame+startP)%(numberStates*duration) from psychopy import *ĭef repite(frame,duration,numberStates=2,start=1): In this case, I want the onset of the red color to be displayed in the frame 13. In the argument ‘start’, I indicate where I want the sequence to start. The demo bellow displays a stimulus that alternates between three colors. To generate repetitive stimulation, which is sometimes used in psychophysics, I created the function \(repite\).














Stimulus duration framen psychopy