Skip to content

visualization of autoreject results in MNE #6737

Closed

Description

@jasmainak

Currently, the autoreject code hacks into MNE by copying the epochs plotting code and adding two parameters. Unfortunately this is a bit unwieldy to maintain on the autoreject side as we're using a ton of private functions in MNE and duplicating almost 1000 lines of code ...

are people open to adding these parameters to epochs.plot in MNE, or alternatively some code to interpret the drop_log in a special way if it starts with the keyword AUTOREJECT. I can make a PR with the existing diff and iterate the API from there if people are okay with this.

Activity

  1. drammock commented on Sep 4, 2019

    @drammock
    Member

    no objection from me. I can work on this with you at the upcoming sprint if you want... it may have been my recent changes to the plotting code that caused this in the first place

  2. larsoner commented on Sep 5, 2019

    @larsoner
    Member
    • the first param, bad_epoch_idx -- I'm not sure why we'd need it, can't you just do epochs[bad_epoch_idx].plot()? If not, can you describe what it's trying to do?
    • the second param log_labels -- it seems like its job is to color specific parts of the (n_channels, n_epochs) plotting grid. So maybe the thing to do is make a new param called epoch_colors that defaults to 'auto', but can be any ndarray of str that broadcasts to shape (n_channels, n_epochs).
      • Each entry in the array is expected to be an mpl-like color string. (This is general enough to support arbitrary colors via the mpl hex strings, even if it's a bit cumbersome).
      • if they want to color squares in the plane (like you do) they pass an array of shape (n_channels, n_epochs).
      • if people want to color specific channels they can pass (n_channels,1) array
      • if they want to color specific epochs the can pass (n_epochs,) array

    I think this would be more general than just what's required for autoreject without adding too much more work.

  3. self-assigned this
    on Sep 5, 2019
  4. jasmainak commented on Sep 5, 2019

    @jasmainak
    MemberAuthor

    can't you just do epochs[bad_epoch_idx].plot()

    you could but I think it's nicer for people to see them next to the good epochs in red as you see them when you mark them interactively

    I'm fine making log_labels more general than autoreject. I guess we could just make it so that the horizontal scrollbar colors the epoch if a column in epoch_colors have the same repeated value. Wdyt?

  5. larsoner commented on Sep 5, 2019

    @larsoner
    Member

    you could but I think it's nicer for people to see them next to the good epochs in red as you see them when you mark them interactively

    What does bad_epoch_idx actually do, then? If all it does is change the color, then that would already be handled by the proposed epoch_colors arg.

    I guess we could just make it so that the horizontal scrollbar colors the epoch if a column in epoch_colors have the same repeated value. Wdyt?

    Whatever ends up looking reasonable. An average over the colors for the given epoch might be fine, too.

  6. jasmainak commented on Sep 5, 2019

    @jasmainak
    MemberAuthor

    What does bad_epoch_idx actually do, then? If all it does is change the color, then that would already be handled by the proposed epoch_colors arg.

    yep I think so

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions