Millisecond Forums

Sending markers to Tobii eye trackers

https://forums.millisecond.com/Topic16009.aspx

By Willem - 4/13/2015

Hi all, I have a question regarding sending markers to Tobii eye trackers. I don't know how. I have tried figuring it out by looking at some sample scripts, but I cannot find one that works. A specific Tobii example would be very nice.

I think all I need is a simple script in which a trial is defined that is run multiple times, and continuously the eye tracker is being used to measure pupil size. The result should be an eye tracker data file with all the eye tracking data (this is easy enough), but also with the information that denotes when exactly the trial began. I suppose this should be done by sending markers, but I do not know which port to use or how it works in general. Ideally I want to create a data file that contains the eye tracker data (such as the pupil sizes) and on reach row also what was being displayed (for example, which trial, or which part of the trial). 

Does anyone have an example of a Tobii eye tracker study that works a bit like this? Or can someone point me to a place where I can start figuring this out? My apologies if this is too vague a request.
By Dave - 4/13/2015

It seems to me that the last script at https://www.millisecond.com/download/library/Tobii/ should be a good start.
By Willem - 4/14/2015

Dear Dave, thank you for your response!

I did check out that script, but I do not see how there is any link between eye tracker data (e.g., pupil sizes) and trial data (e.g., which trial was visible at which rows of the pupil data file). Could it be that I am missing something crucial?

Best,
Willem

P.S. The second script on that page seems to be a dead link.
By seandr - 4/15/2015

Great question, and sorry this isn't better documented.

You can send markers to the gaze point data stream by presenting a port stimulus that is configured to talk to the eye tracker plugin. The following port consists of a set of numbers that are linked (via /select command) to the selection of a stimulus called "somestimulus".

<port marker>
/ port = eyetracker
/ items = (1, 2, 3, 4, 5, 6)
/ select = current(somestimulus)
</port>

To send marker indicating the onset of somestimulus, present the port at the same time:

<trial example>
/ stimulusframes = [1=somestimulus, marker]
/ validresponse = (" ")
</trial>

Hope this clears things up.

-Sean

P.S. Broken link is fixed.




By Willem - 4/15/2015

Thanks Sean, that sounds like what I want it to do! 
By TBWray06 - 1/13/2016

Hi all. Using Inquisit 4 Lab with a Tobii X3-120 eye tracker on a Windows 7 desktop i7 PC.

I'm trying to track eye movements during the standard Brief IAT with pictures (http://www.millisecond.com/download/library/BriefIAT/). Adding the <eyetracker> itself seems to be working fine and giving me good data at the specified intervals. But, I'm capturing screenshots of all trials for later use in heat maps, and am having trouble marking the onset of each trial (screen) in a comprehensible way. 

I first took the above advice, and added just a general marker ("1") to all trials that presented a word, but it'd be ideal if I could mark the first eye tracking entry for each trial with the specific items (words, picture filenames, etc.) that were presented. Here's the code I used to get the former: 

<eyetracker>
/ plugin = "tobii"
/ aoidurationthreshold = 200
</eyetracker>

<port marker>
/ port = eyetracker
/ items = (1)
/ select = current(attributeA, attributeB)
</port>

<item attributeAlabel>
/1 = "Good"
</item>

<item attributeA>
/1 = "Marvelous"
/2 = "Superb"
/3 = "Pleasure"
/4 = "Beautiful"
/5 = "Joyful"
/6 = "Glorious"
/7 = "Lovely"
/8 = "Wonderful"
</item>

<item attributeBlabel>
/1 = "Bad"
</item>

<item attributeB>
/1 = "Tragic"
/2 = "Horrible"
/3 = "Agony"
/4 = "Painful"
/5 = "Terrible"
/6 = "Awful"
/7 = "Humiliate"
/8 = "Nasty"
</item>

...
<trial attributeA>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = attributeA, marker]
/ posttrialpause = 250
/ screencapture = true
</trial>

Is this possible to accomplish? Anyone with any ideas about how? 
By Dave - 1/13/2016

#1: You'll want to set up two separate "marker" <port> elements, one to go with "attribute a" and another to go with "attribute b". This

<port marker>
/ port = eyetracker
/ items = (1)
/ select = current(attributeA, attributeB)

</port>

makes no sense, because (a) the <port> element has only one item and thus cannot possibly select something *corresponding* to the item selected in either attributeA or attributeB, and even if that were not the case (b) it cannot possibly select something that corresponds to the currently selected item in *both* attributeA and attributeB *at the same time*.

Thus, set up

<port attributeAmarker>
/ port = eyetracker
/ items = (1,2,3,4,5,6,7,8)
/ select = text.attributeA.currentindex

</port>

with

<trial attributeA>
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ stimulusframes = [1 = attributeA, attributeAmarker]
/ posttrialpause = 250
/ screencapture = true
</trial>

Do the same with respect to attributeB. You should end up with markers in your eyetracking data stream indicating the presented item number.
By TBWray06 - 1/14/2016

Awesome! Very, very helpful...thank you!
Just curious, though: Is there a way to identify which "attribute" the current trial refers to? Using your approach above, the variable "marker" gives me an item number for each trial (as you suggested), but it doesn't say whether a "1" is item #1 from the attributeA list or #1 from the AttributeB list. Since this is a picture IAT, I also have two other item lists that consist of images, which increases the complexity a bit (because "1" could be a word from attributeA, attributeB, imageA, or imageB). Any ideas that might help me more efficiently identify each trial? 

Thank you again very much for your help! 
By Dave - 1/14/2016

You could do the following: Add a prefix to each item number (e.g. 1 indicating attributeA, 2 indicating attributeB). I.e.

<port attributeAmarker>
/ port = eyetracker
/ items = (11,12,13,14,15,16,17,18)
/ select = text.attributeA.currentindex

</port>

<port attributeBmarker>
/ port = eyetracker
/ items = (21,22,23,24,25,26,27,28)
/ select = text.attributeB.currentindex

</port>

That'll allow you to distinguish the two.
By TBWray06 - 1/14/2016

Ah, excellent idea! Thank you so much for your help!! 
By Johannes - 2/22/2017

Hi,
I'd like to present a series of trials in which a fixation cross is shown for 1s, followed a picture for 2s, and record eyetracking data throughout each trial (3s in total).
If I do it in the following way, I get what I need in the eytracking datastream: 3-second-duration segments with marker codes :

<trial nor_no>
/ stimulustimes = [1=normal,nor_no_eye]
/ trialduration = 3000
</trial>
('normal' is the picture element, and 'nor_no_eye' is a port element)

Problem is: as soon as I try to include the fixation cross period into the trial, I only get 1s segments and I can't figure out a way to get the whole 3s covered:

<trial nor_no>
/ stimulustimes = [1=fixcross,nor_no_eye,2000=normal,nor_no_eye]
/ trialduration = 3000
</trial>

<trial nor_no>
/ stimulustimes = [1=fixcross,nor_no_eye,2000=normal]
/ trialduration = 3000
</trial>

I tried to set the port element's erase attribute to false, but that didn't help.

Any ideas?

Thanks,
Johannes



By Dave - 2/22/2017

Johannes - Thursday, February 23, 2017
Hi,
I'd like to present a series of trials in which a fixation cross is shown for 1s, followed a picture for 2s, and record eyetracking data throughout each trial (3s in total).
If I do it in the following way, I get what I need in the eytracking datastream: 3-second-duration segments with marker codes :

<trial nor_no>
/ stimulustimes = [1=normal,nor_no_eye]
/ trialduration = 3000
</trial>
('normal' is the picture element, and 'nor_no_eye' is a port element)

Problem is: as soon as I try to include the fixation cross period into the trial, I only get 1s segments and I can't figure out a way to get the whole 3s covered:

<trial nor_no>
/ stimulustimes = [1=fixcross,nor_no_eye,2000=normal,nor_no_eye]
/ trialduration = 3000
</trial>

<trial nor_no>
/ stimulustimes = [1=fixcross,nor_no_eye,2000=normal]
/ trialduration = 3000
</trial>

I tried to set the port element's erase attribute to false, but that didn't help.

Any ideas?

Thanks,
Johannes




Try setting the trial's /beginresponsetime to 0

<trial nor_no>
/ stimulustimes = [0=fixcross,nor_no_eye,2000=normal]
/ trialduration = 3000
/ beginresponsetime = 0
</trial>