Skip to content

Conversation

@drammock
Copy link
Member

splits "artifact rejection" tutorial into separate tuts for bad channels and bad temporal spans. Also fixes messed up URLs in the preprocessing overview tutorial.

@GuillaumeFavelier
Copy link
Contributor

Thanks for reporting. I encountered the same in my recent work on #6551. I will port the fix on master.

@codecov
Copy link

codecov bot commented Jul 16, 2019

Codecov Report

Merging #6575 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #6575      +/-   ##
==========================================
- Coverage   89.45%   89.41%   -0.05%     
==========================================
  Files         416      416              
  Lines       74923    74934      +11     
  Branches    12323    12324       +1     
==========================================
- Hits        67025    66999      -26     
- Misses       5081     5104      +23     
- Partials     2817     2831      +14

@larsoner
Copy link
Member

Instead of adding /annotation-controls-default.png, could we instead modify the tutorial to show the epochs or raw plotter, then send a mpl event like:

# Let's show the annotation window, which you can do by pressing "a" on your keyboard.

fig = epochs.plot(...)
fig.canvas.key_press_event('a')

Sphinx-gallery should create an image from it for us automatically so we don't need to update it ourselves any time a new annotation option is added.

@larsoner
Copy link
Member

@jasmainak can you look?

@drammock
Copy link
Member Author

@larsoner here's how that looks: you lose the window frame, which IMO is a little confusing / weird looking:

Screenshot_2019-07-16_10-26-21

I also tried it on an earlier tutorial that also had an annotations window screenshot:

Screenshot_2019-07-16_10-28-02

Still want me to go ahead with it? Maybe if we made the figure background of the annotation control window non-white it would be OK?

# sphinx_gallery_thumbnail_number = 2
for pattern in (r'MEG 24..', r'EEG 05.'):
picks = mne.pick_channels_regexp(raw.ch_names, regexp=pattern)
raw.plot(order=picks, n_channels=len(picks))
Copy link
Member

Choose a reason for hiding this comment

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

This is awesome ninja weaponry. But I am affraid this may be intimidating to coding novices. Can we just get the channels from the info['bads'] list?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's a useful feature that doesn't get introduced anywhere else, so I opted to give an expanded explanation of the regex rather than switch it to something simpler.

# picking up a lot *more* than its neighbors — its signal is at least an order
# of magnitude greater than the other MEG channels. Regardless of what is
# causing the problems, neither are realistic reflections of the
# electrophysiological signals we expect, so it makes sense to exclude them.
Copy link
Member

Choose a reason for hiding this comment

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

Seems something is missing or unexpected here.

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure what you mean, see if it's better now?

@dengemann
Copy link
Member

@drammock awesome work! This will be very useful for teaching. Let me know if my comments are not clear or you want to discuss.

Copy link
Member

@jasmainak jasmainak 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 @drammock

My comments are mostly nitpicky. Otherwise it reads just fine.

# noise covariance across sensors. Noisy channels can also interfere with
# :term:`SSP <projector>` computations, because the projectors will be
# spatially biased in the direction of the noisy channel, which can cause
# adjacent good channels to be suppressed. ICA is corrupted by noisy channels
Copy link
Member

Choose a reason for hiding this comment

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

hmm ... why would this be? I know it's what I heard from @dengemann but ICA doesn't maximize variance but statistical independence. So why should it be affected?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't fully understand it myself; it seems to mostly be an issue when the noisy channel is a couple orders of magnitude above the other signals.

@drammock drammock changed the title DOC: bad channels / bad spans tutorials MRG, DOC: bad channels / bad spans tutorials Jul 17, 2019
@drammock
Copy link
Member Author

Comments addressed and CIs green. Here are the updated renderings:

@larsoner @agramfort @dengemann unless one of you wants to weigh in on Mainak's question about bad channels' effect on ICA (and also you think it's important to add that info in the tutorial), then this is ready for merge.

@drammock
Copy link
Member Author

oops, just noticed a missing deepcopy problem. Stand by for fix.

@drammock
Copy link
Member Author

codecov failure appears to be spurious / unrelated; ready for merge (modulo the ICA question above)

@agramfort
Copy link
Member

@dengemann or @jasmainak feel free to merge if happy

thanks heaps @drammock

@jasmainak jasmainak merged commit 0499708 into mne-tools:master Jul 18, 2019
@jasmainak
Copy link
Member

Awesome ! Thanks a lot @drammock :)

@drammock drammock deleted the tut-bad-data branch July 18, 2019 18:34
alexrockhill pushed a commit to alexrockhill/mne-python that referenced this pull request Oct 1, 2019
* add bad channels / interpolation tutorial

* add crossrefs

* flesh out bad channels / bad spans tutorials

* add crossref targets

* remove cruft

* fix url targets

* better crossref name

* add forgotten screenshot

* fix flake

* replace screenshot with spoofed keypress

* address denis's comments

* address mainak's comments

* fix missing deepcopy
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.

6 participants