You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add function to plot heatmap of eye-tracking gaze position #11782
I think plotting eyegaze data as a heatmap can be more intuitive than a timeseries plot. Having a function in MNE for this could be nice. Maybe we could add an eyetracking module to mne.viz for this?
Describe your proposed implementation
Ultimately, It would be great if this function could be called from either a Raw or Epochs object, (and for Raw, there could be start and duration parameters), but as a start we could just implement the function to take an Epochs object.
I have some scratch code for this, but it could be improved before merging into mne. For example maybe we could implement some gaussian smoothing to make the heatmap traces look nicer.
Here's a really simple example from a short saccadic pursuit tasK:
Describe possible alternatives
Open to ideas!
Additional context
Adding this function is one of the tasks I listed in my GSoC proposal.
Reacted by Mathieu Scheltienne and Stefan Appelhoff
My vote would be rather than Epochs and Raw methods let's make a mne.viz.eyetracking.* namespace and keep the functions there since they apply to a small subset of datasets. Most of our epochs.plot / raw.plot-style methods are meant to work with any dataset, which 99% of the time so far for MNE means M/EEG. So adding a new epochs.plot_gaze or whatever that plots this heatmap won't be applicable to 99% of Epochs instances, so the scope seems wrong.
For the example above I would say that:
the default vlim=None should mean "zero to the max value" but it's currently not at the max value
I'd probably want some sort of smoothing kernel/param option sigma=0 where if sigma > 0 it smooths with a Gaussian kernel
the axes aspect should be set to 'equal' (reasonable assumption that pixels are square) but it's not currently
Activity
larsoner commentedon Jul 6, 2023
My vote would be rather than
EpochsandRawmethods let's make amne.viz.eyetracking.*namespace and keep the functions there since they apply to a small subset of datasets. Most of ourepochs.plot/raw.plot-style methods are meant to work with any dataset, which 99% of the time so far for MNE means M/EEG. So adding a newepochs.plot_gazeor whatever that plots this heatmap won't be applicable to 99% ofEpochsinstances, so the scope seems wrong.For the example above I would say that:
vlim=Noneshould mean "zero to the max value" but it's currently not at the max valuesigma=0where ifsigma > 0it smooths with a Gaussian kernel'equal'(reasonable assumption that pixels are square) but it's not currentlyscott-huberty commentedon Jul 6, 2023
Fair enough, sounds good!
I'll look into your other points in relation to the code, and open up a PR soon.