Skip to content

MRG: Seeg eeg seperated in butterfly plot epochs - #6210

Merged
larsoner merged 27 commits into
mne-tools:masterfrom
stfnrpplngr:seeg-eeg-seperated-in-butterfly-plot-epochs
Apr 26, 2019
Merged

larsoner merged 27 commits into
mne-tools:masterfrom
stfnrpplngr:seeg-eeg-seperated-in-butterfly-plot-epochs

Conversation

@stfnrpplngr

Copy link
Copy Markdown
Contributor

Added a butterfly argument to epochs.plot(). Furthermore, it is now able to seperately show "seeg", "ecog" etc. in the butterfly view.
I hope it is not in conflict with #4972
Some time ago, I did something similar for the raw browse function (#4848), but there it needed much less refactoring.

seperated_channeltypes

still minor problems, see vertical scroll bar and display of units
Units and channels types are annotated in butterfly plot.
@larsoner

Copy link
Copy Markdown
Member

It definitely will conflict with #4972 but I'm not coming back to that if I can avoid it, so I'm happy about this :)

Still working on this or no? If it's good to go, set the title to MRG and folks will look

@larsoner larsoner changed the title Seeg eeg seperated in butterfly plot epochs MRG: Seeg eeg seperated in butterfly plot epochs Apr 24, 2019
@jasmainak

Copy link
Copy Markdown
Member

@katarinaslama you might be interested in this

@larsoner

Copy link
Copy Markdown
Member

Running python -i tutorials/plot_visualize_epochs.py and pressing "b" on master I get:

Screen Shot 2019-04-24 at 18 05 44

On this PR:

Screen Shot 2019-04-24 at 18 07 50

Something is wrong with the color/naming, both in terms of order (eeg labels the mags) and appearance (eeg shown instead of EEG)

@larsoner larsoner changed the title MRG: Seeg eeg seperated in butterfly plot epochs WIP: Seeg eeg seperated in butterfly plot epochs Apr 24, 2019
@stfnrpplngr

Copy link
Copy Markdown
Contributor Author

Will look into that. I avoided to touch the meg channel related code. Looks like, there is a need for a general solution, handling any type ....

@codecov

codecov Bot commented Apr 24, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #6210 into master will decrease coverage by 1.7%.
The diff coverage is 93.1%.

@@            Coverage Diff             @@
##           master    #6210      +/-   ##
==========================================
- Coverage   89.07%   87.36%   -1.71%     
==========================================
  Files         413      415       +2     
  Lines       74540    74584      +44     
  Branches    12296    12291       -5     
==========================================
- Hits        66394    65164    -1230     
- Misses       5245     6568    +1323     
+ Partials     2901     2852      -49

@larsoner

Copy link
Copy Markdown
Member

Let me know when I should look again

@stfnrpplngr

Copy link
Copy Markdown
Contributor Author

Maybe, you could have a look. The scaling problem is still an issue.

@stfnrpplngr

Copy link
Copy Markdown
Contributor Author

Finally, everything should work as expected.

@larsoner larsoner changed the title WIP: Seeg eeg seperated in butterfly plot epochs MRG: Seeg eeg seperated in butterfly plot epochs Apr 26, 2019

@larsoner larsoner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than a few minor gripes, looks like a nice refactoring. It is almost there I think.

On master with this code:

import mne
raw = mne.io.read_raw_fif(mne.datasets.testing.data_path() +
                          '/MEG/sample/sample_audvis_trunc_raw.fif')
events = mne.find_events(raw)
epochs = mne.Epochs(raw, events)
epochs.plot(block=True)

I see:

Screen Shot 2019-04-26 at 10 08 07

And on this PR:

Screen Shot 2019-04-26 at 10 07 37

So there are some differences but I think it's okay / an improvement, except for the ylabels which were nicer before. There should be some ch_type -> nice-ch-type mapping that you can use to fix this, can you look?

Comment thread doc/whats_new.rst Resolved
Comment thread doc/whats_new.rst Resolved
Comment thread mne/viz/raw.py Resolved
Comment thread tutorials/plot_visualize_epochs.py Resolved
Comment thread tutorials/plot_visualize_epochs.py Resolved
Comment thread tutorials/plot_visualize_epochs.py Resolved
@agramfort

Copy link
Copy Markdown
Member

works like a charm !

@stfnrpplngr can you see why CIs complain?

really cool !

@stfnrpplngr

Copy link
Copy Markdown
Contributor Author

Solving the issue with the labels was really straightforward. Unfortunately, the labels are still not looking nice. But at least, they now fit into the window ;-)

Comment thread mne/viz/tests/test_epochs.py Resolved
Comment thread mne/viz/tests/test_epochs.py Resolved
@larsoner

Copy link
Copy Markdown
Member

@stfnrpplngr there are a lot of flake8 errors, can you run make flake or flake8 mne locally to see them and fix them?

@drammock drammock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 for merge once CIs are green. Thanks @stfnrpplngr

@larsoner larsoner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 for merge once the CIs are green

Comment thread mne/viz/ica.py Outdated
def _plot_sources_epochs(ica, epochs, picks, exclude, start, stop, show,
title, block):
"""Plot the components as epochs."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a docstyle error :)

But other than this everything passes style tests

@larsoner

Copy link
Copy Markdown
Member

Azure is happy and I've run make pep locally and all is good (after 1 line removal), thanks @stfnrpplngr

@larsoner
larsoner merged commit bc94beb into mne-tools:master Apr 26, 2019
@stfnrpplngr
stfnrpplngr deleted the seeg-eeg-seperated-in-butterfly-plot-epochs branch April 26, 2019 15:39
@drammock drammock mentioned this pull request Apr 26, 2019
jeythekey pushed a commit to jeythekey/mne-python that referenced this pull request Apr 27, 2019
* butterfly plots for different channels work

still minor problems, see vertical scroll bar and display of units

* annotating units

Units and channels types are annotated in butterfly plot.

* updated whats_new.rst and docstring

* viewing order corrected

* solved bug regarding picks

* ordered the types list

* Minors

* Minor

* introducing scalings_default

* Added a list with default plotting orders to pick.py

* Adding order argument to epochs.py

* order argument works now

* order added to docstring

* Everything works except scaling

* Cleaning up

* Probably a solution to the scaling problem

* Making it more explicit

* Minor

* scaling problem solved

Scaling problem is solved, can be merged

* worked on revision

* revisions resolved

* minor Minor

* PEP8 conform

* Solved the problem regarding test_ica.py

* STY: Newline
@larsoner

Copy link
Copy Markdown
Member

@stfnrpplngr any time to work on the scale bars PR now? If not, can you let me know what branch has your commits so I can take a look? It would be a cool feature to have in 0.18 if we can do it in the next couple of days

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.

5 participants