Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

eye tracking experiment output features

edited February 2017 in OpenSesame

HI

I need your help please . I need to setup an experiment using oensesame and eyetribe.

my question is :

  1. how can I get ( fixation count , fixation duration ) or any other features ?

Thanks

Comments

  • Hi,

    You may want to have a look on this page: http://osdoc.cogsci.nl/3.1/manual/eyetracking/pygaze/

    You have to use the pygaze components to make your eye-tracker work with OpenSesame. How your datafile will look depends on the type of eye-tracker used. By default you'd have the eye position coordinates for every timepoint, and eye-trackers such as the Eyelink also provide means to parse that raw data into fixations and saccades. Not sure about the Eyetribe though - but someone else may have a script to parse data?

    Cheers,

    Josh

  • edited February 2017

    I have used pygaze on the output eyetribe data, but I'm getting this error , could you please help.

    C:\Users\sarmad\Documents\python>"C:\Users\sarmad\Desktop\WinPython-PyGaze-0.5.1\python-2.7.3\python.exe" "analysis.py"
    C:\Users\sarmad\Documents\python\pygazeanalyser\detectors.py:203: RuntimeWarning: invalid value encountered in divide
    vel = intdist / inttime
    C:\Users\sarmad\Documents\python\pygazeanalyser\detectors.py:217: RuntimeWarning: invalid value encountered in greater
    sacstarts = numpy.where((vel[1+t0i:] > maxvel).astype(int) + (acc[t0i:] > maxacc).astype(int) >= 1)[0]
    C:\Users\sarmad\Documents\python\pygazeanalyser\detectors.py:229: RuntimeWarning: invalid value encountered in less
    sacends = numpy.where((vel[1+t1i:] < maxvel).astype(int) + (acc[t1i:] < maxacc).astype(int) == 2)[0]

          import os
    
      from constants import *
    
    from pygazeanalyser.eyetribereader import read_eyetribe
    from pygazeanalyser import gazeplotter
    from pygazeanalyser import detectors
    
    from matplotlib.pyplot import close
    
    # Construct the name of the output directory
    OUTPUTDIR = os.path.join(DIR, 'output')
    
    # Check if the output directory exists yet
    if not os.path.isdir(OUTPUTDIR):
     # If the output directory does not exist yet, make it
     os.mkdir(OUTPUTDIR)
    
    # Read the data
    data = read_eyetribe('default.tsv', 'image_onset', \
        stop='image_offset')
    
    # Get the amount of trials in this dataset
    ntrials = len(data)
    
    # Loop through all trials
    for trialnr in range(ntrials):
    
     # Get the image name
      imgname = IMGNAMES[trialnr]
    
        # Get the path to the image
      imgpath = os.path.join(IMGDIR, imgname)
    
     # Get the fixations in this trial
      fixations = data[trialnr]['events']['Efix']
    
      # Delete the first fixation
      fixations.pop(0)
    
     # Get the raw x and y gaze coordinates
     x = data[trialnr]['x']
     y = data[trialnr]['y']
     time = data[trialnr]['time']
    
       # Plot the fixations
        savename = 'fixations_%s' % imgname
        savepath = os.path.join(OUTPUTDIR, savename)
      fig = gazeplotter.draw_fixations(fixations, DISPSIZE, \
        durationsize=True, durationcolour=False, \
        imagefile=imgpath, savefilename=savepath)
     close(fig)
    
    
    
    # Plot a heatmap
        savename = 'heatmap_%s' % imgname
     savepath = os.path.join(OUTPUTDIR, savename)
     fig = gazeplotter.draw_heatmap(fixations, DISPSIZE, \
       imagefile=imgpath, savefilename=savepath)
      close(fig)
    
Sign In or Register to comment.