-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Corrmap #1795
Add Corrmap #1795
Conversation
@jona-sassenhagen thanks heaps for sharing. Have you worked with this code on a few datasets? My logic is that if it's still early, it's better to iterate quickly on this code on your end and merge it after it proved useful on a few datasets. my 2c |
Here is another dataset, this time 4 participants with 64 channels. Good results, at least in the second case. It does not perform well in the first because the decompositions are not very good. I will run another test soon. |
thanks heaps for sharing.
|
@jona-sassenhagen this looks pretty cool! Let me know when you need some reviewing. |
Another demonstration: full study of 20 subjects. http://nbviewer.ipython.org/gist/jona-sassenhagen/ec915a7e9abda1e2828b @dengemann , can you indeed take a quick look at the code itself? No details for now, just tell me if it generally works with the way MNE is laid out. |
name="marked_ics", | ||
verbose_return=False, | ||
plot=True, | ||
inplace=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jona-sassenhagen no reason to use line breaks here
Also note that we use @verbose
decorater together with a verbose
keyword.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm deleting the verbose_return thing, it's dumb.
@jona-sassenhagen I would put it in ICA, not in bads. |
@jona-sassenhagen apart from my comments looks like a good start to me! |
Integrated criticism by dengeman
I would use the term labels as what you're doing is labeling components. So ica.labels also make sure you check pep8 compliance of your file. And it would be really great to have at least a smoke test. |
Especially if you repeatedly do the same analysis, run ICA with a fixed random state, and store the correct templates. |
Ok. Just wanted to make sure all we have here is needed. |
Travis:
Is this my fault? |
No, sometimes we get those failures |
Can I restart Travis somehow? It's all urlib errors. |
You have to have commit rights on the repo to restart, but I restarted it for you |
Thanks @Eric89GXL |
Again URLError: and TimeoutError: [Errno 110] Connection timed out ... |
Just ignore those for now -- if those are the only errors, is this otherwise ready for merge? We might end up having to merge some red PRs today because of connectivity issues, once we make sure that the only problems are connectivity errors. |
@jona-sassenhagen @Eric89GXL this PR induces 9% of coverage loss in ica.py ... |
Can we check somewhere what lines are not being tested? I'm at pretty sure corrmap isn't even 10% of the ica code On Sat, Apr 18, 2015 at 11:29 AM -0700, "Denis A. Engemann" notifications@github.com wrote: @jona-sassenhagen @Eric89GXL this PR induces 9% of coverage loss in ica.py ... — |
You can't trust the coveralls report because coveralls is only called when a build succeeds |
...so you have to check the changes locally. Can you take a look and compare master to your PR @jona-sassenhagen ? |
I checked locally Nostests --with-coverage
|
For some reason we had plot=False for all tests. Coverage is much better now. Basically the lines it's not covering right now are some of the exceptions raised by the various failure options. I'm considering adding the ability to deal with heterogenous IC objects, e.g. when ICA is called on bad channels. |
@dengemann like this? |
Would be very cool to have ICA interpolation ... I'm playing around with _interpolate_bads_eeg, but I'm too bad at lin alg to really make it work. |
@jona-sassenhagen closing in favor of #1985. |
Implementation of Corrmap; website, journal paper.
Corrmap is a procedure for semi-automatic selection of maps, especially for selecting common ICs for a number of subjects. The user inputs a list of fitted ICAs (such as for all of the subjects of a study) and denotes a template IC (such as a blink IC). The Corrmap algorithm then determines the best-fitting ICs for all ICAs and adds them to the ICAs in a specified field.
Here is a gist.
The routine should basically work and be somewhat robust. I'm open to any feedback.
This is not a translation of the original MATLAB program, but an attempt of recreating the behaviour as described in the journal paper.
Currently, the routine only takes ICs, but in the long term, it could be expanded to select any sets of matching topographies, such as for basic microstate analysis.
I'm not sure how a test could be built as the algorithm requires multiple IC decompositions.