Howdy, Stranger!

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

Supported by

Trackloss with Tobii

Hi everyone,

I'm using Open Sesame to run visual word experiments with a Tobii X2-60. I'd like to find a way to add a variable, so to register whether for each datapoint the data is "valid" or not. Basically we want to know if the subject was blinking or looking away. Looking at the tobii raw data, the tobii marks invalid data points in two ways:

the first is through the variable Validity: 0 if invalid, 1 if valid

the second is through the value it assign to X-Y eye-gaze position: -1 if invalid, other coordinates if valid

This is a link to the Opensesame file of my experiment, with all the materials and two sample output files, the raw from tobii and the log from Open Sesame.

Could anyone help to integrate "validity" into my script?




  • Hi Enzo,

    I haven't worked with the Tobii, but I suppose the validity variable is defined per sample. So at a sampling rate of 500Hz, you get every 2ms the information whether a sample was valid or not. During a trial you will have many samples, so you would need to define how many invalid samples would count as a blink or as looking away (There are probably recommendations online). Getting the sample is rather easy. In an `inline_script`, you can call `x,y = exp.pygaze_eyetracker.sample()`, but this will only give you a single sample. To monitor an entire trial, you would have to wrap everything into a (while) loop, including your stimulus presentation. Depending on how feasible that is in terms of your paradigm, it might make more sense to do this offline (during data analysis). So, basically parse the samples into events (saccades, fixations, blinks) and check per trial whether blinks occurred, or whether a fixation lies outside the allowed region.

    Hope this helps,


  • Hi Eduard,

    yes, as you suggest, I'm aiming at obtaining validity for each sample.

    Apart from getting the x and y coordinates from tobii through x,y = exp.pygaze_eyetracker.sample(), is possible to import also the value for an extra variable that I think is part of the tobii output, whose name is "validity"? I think that for each sample, the tobii gives back a binary value 0 or 1.



  • Hi Enzo,

    There might. You can check the github page of Pygaze to find the part in the tobii implementation that handles accessing Tobii information.

    However, if I remember correctly Tobii codes invalid samples as (-1, -1).

    So, it should be easy to define validity yourself, both online during your experiment as well as offline during analysis.


    if sample == (-1,-1): var.validity = 0
    else: var.validity =1

    hope this helps.


Sign In or Register to comment.