WARNING ) for block in range ( nBlocks ): #= #TRIAL SEQUENCE #= for trial in range ( nTrials ): #-set stimuli and stimulus properties for the current trial #= #START TRIAL #= for frameN in range ( total_frames ): #for the whole trial. refreshThreshold = 1.0 / 60.0 + 0.004 # Set the log module to report warnings to the standard output window #(default is errors only). recordFrameIntervals = True #record frames #give the monitor refresh rate plus a few ms tolerance (usually 4ms) win. TextStim ( win, text = '+' ) nBlocks = 1 nTrials = 1 #add information to record dropped frames win. Window ( monitor = mon ) #define a window #set durations fix_dur = 0.2 #200 ms image_dur = 0.1 #100 ms text_dur = 0.2 #200 ms #set frame counts fix_frames = int ( fix_dur / refresh ) #whole number image_frames = int ( image_dur / refresh ) #whole number text_frames = int ( text_dur / refresh ) #whole number #the total number of frames to be presented on a trial total_frames = int ( fix_frames + image_frames + text_frames ) fix = visual. Monitor ( 'myMonitor', width = 35.56, distance = 60 ) mon. #this can output various information about your experiment from psychopy import visual, monitors, event, core, logging #define the monitor parameters mon = monitors. flip () #show if frameN = ( total_frames - 1 ): #last frame for the text print ( "End text frame =", frameN ) #print frame number win. flip () #show if frameN = ( fix_frames + image_frames ): #last frame for the image print ( "End image frame =", frameN ) #print frame number #number of frames for the final text stimulus if ( fix_frames + image_frames ) < frameN < total_frames : fix. flip () #show if frameN = fix_frames : #last frame for the fixation print ( "End fix frame =", frameN ) #print frame number #number of frames for image after fixation if fix_frames < frameN <= ( fix_frames + image_frames ): fix. #-draw stimulus if 0 <= frameN <= fix_frames : #number of frames for fixation fix. TextStim ( win, text = '+' ) nBlocks = 1 nTrials = 1 for block in range ( nBlocks ): #= #TRIAL SEQUENCE #= for trial in range ( nTrials ): #-set stimuli and stimulus properties for the current trial #= #START TRIAL #= for frameN in range ( total_frames ): #for the whole trial. close ()įrom psychopy import visual, monitors, event, core #define the monitor parameters mon = monitors. draw () #draw fixation on top of the image win. add ( 3 ) #add 3 seconds because your trial is 3 seconds #-draw stimulus while pres_timer. join ( image_dir, stims ) #reset stimulus presentation timer right before the first stimulus should appear pres_timer. CountdownTimer () for block in range ( nBlocks ): #= #TRIAL SEQUENCE #= for trial in range ( nTrials ): #-set stimuli and stimulus properties for the current trial #point to a different filename for each image my_image. ImageStim ( win ) stims = #create a list if images to show nBlocks = 2 nTrials = 3 #define the countdown clock at the beginning of the experiment pres_timer = core. TextStim ( win, text = '+' ) my_image = visual. join ( main_dir, 'images' ) fix_text = visual. chdir ( '/home/shoarly/Documents/pytutorial/exp' ) main_dir = os. Window ( monitor = mon ) #define a window import os #stuff you only have to define once at the top of your script os. From psychopy import visual, monitors, event, core #define the monitor parameters mon = monitors.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |