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

DOC: EEG eye-tracking alignment tutorial #11770

Merged
merged 34 commits into from
Jul 6, 2023

Conversation

scott-huberty
Copy link
Contributor

@scott-huberty scott-huberty commented Jul 2, 2023

Closes #11759

  • I updated the current eye-tracking tutorial to include a section on aligning and combining simultaneously collected EEG and eye-tracking data

  • This required updating the eyelink sample dataset, including a companion EEG file ( ~ 100mb).

  • UPDATE: here is the tutorial

EDIT: Hmmm... I can see that all my commits from PR #11725 are showing up below.. This branch was branched off from my interpolate_blinks branch before #11725 was merged to main. These prior commits aren't actually reflected in the "files changed" of this PR, but If this is an issue, I can re-implement my documentation updates in a new fresh branch..

For clarification- only e86c335 and thereafter are unique to this branch and not on main..

scott-huberty and others added 22 commits June 17, 2023 09:36
- The function lives in mne.preprocessing.eyetracking_pupillometry
- added a test
- updated the tutorial
- Interpolate over both eyegaze and pupil channels
- add match parameter with default "BAD_blink"
- expect that each blink annot has ch_name info
- remove 'BAD_' from any interpolated annotations
- updated test, marked xfail until PR 11746 is merged
…nterpolate_blinks

Merged main and resolved conflict stemming from my previous PR, in preprocessing/eyetracking/__init__
- changed variable names
- added clause to handle annoations without ch_names info
- added a test to catch the code block that should raise an error when a blink annotaiton doesnt have ch_name info
- added tests for cases where input to function is incorrect
- new tests make sure that warnings and exceptions are raised
Britta's docstring revisions

Co-authored-by: Britta Westner <[email protected]>
- and minor refactor
- and added myself to author list of module
- interpolation of gaze channels defaults to false
- moved interpolate_blinks function to pupillometry module
- added test for new flag
- updated API documentation
- scipy interp1d is now a legacy class and is not advised
- if indices at start or end of array need to be interpolated, numpy interp will apply ZOH interpolation by default
- updated it to pull new eeg-et recording from OSF
-This updates the eye-tracking tutorial to including integration with EEG
-This required an update to the eyelink sample datat
-Updated the description of the eyelink data in datasets overview
@larsoner
Copy link
Member

larsoner commented Jul 3, 2023

EDIT: Hmmm... I can see that all my commits from PR #11725 are showing up below.. This branch was branched off from my interpolate_blinks branch before #11725 was merged to main. These prior commits aren't actually reflected in the "files changed" of this PR, but If this is an issue, I can re-implement my documentation updates in a new fresh branch..

No this won't be an issue because we squash+merge nowadays

Let me know when you're happy and things are green so I should look again!

@scott-huberty
Copy link
Contributor Author

Let me know when you're happy and things are green so I should look again!

All green, whenever you're ready.

Also cc @britta-wstnr !

@larsoner
Copy link
Member

larsoner commented Jul 3, 2023

Copy link
Member

@britta-wstnr britta-wstnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @scott-huberty ! Just one typo and one comment from my side - good to go after that!

typo fix from britta

Co-authored-by: Britta Westner <[email protected]>
expand on the note regarding  interpolation in eyegaze channels
@scott-huberty
Copy link
Contributor Author

Note: incorporated @britta-wstnr 's suggestion in 0067585

@drammock
Copy link
Member

drammock commented Jul 4, 2023

heads-up that I'm reviewing the tutorial, please don't merge just yet.

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the specific in-line comments, here are a couple more general ideas:

  • the Ocular Annotations section might benefit from a plot of the data showing a few annotation spans? (if you do that it will change the thumbnail image, so if you want to keep the calibration image you should use the gallery_thumbnail_number trick --- git grep it to see examples if you're not familiar)
  • (not changed in this PR) in the calibration section, you're printing 3 keys that are already shown in the REPL output of the Calibration object, before moving on to the 3 keys that are not part of the REPL output. Don't bother; you can demo the dict-like access and introduce the additional attributes at the same time, like: "Calibrations have dict-like attribute access; in addition to the attributes shown in the output above, addtional attributes are positions (meaning), offsets (meaning), and gaze (meaning)".

scott-huberty and others added 2 commits July 4, 2023 14:29
@scott-huberty
Copy link
Contributor Author

Thanks @drammock for the edits, I implemented everything except for adding another plot in the ocular annotations section (I agree that it could be nice, but we do have a plot of the data in one of the following sections, so hopefully that will suffice?).

@drammock
Copy link
Member

drammock commented Jul 5, 2023

Thanks @drammock for the edits, I implemented everything except for adding another plot in the ocular annotations section (I agree that it could be nice, but we do have a plot of the data in one of the following sections, so hopefully that will suffice?).

Sounds good I'll look first thing tomorrow and then merge

Copy link
Member

@drammock drammock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice tutorial, good work @scott-huberty. Just a couple minor tweaks suggested, then let's merge.

some more suggestions by Dan

Co-authored-by: Daniel McCloy <[email protected]>
@scott-huberty
Copy link
Contributor Author

Thanks!

The failed tests look unrelated, but feel free to re-trigger those CI's if you'd like to

@larsoner
Copy link
Member

larsoner commented Jul 6, 2023

I'll fix them in #11781, thanks @scott-huberty !

@larsoner larsoner merged commit 79647ec into mne-tools:main Jul 6, 2023
@britta-wstnr
Copy link
Member

Nice work @scott-huberty !

@scott-huberty scott-huberty deleted the eeg-et_tut branch July 6, 2023 19:35
larsoner added a commit to larsoner/mne-python that referenced this pull request Dec 6, 2024
* upstream/main: (26 commits)
  MAINT: Better fix for deprecation (mne-tools#11789)
  udpate doc for 11786 (mne-tools#11787)
  MAINT: Ignore warning in example (mne-tools#11781)
  Keeping event names when combining channel on epochs objects (mne-tools#11786)
  DOC: Fix incorrect docs for annotate_movement [ci skip] (mne-tools#11779)
  Refresh eegbci code and docstrings (mne-tools#11783)
  DOC: EEG eye-tracking alignment tutorial (mne-tools#11770)
  [MRG] By-pass set_annotations when plotting ICA sources  (mne-tools#11766)
  add missing changelog from 11773 (mne-tools#11777)
  Fix eeglab.py, an error for read annotations in `RawEEGLab` (mne-tools#11773)
  [MRG] Use FIFF.FIFF_UNITM_NONE instead of 0 when adding a reference channel (mne-tools#11774)
  MAINT: Update for linkcheck [circle linkcheck] (mne-tools#11771)
  ENH: Interpolate blinks in eyetrack channels (mne-tools#11740)
  MAINT: Work around joblib bug (mne-tools#11765)
  Update manual install docs (mne-tools#11764)
  add logging message about which EOG channel used for blink detection (mne-tools#11757)
  DOC: Fix docs (mne-tools#11756)
  BUG: Fix bug with SNR calculation (mne-tools#11755)
  BUG: Fix bug with cHPI off (mne-tools#11754)
  Change color from annotation to red if name changes to "bad_" or "edge_" (mne-tools#11753)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial for EEG-Eyetracking integration
4 participants