Howdy, Stranger!

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

Supported by

[solved] Areas Of Interest (eye tracking)

edited June 2015 in OpenSesame

I am using Open Sesame with Eyelink plug-ins for a face recognition experiment. I cannot figure out how to define different interest ares for each face. My experiment will have 2 blocks: 1 Male and 1 Female. Within each block there will be 4 loops. Each loop should contain contain different faces. Each face within the loop should have the same interest area. The interest areas across the loops will vary.
Thank you very much !


  • edited June 2014


    Are you using the gaze behaviour (i.e. the number of fixations and dwell time per area of interest) online? That is: do you adept your experiment based on where participants are looking? If so, you might want to check out the AOI plug-in (see here).

    If you're just interested in measuring gaze behaviour, without doing anything gaze contingent, I would suggest analysing your data offline. Make sure to save your gaze data sensibly (use lots of log messages to keep track of what image was shown and when!), so that you can analyse it after collection. Usually, AOIs are only defined afterwards and are subject to change (e.g. as a function of your data quality).

    Another tip: make sure to do a test run of your experiment, and to analyse the data of this test run before you start testing on a larger scale.

    Good luck!


  • edited 7:28AM

    Thank you Edwin!
    You're right I am looking at gaze behaviour. Participants will look at different faces with interest areas I will define in advance. Then I will analyze the distributions to each area (eyes, mouth, nose) .

    I am using an inline script tool and typed in :

    exp.eyelink.log("!V IAREA FREEHAND <Brad-Pitt_151.jpg> <32, -64> <-64, 128> <128,128> [nose]")
    I got the x,y coordinates from sketchpad tool.

    But I think what I'm looking for is a way to define a different interest area for each face in the same loop. Do I just keep adding the same line to the inline script (my inline script is located above the sketchpad item) and just changing the 'id' for each photo? Also please let me know if what I typed in makes sense. I followed this format:

    exp.eyelink.log("!V IAREA FREEHAND <x1, y1> <x2, y2> <x3, y3> [label]")
    for id I put the name of the file and for [label] i put region of the face. Is that correct?

  • edited 7:28AM

    I think you might have missed my point. You don't know the quality of your data beforehand, but this does have a potentially large effect on your AOI analysis. Therefore it would be wiser to use an offline analysis. Obviously, a custom analysis script would allow you to do so, but SR Research' Data Viewer offers the same possibility (see the manual, page 36).

    If you really want to pursue an online analysis, please refer to the plug-in I mentioned before. This allows you to create several AOIs and calculate the amount of fixations. If you simply want to log a message whenever an AOI is hit, it would be very easy to adopt the code of that plug-in to do so.

    Another possibility, the one you seem to be keen on using, is using EyeLink's own function for defining an AOI. The procedure for this is explained on the last page of the OpenSesame and EyeLink manual. The syntax for the log message is !V IAREA FREEHAND <x1, y1> <x2, y2 > ... <xn, yn> [label], as illustrated by the example below:

    # AOI 1
    exp.eyelink.log("!V IAREA FREEHAND 1 100,100 100,200 200,150 nose")

    Note that the id should be an integer, the coordinates are absolute coordinates with (0,0) as the top left (not the coordinates that are relative to the screen centre, as they are defined in the sketchpad!), and that the label is optional.

    Good luck!

  • edited 7:28AM

    Thank you very much Edwin!

  • edited 7:28AM

    I can't seem to figure out how to get the absolute coordinates. Also how do I set a difefrent id integer for each photo?
    Thank you!

  • edited 7:28AM

    The ID integers are for the AOIs, not for the different photos. The absolute coordinates can be calculated: simply add half of the screen size to the relative coordinates (that use (0,0) for the centre).


    Coordinate (0,0) is the screen centre, on a screen with a resolution of 1920x1080. To recalculate this to absolute coordinates, simply add half of the screen width to the horizontal coordinate and half of the screen height to the vertical coordinate, like so:

    0 + 1920/2 = 960

    0 + 1080/2 = 540

    Thus the absolute coordinate of the screen centre would be (960,540) in this example.

    In OpenSesame, using a Python inline_script:

    # define your coordinate here
    relcor = (0,0)
    # calculate the absolute coordinate
    newx = relcor[0] + self.get("width") / 2
    newy = relcor[1] + self.get("height") / 2
    # save under a new variable name
    newcor = (newx, newy)
  • edited 7:28AM

    Hi all,

    I'd like to define Regions of Interest as well. Using TheEyetribe eyetracker I already fiddled around with the aoi plugin but couldn't convince it to work.

    Any suggestions for a starting point?

    Thx, Digo

  • edited 7:28AM

    I'm removing that link from your post, as it seems to be completely unrelated (and thus most likely spam). If you can explain why it's not, please do appeal.

    As I missed the comment by @hiwi68, here's an extremely late answer: that plug-in was written for the EyeTracker plug-ins, which is a precedent of the PyGaze plug-ins. I'm afraid they only worked with SMI and EyeLink trackers. Sorry!

    You can implement your own AOI analysis post-experiment. Unless you really need to do it online (which is where the AOI plug-in was for); then you could opt for using the sample method within an inline_script to check where a participant's gaze is.

  • Hi Edwin, can I ask a different question. I am looking to compare two groups of participants. I want to calculate the Euclidean distance by either:

    (1) take the distance of each participant from a fixed point in the display (display centre, corner). Please how do I find the display centre and corner? OR

    (2) take the distance of each participant from their group centre. Again, does the group centre here mean the mean x and y for that group?

    Thanks for all your response.


Sign In or Register to comment.