tmalsburg / saccades

Detection of fixations and saccades in eyetracking data
GNU General Public License v2.0
76 stars 14 forks source link

Events are missing #16

Open GELIKABE opened 4 years ago

GELIKABE commented 4 years ago

Hi, first of all thank you for providing saccades! I have set up my dataset like the samples dataset, but unfortunately, in the detect.fixations output, the event column is missing. Do you have any idea why this is happening? I have another question: thank you for providing the aggregate.saccades function. Do you maybe have a workaround for regression detection? Thank you, Angelika

tmalsburg commented 4 years ago

Hi Angelika. Note that the CRAN version of the package is outdated. Make sure you're using the version from GitHub. Install instructions are here. With the GitHub version you should get the event column.

Regarding your second question, could you please elaborate on what problem you're trying to solve? I'm not sure what you mean by "workaraound for regression detection".

GELIKABE commented 4 years ago

Hi Titus. I hope you are doing well! Thank you so much for your answer, that works! However, I seem to not be able to get saccades out of the events nor using the aggregate.saccades function. Best, Angelika

tmalsburg commented 4 years ago

The function for saccades is detect.saccades. See its documentation for details.

tmalsburg commented 4 years ago

Oh, sorry, scratch that. There is currently no function for saccades. I intended to offer it at some point and had a prototype but apparently never included it in the package. Having said that, anything between two events that you get from detect.fixations is a saccade. So by comparing adjacent events, you can calculate saccade properties, like amplitude, duration, and so on. You might be surprised that there is no function that does that for you, given that the package is called "saccades". Perhaps 'saccades' wasn't the best choice for a name ;)

dralicecade commented 3 years ago

Hi there, I have followed your instructions above (regarding missing events) but now I get the error message of "Error in detect.fixations(n, lambda = 6, smooth.coordinates = T, smooth.saccades = F) : Samples need to be in chronological order within trial." As far as I can see my data is in chronological order (although it doesn't start at 0 as the first timepoint) - any suggestions? Thanks, Al

tmalsburg commented 3 years ago

The test for chronological order is this

  if (! all(with(samples, tapply(time, trial, function(x) all(diff(x) > 0)))))
    stop("Samples need to be in chronological order within trial.")

I don't see any room for false positives here. Could you please check again?

GELIKABE commented 3 years ago

Oh, sorry, scratch that. There is currently no function for saccades. I intended to offer it at some point and had a prototype but apparently never included it in the package. Having said that, anything between two events that you get from detect.fixations is a saccade. So by comparing adjacent events, you can calculate saccade properties, like amplitude, duration, and so on. You might be surprised that there is no function that does that for you, given that the package is called "saccades". Perhaps 'saccades' wasn't the best choice for a name ;)

Thanks anyway and thank you for your answer :) Do you or anyone have tipps for gaining information about saccade direction (regressions vs. forward saccades) Thanks, Angelika

tmalsburg commented 3 years ago

If you need the directions, you'd have to calculate the difference vectors between the x,y-coordinates of two consecutive fixations within trial. There's probably a clever way to do this with Tidyverse, but I don't know it from the top of my head and would have to google it myself.

One day I will add that function for saccade info.