Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug? Incorrect saccade offset assigned in detecteyemovements.m #24

Open
nabusch opened this issue Jun 2, 2022 · 3 comments
Open

Bug? Incorrect saccade offset assigned in detecteyemovements.m #24

nabusch opened this issue Jun 2, 2022 · 3 comments
Assignees

Comments

@nabusch
Copy link

nabusch commented Jun 2, 2022

The landing position of the last saccade of each epoch is incorrect. This seems to be due to a bug in function detecteyemovements.m in line 360:

if endsmp(end) > size(gazexy,2), endsmp(end) = size(gazexy,2); end

The intention here seems to be that if the temporal offset of the last saccade ensmp(end) is later than the last sampling point of the epoch, then the offset should simply be the last available sampling point. However, if I understand correctly the code above refers to the wrong dimension of gazexy, which represents sampling points * eye channels (vertical, horizontal). Thus, the offset of the last saccade is almost garanteed to be later than size(gazexy,2) = 2.

I think the correct code should refer to the first dimension of gazexy:

if endsmp(end) > size(gazexy,1), endsmp(end) = size(gazexy,1); end

@olafdimigen
Copy link
Owner

olafdimigen commented Jun 2, 2022

Indeed, thanks for spotting this (major) bug.
Gaze samples are indeed stored in rows, not columns (transposed from standared EEG.data format).
Hotfixed in b4083ff

@olafdimigen
Copy link
Owner

olafdimigen commented Jun 3, 2022

What does this bug mean? This serious bug meant that a wrong offset latency (saccade offset sample) and a wrong saccade end position (gaze position at end of saccade) was assigned to the last saccade event in a given epoch, detected with the Engbert & Kliegl (2003) algorithm (function detecteyemovements()). Only the last detected saccade in any epoch is affected. This bug is obviously more severe if saccades were detected in epoched data, rather than in continuous data. Imported saccade events (e.g. Eyelink events) are not affected. Similarly fixation events, their (fixation) onset/offset latencies or their (fixation) gaze positions are not affected by the bug.

@olafdimigen
Copy link
Owner

For clarity, this bug was (hot)fixed in version 1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants