Coder Social home page Coder Social logo

Comments (8)

AlexLepauvre avatar AlexLepauvre commented on September 6, 2024 4

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.

sappelhoff avatar sappelhoff commented on September 6, 2024 1

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.

scott-huberty avatar scott-huberty commented on September 6, 2024

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.

mscheltienne avatar mscheltienne commented on September 6, 2024

+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.

scott-huberty avatar scott-huberty commented on September 6, 2024

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.

mscheltienne avatar mscheltienne commented on September 6, 2024

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.

smathot avatar smathot commented on September 6, 2024

Just to chip in: the latest version of our blink-detection-and-reconstruction algorithm is implemented here:

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.

sappelhoff avatar sappelhoff commented on September 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.