0

I am using psychopy and iohub to collect eyetracking data collection with the eyelink (sr research) system. I would like to be able to set two things up: fixation events (where fixation for 100ms at a certain point is required for the next part of the task/new trial to occur) and "interest areas": basically, areas that are pre-defined regions so that I can analyze gaze duration in specific regions. The code I'm using is just the generic stuff I got psychopy for eyetracking (I'm no coding expert) and I can't figure out how to modify it to do these two things.

Thanks!

Mik
  • 417
  • 6
  • 13

1 Answers1

0

In your question, "fixation events" and "interest areas" seem to be effectively the same thing from a calculation point of view. I guess the essence is that on every frame, you check the current gaze position, and monitor if a fixation within the relevant AOI has lasted at least 100 ms, or whatever duration is required.

I'm assuming you're using Builder

Pseudo-code:

Begin Routine:

fixation_started = False

Each Frame:

if gaze position is in AOI: # pseudo-code

    if not fixation_started:

        fixation_start_time = t
        fixation_started = True

    # else fixation has started, so check duration:
    elif t - fixation_start_time > 0.100:

        # do whatever, as this fixation has exceeded 100 ms

else: # subject is looking elsewhere:
    fixation_started = False
Michael MacAskill
  • 2,411
  • 1
  • 16
  • 28