I am using a very recent commit because the asc eyetracking file import functions are way faster now - thank you for implementing all these great tools! I guess, I noticed a small bug in the get_eyelink function, but maybe you can have a look into that. When the mask for blinks and saccades is expanded by a certain offset, the for loop runs over the indices_to_expand, creates beginning and ending and sets everything in between true. But as the loop is using the whole indices vector instead of single elements, only the first value from each vector is taken and then the loop is left. Furthermore, for the left indices the endidx elements are smaller than the begidx elements, so these should be switched. I hope this wasn't too confusingly explained, sorry!
Steps to Reproduce
using pspm_import with a pupil datafile that contains blinks
Expected Results
pspm_get_eyelink gets called and expands the blink by the given offset using the function expand_mask
Actual Results
only the first blink is expanded
(Optional) Possible Cause and Solutions
see summary above, I changed lines 428ff to:
for ii = 1:numel(indices_to_expand_towards_left)
idx = indices_to_expand_towards_left(ii);
begidx = max(1, idx - offset);
endidx = max(1, idx - 1);
mask(begidx : endidx) = true;
end
for ii = 1: numel(indices_to_expand_towards_right)
idx = indices_to_expand_towards_right(ii);
begidx = min(ndata, idx + 1);
endidx = min(ndata, idx + offset);
mask(begidx : endidx) = true;
end
(Optional) Screenshots if Graphical User Interface is Used
Thank you for your detailed bug report. You are definitely right in both of your observations. I will incorporate your suggested changes to PsPM in the next revision.
Post by Ulrike Horn:
"
Summary
I am using a very recent commit because the asc eyetracking file import functions are way faster now - thank you for implementing all these great tools! I guess, I noticed a small bug in the get_eyelink function, but maybe you can have a look into that. When the mask for blinks and saccades is expanded by a certain offset, the for loop runs over the indices_to_expand, creates beginning and ending and sets everything in between true. But as the loop is using the whole indices vector instead of single elements, only the first value from each vector is taken and then the loop is left. Furthermore, for the left indices the endidx elements are smaller than the begidx elements, so these should be switched. I hope this wasn't too confusingly explained, sorry!
Steps to Reproduce
using pspm_import with a pupil datafile that contains blinks
Expected Results
pspm_get_eyelink gets called and expands the blink by the given offset using the function expand_mask
Actual Results
only the first blink is expanded
(Optional) Possible Cause and Solutions
see summary above, I changed lines 428ff to:
for ii = 1:numel(indices_to_expand_towards_left) idx = indices_to_expand_towards_left(ii); begidx = max(1, idx - offset); endidx = max(1, idx - 1); mask(begidx : endidx) = true; end
for ii = 1: numel(indices_to_expand_towards_right) idx = indices_to_expand_towards_right(ii); begidx = min(ndata, idx + 1); endidx = min(ndata, idx + offset); mask(begidx : endidx) = true; end
(Optional) Screenshots if Graphical User Interface is Used
Technical Info
"