Skip to content

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

Closed

Description

@scott-huberty

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.

Activity

  1. larsoner commented on Jul 6, 2023

    @larsoner
    Member

    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
  2. scott-huberty commented on Jul 6, 2023

    @scott-huberty
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions