-
Notifications
You must be signed in to change notification settings - Fork 11
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 velocity hz? #13
Comments
Hi Bonnie, I would actually hold off on using the velocity function. I am going to incorporate Ronen's blink algo which does not require thresholds to be passed: https://link.springer.com/article/10.3758/s13428-017-1008-1. I will probably push that sometime in the next week or so.
You are correct! I should not have defined it again :)
This was roughly based on something Sebastiaan did in his blink paper. I could not quite capture what he did in that paper so I opted for a basic velocity measure. It is not the most elegant and I think Ronen's algo is a bit better and does not require interpolation or extending the blinks. I do agree with you that interpolation should probably be taken out. |
How is a basic velocity measure working for your group? I would be interested to know. |
In this vignette I do separate them: https://github.com/dmirman/gazer/blob/master/vignettes/blink_detection.Rmd. |
oh great! Thanks for the clarity. I looked over Sebastiaan's paper and couldn't quite understand how you got here. We have not implemented velocity in our pipeline. I just starting working today to compare all of the options out there to see which we want to use moving forward. I started with what was implemented in Gazer (NA+extension, blink velocity+extension, MAD+extension) and then moved on to other options out there (Hampel filter, Ronens, etc.). I have the R code from osf for the noised based algo. Do you think you will change it substantially (other than fitting it to gazer format)? I'm get justing the code down and then will run some tests. I'll let you know how they go! |
When did you last download Ronen's code? I actually worked with him and Paul a month ago to fix some errors. I also wrote a bit of code to actually use the function. |
I do not plan to change the function much. I will actually probably share my vignette/blog on how to use it with gazeR as well. |
Just checked- I have the most up to date version of the code. Let me know when you post it. I was able to test it for one trial but I haven't had the chance to edit it to be able to run it grouped by subject x trial. Although I do not have an example to point to, I imagine there may be times where blinks are recorded with these sharp changes without having missing data. I think one draw back to their approach is the reliance on missing data. |
Below is some code that will help you on your journey.
The noise_based_blink_detection should be included in gazeR now.
|
Hi! Best, |
Hi, Have a look at this document. I want to say that I did not write this code and have not had time to extensively validate it. IMHO I would probably use the forward and backward fill method to treat blinks and then interpolate. The algo is from here: https://pubmed.ncbi.nlm.nih.gov/29340968/ |
Hi Jason & Ziva The pdf fills in a few missing pieces but it still fails when trying to apply the function across subject and trials. My issue was that blinks that occurred in one trial were repeated for every other trial. Below is my fix (see points 2 & 4). I agree that the forward and backward fill method is a good way to treat blinks. That is the method my group uses and will likely continue to use. bz
|
Thanks for looking into this @bzuck-temple :). I'm glad you fixed some of the kinks. Did you ever figure out what the best method was? |
@bzuck-temple can share how the noise algo worked on your data? In my sample data I had some artifacts and it didn’t do a great job. |
Anecdotally, I found that it struggled with marking the offset. It kept more of what I would identify as part of the blink than I would have liked. I only compared the methods visually- never got around to doing a systematic comparison. |
Hi! Happy to see this implemented! I am wondering if "hz=250" on line 34 should be set to "hz=hz"?
mutate(extendpupil=extend_blinks(blinks_pupil, fillback=fillback, fillforward=fillforward, hz=250)) %>%
mutate(extendpupil=extend_blinks(blinks_pupil, fillback=fillback, fillforward=fillforward, hz=hz)) %>%
If not. what is the rational for using a different sample rate for extending blinks?
Moreover, I am wondering if blink extension and interpolation need to be incorporated in this function at all... I find it odd not to give the choice of interpolation type (linear or cubic) or max gap which you have incorporated into the interpolation function.
Best,
Bonnie
The text was updated successfully, but these errors were encountered: