Skip to content

Conversation

@hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Jan 22, 2021

Fixes #8772

@hoechenberger hoechenberger changed the title Make plot_evoked() not plot GFP for single channel BUG: Make plot_evoked() not plot GFP for single channel Jan 22, 2021
@hoechenberger hoechenberger changed the title BUG: Make plot_evoked() not plot GFP for single channel MRG, BUG: Make plot_evoked() not plot GFP for single channel Jan 22, 2021
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.

changes look reasonable. +1 for merge when CIs are happy

@hoechenberger hoechenberger changed the title MRG, BUG: Make plot_evoked() not plot GFP for single channel WIP, BUG: Make plot_evoked() not plot GFP for single channel Jan 23, 2021
@hoechenberger
Copy link
Member Author

Please do not merge yet, I figured there's actually a bug in how we calculate GFP.

@hoechenberger hoechenberger marked this pull request as draft January 23, 2021 08:03
hoechenberger added a commit to hoechenberger/mne-python that referenced this pull request Jan 23, 2021
The reason for mne-tools#8772 is simply that we always calculated the GFP
incorrectly, i.e. without re-referencing sensor signals to average
first. When doing that, I now correctly get a flat GFP (0 at all time
points) for single-channel recordings.

Closes mne-tools#8772, mne-tools#8774
@agramfort agramfort marked this pull request as ready for review January 23, 2021 11:25
@agramfort
Copy link
Member

agramfort commented Jan 23, 2021

@cbrnr merge if happy

@cbrnr cbrnr merged commit ae8a466 into mne-tools:master Jan 23, 2021
@cbrnr
Copy link
Contributor

cbrnr commented Jan 23, 2021

Thanks @hoechenberger!

@hoechenberger
Copy link
Member Author

Oh noes this wasn't supposed to be merged… can we revert?

@cbrnr
Copy link
Contributor

cbrnr commented Jan 23, 2021

Can you open a new PR to revert? Sorry about that, I thought you'd addressed the issue (the PR was not a draft and @agramfort said OK to merge).

@hoechenberger
Copy link
Member Author

Super weird,
Screen Shot 2021-01-23 at 12 58 39

Was this simply reset once @agramfort submitted his review?

hoechenberger added a commit to hoechenberger/mne-python that referenced this pull request Jan 23, 2021
@cbrnr
Copy link
Contributor

cbrnr commented Jan 23, 2021

Hmmm, must've been otherwise it wouldn't have let me merge... Very strange!

@agramfort
Copy link
Member

It's my fault.... Sorry and thanks for reverting.

hoechenberger added a commit to hoechenberger/mne-python that referenced this pull request Jan 23, 2021
The reason for mne-tools#8772 is simply that we always calculated the GFP
incorrectly, i.e. without re-referencing sensor signals to average
first. When doing that, I now correctly get a flat GFP (0 at all time
points) for single-channel recordings.

Closes mne-tools#8772, mne-tools#8774
larsoner added a commit that referenced this pull request Jan 27, 2021
* GFP was not derived from average-referenced signal as it must be

The reason for #8772 is simply that we always calculated the GFP
incorrectly, i.e. without re-referencing sensor signals to average
first. When doing that, I now correctly get a flat GFP (0 at all time
points) for single-channel recordings.

Closes #8772, #8774

* Add GFP to EEG tutorial [skip azp][skip github]

* Fix doc build [skip azp][skip github]

* style [skip azp][skip github]

* phrasing [skip github][skip azp]

* Small fixes [skip azp][skip github]

* Apply suggestions from code review [skip azp][skip github]

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* Fix [skip azp][skip github]

* Small fixes + adjust color [skip azp][skip github]

* Add gfp='power', gfp='power-only'

* Better docstring rendering

* use np.linalg.norm

Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>

* power -> rms

* GFP for EEG, RMS for MEG

* Touch Evoked tutorial

* Update changelog

* Fix tests

* FIX: Doc and test

* Frobenius norm -> RMS

Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
larsoner added a commit that referenced this pull request Jan 27, 2021
* GFP was not derived from average-referenced signal as it must be

The reason for #8772 is simply that we always calculated the GFP
incorrectly, i.e. without re-referencing sensor signals to average
first. When doing that, I now correctly get a flat GFP (0 at all time
points) for single-channel recordings.

Closes #8772, #8774

* Add GFP to EEG tutorial [skip azp][skip github]

* Fix doc build [skip azp][skip github]

* style [skip azp][skip github]

* phrasing [skip github][skip azp]

* Small fixes [skip azp][skip github]

* Apply suggestions from code review [skip azp][skip github]

Co-authored-by: Daniel McCloy <dan@mccloy.info>

* Fix [skip azp][skip github]

* Small fixes + adjust color [skip azp][skip github]

* Add gfp='power', gfp='power-only'

* Better docstring rendering

* use np.linalg.norm

Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>

* power -> rms

* GFP for EEG, RMS for MEG

* Touch Evoked tutorial

* Update changelog

* Fix tests

* FIX: Doc and test

* Frobenius norm -> RMS

Co-authored-by: Daniel McCloy <dan@mccloy.info>
Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
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.

plot_evoked(gfp=True) with single-channel data behaves incorrectly

4 participants