How are roi timesOn and timesOff calculated

OS (e.g. Win10): macos 10.15.7
PsychoPy version (e.g. 1.84.x): 2021.2.3
Standard Standalone? (y/n) If not then what?: yes

i am building a visual world paradigm eyetracking experiment using Eye Tracker Region of Interest Component — PsychoPy v2021.2.4 to get fixation to objects, using mousegaze to get simulated data

i have tried all 3 options of time relative to

the saved time data doesn’t make sense to me

below is when set to experiment

timeson and off are earlier than their starting time

below is when set to roi onset

i am spending less than 10 s on each trial, timesOn cannot be 20s after roi started

result from demo which chose roi onset

below is when set to routine (back to my task)
not only they are negative, timesOff is earlier than timesOn

can someone please explain to me how these values are calculated?

When the ROI object is created at the start of the experiment, within it there’s a core.Clock object created and stored as (in this case) TL_ROI_trial.clock. When the ROI hasn’t started yet, the value of this clock is continuously reset to 0, otherwise it’s allowed to run. So the times recorded should be relative to the start time of your ROI.

With the very large times, I wonder whether it’s that the ROI is starting immediately with the routine, and starting off looked at, so the clock doesn’t have chance to reset… I’ll run some tests and see if that’s possible! As a quick fix, you could set the start time to be the second frame rather than 0?

The minus numbers I’ve got less of an idea about - as the clock is reset to 0 and counts up from there, negative timestamps shouldn’t be possible.

thanks for reading and thinking about this, i am holding off my eyetracking study and waiting for their 2022 release, maybe this will be fixed in new release

I can’t replicate this bug, but I am using the 2022.1 release - it’s out on GitHub but only the .0, which we’re always cautious about over-hyping because it’s not been tested out in the wild yet! Most of the time it’s best to wait for .1 or .2, but in this case I think it’s worth installing and trying again, it may well be that I can’t replicate because it’s been fixed, we did make a few changes to ROI:

Let me know if you still get this bug in 2022.1.0 :slight_smile: What eyetracker are you using by the way? I’m testing it out using MouseGaze as I don’t have any eyetrackers, so it may also be that the bug is specific to one eyetracker.