Comments (8)
Hello everyone,
We can start with the simplest implementation of adding the function find_blinks with the method 'by_dropout' with which missing data segment from the pupils are considered a blink. This would be useful for other eyetracker which do not have any online parsers. Then, we can build up more methods (by slope, Mahot method...). Does that sound like a good plan to everyone?
Note that we will also probably need to add a parameter called dropout_value, because I think for some eyetracker a 0 is missing data, while for others, Nan are.
from mne-python.
That would be great! Especially also considering eye-tracking data from non SR-Research devices that may not have automatic blink locations shipped within the data.
I think I would prefer mne.preprocessing.eyetracking.find_blinks, and in the future a method parameter can be added, with a default set as whatever method we initially implemented. For example see mne.preprocessing.ICA
+1
I would include a parameter to control whether the annotation should be channel specific (attached to the pupil_ channel on which it was detected) or global.
+1
from mne-python.
CC'ing devs who have been involved in eye-tracking: @larsoner @britta-wstnr @mscheltienne @sappelhoff @drammock
What do you think about adding an eye-blink detection algorithm (for eyetracking signals)?
The OSF repo has no indicated license, but we hope that's OK @titoghose if we adapt the code for MNE.
Yes if no license is listed then the author would need to re-license their work in BSD-3 or MIT, or give explicit permission for us to translate and re-license the code in BSD-3: #11747 (comment)
Another idea 💡 the pypillometry package is MIT licensed and has implemented a blink detection method based off this paper by @smathot . There's also a couple other blink detection algorithms in there, one of which is based on pupil drop out (same as EyeLinks).
mne.preprocessing.eyetracking.find_blinks_by_slope(
I think I would prefer mne.preprocessing.eyetracking.find_blinks
, and in the future a method
parameter can be added, with a default set as whatever method we initially implemented. For example see mne.preprocessing.ICA
In any case, if folks are up for this, we should probably demonstrate the ability of this algorithm on an open-access dataset? I can recommend a few and share code to read them into MNE.
from mne-python.
+1 sounds like a useful tool!
I would also go with a find_blink
function coupled with a method parameter, to support multiple arguments in the future.
I would include a parameter to control whether the annotation should be channel specific (attached to the pupil_
channel on which it was detected) or global. One use case would be to use this function to annotate all blink globally in an M-EEG/eye tracking experiment with the non-bad label "blink"
, then run ICA and select the blink component based on the annotations.
from mne-python.
Based on the devs who were tagged, it seems like we are +3 for adding this feature (I am not counting myself in this tally). Those who have not responded, please feel welcome to chime in if you have any votes/comments/concerns.
@qian-chu how do you propose we (tentatively) move forward from here?
from mne-python.
Sounds good, you can have argument for specific methods be provided as kwargs, similarly to what you do for inst.compute_psd
with welch
or multitaper
.
from mne-python.
Just to chip in: the latest version of our blink-detection-and-reconstruction algorithm is implemented here:
- https://pydatamatrix.eu/1.0/series/
- https://github.com/open-cogsci/datamatrix/blob/1.0/datamatrix/_datamatrix/_blinkreconstruct.py#L137
If you decide to use it, then ideally it would not be duplicated but rather use datamatrix as a dependency so that bug fixes don't need to be duplicated.
The algorithm is a pretty ad-hoc affair that is the result of many years of dealing with edge cases. It works well but it's not very elegant. And every eye tracker needs it's own parameters. (The defaults are for the EyeLink.)
from mne-python.
We can start with the simplest implementation of adding the function find_blinks with the method 'by_dropout' with which missing data segment from the pupils are considered a blink. This would be useful for other eyetracker which do not have any online parsers. Then, we can build up more methods (by slope, Mahot method...). Does that sound like a good plan to everyone?
Excellent suggestion. First get the infrastructure and API in place, then add more and more complex methods.
If you decide to use it, then ideally it would not be duplicated but rather use datamatrix as a dependency so that bug fixes don't need to be duplicated.
I agree that it would be nice to not have to duplicate bug fixes, however at the same time we need to consider the implications of adding a large dependency (of which the blink algorithm is a minor part) for a very small use-case (seen as relative to MNE-Python as a whole).
I have one more point:
More recent Tobii eye-trackers supply "eye openness data", which track the eyelid instead of the pupil, it is:
a measure of the largest sphere that can fit between the upper and lower eyelids.
This is similar to a pupil size data channel, but (from my limited testing) is rarely (or never?) NaN. Theoretically, this should work even better for detecting blinks. If anyone has experience with this, I'd be curious to hear about it.
The algorithms we plan to implement here should also work with this data, we'd just pass a particular channel to the method for annotating blinks.
from mne-python.
Related Issues (20)
- Misleading parameter description in `fit_transform` method of `CSP` and `SPoC` HOT 1
- Cannot open nedf file from Neuroelectrics HOT 4
- Should `fetch_fsaverage()` return a `Path`? HOT 8
- Add Missing Fields to RawEEGLAB and EpochsEEGLAB Classes HOT 3
- HTML repr tables have really bad text contrast ratios HOT 4
- all random code should use default_rng
- DOC: Contributor credit improvements HOT 1
- CSP `rank` parameter does not behave as expected HOT 2
- Replace `psutil.virtual_memory()` with our own implementation? HOT 2
- RFC: developer meta-environments HOT 4
- Checkmarks in `mne.sys_info()` look out of place on Windows HOT 9
- Add sensor size option for plotting iEEG electrodes HOT 2
- MEG data problem consulting HOT 18
- Typo in SSD documentation HOT 2
- Return generated filenames when saving (splitted) instances HOT 1
- bug in auto-linking of PRs in changelog HOT 1
- code credit dedup HOT 2
- TimeChange, TimeBrowse, ChannelBrowse in ui-event system HOT 5
- DOC: docstr for `raw.get_montage` does not make sense HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mne-python.