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

Blink Detection #15

Open
jgeller112 opened this issue Dec 16, 2019 · 3 comments
Open

Blink Detection #15

jgeller112 opened this issue Dec 16, 2019 · 3 comments

Comments

@jgeller112
Copy link

jgeller112 commented Dec 16, 2019

Hi!

It is my understanding that tracklossed data are usually labeled as blinks? The blink detect function is not working with some of the data I am processing. Interestingly, it works with data from Experiment Builder, but not when I process data from Psychtoolbox. I compared the below data to the sample report from SR and there are some large discrepancies in blink detection.

install::remotes("dmirman/gazer")
samp <- system.file("extdata", "samp.xls", package = "gazer")
samp<-fread(samp)

 blk <- saccades::detect.fixations(samp, lambda=16)

blk1 <- blk %>%
        dplyr::filter(event=="blink") %>%
        tidyr::gather(data=., key="startend", value="time", start:end) # gather all the blinks
blk_merge <- dplyr::full_join(samp, blk1)
   
@tmalsburg
Copy link
Owner

I suspect that one of your data sets uses NAs to code trackloss. In this case the code for blink detection might fail. Could you provide sample data?

For a description of the blink detection heuristic see: https://github.com/tmalsburg/saccades#blinks-and-artifacts

@jgeller112
Copy link
Author

jgeller112 commented Dec 17, 2019

The data were collected with EyeLink so I believe all the trackloss is 1e+08. There are no x,y coordinates with NAs. The sample data can be extracted with the above code. I will show a few lines of the data. The first few rows should be labeled as a blink, but are not.

# A tibble: 6 x 11
  trial    time    gxL    gyL   paL     gxR     gyR   paR   pup      x      y
  <dbl>   <int>  <dbl>  <dbl> <dbl>   <dbl>   <dbl> <dbl> <dbl>  <dbl>  <dbl>
1     1 2244092 1.00e8 1.00e8     0  1.00e8  1.00e8     0     0 1.00e8 1.00e8
2     1 2244094 1.00e8 1.00e8     0  1.00e8  1.00e8     0     0 1.00e8 1.00e8
3     1 2244096 1.00e8 1.00e8     0  1.00e8  1.00e8     0     0 1.00e8 1.00e8
4     1 2244098 1.00e8 1.00e8     0  1.00e8  1.00e8     0     0 1.00e8 1.00e8
5     1 2244100 1.00e8 1.00e8     0 NA      NA         NA     0 1.00e8 1.00e8
6     1 2244102 1.00e8 1.00e8     0  1.00e8  1.00e8     0     0 1.00e8 1.00e8

Label here refers to the start and end of a blink.

# A tibble: 704,918 x 6
   trial    time         x         y   pup Label
   <dbl>   <int>     <dbl>     <dbl> <dbl> <chr>
 1     1 2244092 100000000 100000000     0 NA   
 2     1 2244094 100000000 100000000     0 NA   
 3     1 2244096 100000000 100000000     0 NA   
 4     1 2244098 100000000 100000000     0 NA   
 5     1 2244100 100000000 100000000     0 NA   
 6     1 2244102 100000000 100000000     0 NA   
 7     1 2244104 100000000 100000000     0 NA   
 8     1 2244106 100000000 100000000     0 NA   
 9     1 2244108 100000000 100000000     0 NA   
10     1 2244110 100000000 100000000     0 NA  

@tmalsburg
Copy link
Owner

If you provide me with a reproducible example, I could look into this and hopefully find out what happening.

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

No branches or pull requests

2 participants