Beispiel #1
0
progress_bar_end =visual.Rect(win,width=bar['width'],height=bar['height'],lineColor=None,fillColor=et.rgb2psypy(bar['color']),pos = [bar['horiz_dist']-shift,-bar['vert_dist']],autoLog=0)
fixDot = et.fancyFixDot(win, bg_color = win_info['bg_color']) 
leftframe = visual.Rect(win,width=stim_info['bar_width'],height=stim_info['bar_height'],lineColor=win_info['fg_color'],fillColor=None,pos = [-stim_info['bar_x']-shift,stim_info['bar_y']],lineWidth=stim_info['line_width'],autoLog=0)
rightframe = visual.Rect(win,width=stim_info['bar_width'],height=stim_info['bar_height'],lineColor=win_info['fg_color'],fillColor=None,pos = [stim_info['bar_x']-shift,stim_info['bar_y']],lineWidth=stim_info['line_width'],autoLog=0)
leftbar = visual.Rect(win,width=stim_info['bar_width'],lineColor=None,fillColor=win_info['fg_color'],autoLog=0)
rightbar = visual.Rect(win,width=stim_info['bar_width'],lineColor=None,fillColor=win_info['fg_color'],autoLog=0)
selectbar = visual.Rect(win,width=stim_info['bar_width']*1.7,height=stim_info['bar_height']*1.7,lineColor=win_info['fg_color'],fillColor=None,lineWidth=stim_info['line_width'],autoLog=0)
leftProb = visual.TextStim(win,height=0.44,color=win_info['fg_color'],pos=[-stim_info['bar_x']-shift,-0.8*stim_info['bar_height']+stim_info['bar_y']],autoLog=0)
rightProb = visual.TextStim(win,height=0.44,color=win_info['fg_color'],pos=[stim_info['bar_x']-shift,-0.8*stim_info['bar_height']+stim_info['bar_y']],autoLog=0)

# set Mouse to be invisible
event.Mouse(win=None,visible=False)
event.clearEvents()

# reset all triggers to zero
et.sendTriggers(port,0)

# experimental phases (unique things on screen)
fix_phase = fixDot[:] +[progress_bar,progress_bar_start,progress_bar_end]
stim_phase = fixDot[:] + [progress_bar,progress_bar_start,progress_bar_end,leftbar,rightbar,leftProb,rightProb,leftframe,rightframe]
select_phase = fixDot[:] +[progress_bar,progress_bar_start,progress_bar_end,selectbar,leftbar,rightbar,leftProb,rightProb,rightframe,leftframe]
feedback_phase = fixDot[:] +[progress_bar,progress_bar_start,progress_bar_end,progress_update,selectbar,leftbar,rightbar,leftProb,rightProb,rightframe,leftframe]

####################
###  START EXP   ###
####################
while 'c' not in event.getKeys():
    et.drawFlip(win,[startExp])          

######################
###  START BLOCKS  ###
Beispiel #2
0
###########################
###  START BLOCK LOOP # ###
###########################
# draw intro before starting block
startexp.draw()
trial_info['start_block_time']=win.flip()
if response_info['run_mode'] != 'dummy':
    while True:
        startexp.draw()
        win.flip()                        
        cont=et.captureResponse(mode=response_info['resp_mode'],keys = [pause_resp])    
        if cont == pause_resp:
            break

# send trigger
et.sendTriggers(trigger_info['start_block'],mode=response_info['resp_mode'])
trial_info['block_no'] = 1

for miniblock_no in range(n_miniblocks):
    # we use fake blocks here. Better word would be building blocks
    # blocks are not separated by a pause screen or something like that
    # instead pauses are only added occasionally (predefined)

    # create trial sequence (within 12 trials, gos (1) and nogos (0) are equal)
    trial_seq = [0,1]*int(n_unique/2)
    trial_seq = trial_seq*n_repeats
    np.random.shuffle(trial_seq)

    # assign stimuli to trials
    np.random.shuffle(go_stim)
    np.random.shuffle(nogo_stim)