Skip to content

Conversation

@jshanna100
Copy link

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:

  1. Single ICA fit on data and reference channels together.
  2. For each component, norm the weights in the reference channels.
  3. These weight norms will have an exponential distribution, so apply log-transform to make normal.
  4. Log-norm-weights can then be submitted to the iterated outlier detection already implemented in MNE.
  5. Components with a z-score beyond threshold may be eliminated.

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.

High pass frequency.
method : {'together', 'separate'}
Method to use to identify reference channel related components.
Defaults to "separate." See notes.
Copy link
Member

Choose a reason for hiding this comment

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

separate. -> separate

(no .)

@agramfort
Copy link
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?

@jshanna100
Copy link
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.

@agramfort
Copy link
Member

agramfort commented Feb 19, 2019 via email

@jshanna100
Copy link
Author

Perhaps; not my decision. In any case, the bug ought to be fixed.

@agramfort
Copy link
Member

agramfort commented Feb 19, 2019 via email

@jshanna100
Copy link
Author

See last line of initial comment. Bug left over from #5807

@agramfort
Copy link
Member

ok then can we jsut have a bug fix PR here and see for the rest later after more validation? thanks

@codecov
Copy link

codecov bot commented Feb 20, 2019

Codecov Report

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

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

@jshanna100 jshanna100 closed this Feb 20, 2019
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.

3 participants