Improved ICA based noise removal for reference channels#5959
Closed
jshanna100 wants to merge 13 commits intomne-tools:masterfrom
jshanna100:master
Closed
Improved ICA based noise removal for reference channels#5959jshanna100 wants to merge 13 commits intomne-tools:masterfrom jshanna100:master
jshanna100 wants to merge 13 commits intomne-tools:masterfrom
jshanna100:master
Conversation
…partially visualising these components
new function find_bads_ref identifies bad components that correlate with reference channel derived components
agramfort
reviewed
Feb 19, 2019
mne/preprocessing/ica.py
Outdated
| High pass frequency. | ||
| method : {'together', 'separate'} | ||
| Method to use to identify reference channel related components. | ||
| Defaults to "separate." See notes. |
Member
|
could we have some improvement to the documentation at the same time? with how many subject did you evaluate this? Is this approach published? |
Author
|
Yes, I'll work on the docs a bit. I've now looked at over 20 recordings with it. Not published, but I do think I'll try to make short article out of it. |
Member
|
it this not a bit premature to push this first in MNE?
|
Author
|
Perhaps; not my decision. In any case, the bug ought to be fixed. |
Member
|
sorry I missed something. What is the bug fix here? sorry If I did not look
close enough.
… |
Author
|
See last line of initial comment. Bug left over from #5807 |
Member
|
ok then can we jsut have a bug fix PR here and see for the rest later after more validation? thanks |
Codecov Report
@@ Coverage Diff @@
## master #5959 +/- ##
===========================================
- Coverage 88.79% 51.41% -37.39%
===========================================
Files 401 401
Lines 72721 72720 -1
Branches 12158 12158
===========================================
- Hits 64575 37387 -27188
- Misses 5218 33214 +27996
+ Partials 2928 2119 -809 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuing #5807, which enabled the use of ICA components derived from MEG reference channels to be used as a ground truth for selecting MEG data channel based ICA components for removal.
@larsoner had suggested in #5807 to instead do one ICA on both reference and data channels, and select those components whose weights lay most heavily on the reference channels. I decided against this simply to avoid having to write an algorithm for deciding what is heavy and what's not. However, after having applied both approaches to a larger set of data, it seems clear to me that this approach is markedly superior, and worth the effort. An additional advantage is that it is simpler for the user to implement. The procedure goes as follows:
mne.preprocessing.bads.find_outliers had to be modified such that it has the option to select outliers from only one tail of the z distribution. Otherwise components could conceivably be eliminated for being especially light on the reference channels, which is very much undesired.
This also fixes a bug in #5807, where ICA.labels_ got reset at every new application of a find_bads procedure. Now they accumulate across multiple applications, as they should.