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

add function to plot heatmap of eye-tracking gaze position #11782

Closed
scott-huberty opened this issue Jul 6, 2023 · 2 comments · Fixed by #11798
Closed

add function to plot heatmap of eye-tracking gaze position #11782

scott-huberty opened this issue Jul 6, 2023 · 2 comments · Fixed by #11798
Labels

Comments

@scott-huberty
Copy link
Contributor

Describe the new feature or enhancement

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:

heatmap

Describe possible alternatives

Open to ideas!

Additional context

Adding this function is one of the tasks I listed in my GSoC proposal.

@larsoner
Copy link
Member

larsoner commented Jul 6, 2023

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

@scott-huberty
Copy link
Contributor Author

let's make a mne.viz.eyetracking.* namespace and keep the functions there since they apply to a small subset of datasets.

Fair enough, sounds good!

I'll look into your other points in relation to the code, and open up a PR soon.

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

Successfully merging a pull request may close this issue.

2 participants