Skip to content

VIZ: EEG sensor locations wrong in inset plots #6304

Closed

Description

@drammock

EEG sensor plot insets seem to be broken in some cases. Here are a couple examples. First, from plot_compare_evokeds:

eeg

Similar problem with `evoked.plot(spatial_colors=True):

evoked_plot_spatial_colors

Compare those to the sensor positions w/r/t the head on mne.channels.make_eeg_layout(raw.info).plot() (raw.plot_sensors() gives similar result):

sphx_glr_working_with_sensor_locations_003

Activity

  1. added this to the 0.18 milestone on May 15, 2019
  2. removed this from the 0.18 milestone on May 16, 2019
  3. larsoner commented on May 16, 2019

    @larsoner
    Member

    I don't see this as a blocker for 0.18, which we want to get out tomorrow if possible. So moving the milestone to 0.19.

  4. added this to the 0.19 milestone on May 16, 2019
  5. massich commented on May 17, 2019

    @massich
    Contributor

    Is this related to #5190 ?

  6. drammock commented on May 17, 2019

    @drammock
    MemberAuthor

    @massich I don't know the layout plotting code well enough to say whether they're related. But these examples should make a good test case for whatever fix comes in for #5190 (or vice versa)

  7. jona-sassenhagen commented on May 28, 2019

    @jona-sassenhagen
    Contributor

    Isn't the issue simply that layouts are calculated using both MEG and EEG channels, and EEG channels (in this specific montage) don't go as deep?

    In which case this might be working as it should be.

  8. drammock commented on May 28, 2019

    @drammock
    MemberAuthor

    @jona-sassenhagen to me the issue is that the same set of EEG sensors nearly fills the head with raw.plot_sensors() or mne.channels.make_eeg_layout(raw.info).plot() but appear clustered at the crown of the head in the insets in evoked.plot() or plot_compare_evokeds() calls. IMO they should look the same.

  9. jona-sassenhagen commented on May 28, 2019

    @jona-sassenhagen
    Contributor

    Not sure how to deal with that. One issue here is that we make no absolute guarantees here. Consider outlines='skirt'.

    Arguably, the behaviour should match, but maybe the behaviour derived from calculating all layouts simultaneously is the better one.

  10. larsoner commented on May 28, 2019

    @larsoner
    Member

    Arguably, the behaviour should match, but maybe the behaviour derived from calculating all layouts simultaneously is the better one.

    @jona-sassenhagen @drammock can you check my proposal here:

    #3987 (comment)

    I argue that these plots should always show the sensors reasonably aligned to a ~80cm head. Then it doesn't matter what subselection, etc. you use. For MEG you align using dev_head_t and for EEG you're already in head coords so should be fine. It should be more true to the data and head alignment, and avoid these rescaling issues altogether.

    Also related: #5472, #5471

  11. drammock commented on Jun 4, 2019

    @drammock
    MemberAuthor

    adding another test case for #5472. Would be really nice to be able to do plots like this in the tutorials.

    import os
    import mne
    sample_data_folder = mne.datasets.sample.data_path()
    sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                        'sample_audvis_raw.fif')
    raw = mne.io.read_raw_fif(sample_data_raw_file)
    raw.crop(tmax=60).load_data()
    raw.plot_sensors(ch_type='eeg', show_names=True)
    midline_ch_names = ['EEG {:03}'.format(n) for n in (2, 12, 30, 48, 58, 60)]
    midline = raw.copy().pick_channels(midline_ch_names)
    midline.plot_sensors(show_names=True)

    Figure_1

    Figure_2

  12. agramfort commented on Jun 4, 2019

    @agramfort
    SponsorMember
  13. larsoner commented on Jun 4, 2019

    @larsoner
    Member

    I started looking at one point and it was a bit of a nightmare. But I'll see if I can look again soon

  14. massich commented on Jun 5, 2019

    @massich
    Contributor

    so did I when I started digitization I expect plot_sensors to get simplified with the refactorings.

  15. modified the milestones: 0.19, 0.20 on Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions