Example #1
0
def replayBlock(vp,block,trial,tlag=0,coderid=0,exportAlgo=False):
    ''' replays the remaining block from the chase experiment starting at <trial>
        vp - subject id
        block - block id
        trial - trial id on which the replay will start
        tlag - lag in ms on each frame, useful for slowing down the replay
        coderid - coder id whose coding data will be displayed
            if the coding data are not available automated coding will be created
    '''
    behdata=np.loadtxt(os.getcwd().rstrip('code')+'behavioralOutput/vp%03d.res'%vp)
    trialStart=trial
    #win = Q.initDisplay((1280,1100))
    from Preprocess import readEyelink
    data=readEyelink(vp,block)
    #PATH+='coder%d'% coderid +os.path.sep
    for trial in range(trialStart,len(data)):
        print vp,block,trial
        trl=data[trial]
        trl.extractBasicEvents()
        trl.driftCorrection(jump=manualDC(vp,block,trial))
        trl.extractComplexEvents()
        trl.importComplexEvents(coderid=coderid)
    #for trial in range(trialStart,len(data)):
        R=Coder(gazeData=data[trial],phase=1,eyes=1,coderid=coderid)#,wind=win)
        bi=np.logical_and(block==np.int32(behdata[:,1]),trial==np.int32(behdata[:,2])).nonzero()[0][0]
        R.behsel= np.int32(behdata[bi,[-3,-5]])
        if exportAlgo: 
            R.saveSelection(coderid=coderid)
            R.wind.close()
        else: R.play(tlag=tlag)
Example #2
0
def replayTrial(vp,block,trial,tlag=0,coderid=0):
    behdata=np.loadtxt(os.getcwd().rstrip('code')+'behavioralOutput/vp%03d.res'%vp)
    from Preprocess import readEyelink
    data=readEyelink(vp,block)
    trl=data[trial]
    trl.extractBasicEvents()
    trl.driftCorrection(jump=manualDC(vp,block,trial))
    trl.extractComplexEvents()
    trl.importComplexEvents(coderid=coderid)
    R=Coder(gazeData=trl,phase=1,eyes=1,coderid=coderid)
    bi=np.logical_and(block==np.int32(behdata[:,1]),trial==np.int32(behdata[:,2])).nonzero()[0][0]
    R.behsel= np.int32(behdata[bi,[-3,-5]])
    #R.saveSelection(coderid=0)
    R.play(tlag=tlag)
Example #3
0
def replayTrial(vp,block,trial,tlag=0,coderid=0):
    ''' replays a trial from the chase experiment
        vp - subject id
        block - block id
        trial - trial id
        tlag - lag in ms on each frame, useful for slowing down the replay
        coderid - coder id whose coding data will be displayed
            if the coding data are not available automated coding will be created
    '''
    behdata=np.loadtxt(os.getcwd().rstrip('code')+'behavioralOutput/vp%03d.res'%vp)
    from Preprocess import readEyelink
    data=readEyelink(vp,block)
    trl=data[trial]
    trl.extractBasicEvents()
    trl.driftCorrection(jump=manualDC(vp,block,trial))
    trl.extractComplexEvents()
    trl.importComplexEvents(coderid=coderid)
    R=Coder(gazeData=trl,phase=1,eyes=1,coderid=coderid)
    bi=np.logical_and(block==np.int32(behdata[:,1]),trial==np.int32(behdata[:,2])).nonzero()[0][0]
    R.behsel= np.int32(behdata[bi,[-3,-5]])
    #R.saveSelection(coderid=0)
    R.play(tlag=tlag)
Example #4
0
def replayBlock(vp,block,trial,tlag=0,coderid=0,exportAlgo=False):
    behdata=np.loadtxt(os.getcwd().rstrip('code')+'behavioralOutput/vp%03d.res'%vp)
    trialStart=trial
    #win = Q.initDisplay((1280,1100))
    from Preprocess import readEyelink
    data=readEyelink(vp,block)
    #PATH+='coder%d'% coderid +os.path.sep
    for trial in range(trialStart,len(data)):
        print vp,block,trial
        trl=data[trial]
        trl.extractBasicEvents()
        trl.driftCorrection(jump=manualDC(vp,block,trial))
        trl.extractComplexEvents()
        trl.importComplexEvents(coderid=coderid)
    #for trial in range(trialStart,len(data)):
        R=Coder(gazeData=data[trial],phase=1,eyes=1,coderid=coderid)#,wind=win)
        bi=np.logical_and(block==np.int32(behdata[:,1]),trial==np.int32(behdata[:,2])).nonzero()[0][0]
        R.behsel= np.int32(behdata[bi,[-3,-5]])
        if exportAlgo: 
            R.saveSelection(coderid=coderid)
            R.wind.close()
        else: R.play(tlag=tlag)