Skip to content
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

Closed
wants to merge 65 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1912bc9
Add Corrmap
jona-sassenhagen Feb 11, 2015
e9d0e23
Fix summing of polarity inverted maps plot option
jona-sassenhagen Feb 13, 2015
73f51db
Update bads.py
jona-sassenhagen Feb 19, 2015
4f0019b
Update bads.py
jona-sassenhagen Feb 20, 2015
9b66382
fix pep8, move from bads to ica
jona-sassenhagen Feb 20, 2015
a545bf9
corrmap test
jona-sassenhagen Feb 20, 2015
5ccb793
Update ica.py
jona-sassenhagen Feb 21, 2015
5e0342b
Update ica.py
jona-sassenhagen Feb 21, 2015
c4cf10c
pep8
jona-sassenhagen Feb 21, 2015
cedd88f
pep8
jona-sassenhagen Feb 21, 2015
b3a91f4
pep8
jona-sassenhagen Feb 21, 2015
d334dd5
Add new plot function
jona-sassenhagen Feb 22, 2015
e37b270
cleanup
jona-sassenhagen Feb 22, 2015
f86baff
remove unused local variable
jona-sassenhagen Feb 22, 2015
28385cc
Update ica.py
jona-sassenhagen Feb 22, 2015
2cb1cef
Fix find_outlier detection method in corrmap
jona-sassenhagen Feb 22, 2015
7a7a136
pep8
jona-sassenhagen Feb 22, 2015
71d9c51
Add test for second corrmap detection method
jona-sassenhagen Feb 22, 2015
da0c2f5
Update test_ica.py
jona-sassenhagen Feb 22, 2015
e43dc25
Fix find_outlier empty result
jona-sassenhagen Feb 22, 2015
4abd7fa
Update test_ica.py
jona-sassenhagen Feb 22, 2015
a381423
Fix catching find_outliers failure
jona-sassenhagen Feb 22, 2015
d0f5902
handle empty list on 2nd iteration
jona-sassenhagen Feb 22, 2015
504c983
Speed up test
jona-sassenhagen Feb 25, 2015
191c167
Fix printing zero result
jona-sassenhagen Mar 3, 2015
aae9f66
Smaller plot
jona-sassenhagen Mar 3, 2015
fbf89bd
pep8
jona-sassenhagen Mar 3, 2015
4fe301a
more pep8
jona-sassenhagen Mar 3, 2015
ea800e1
fix bug when plotting > 20 maps
jona-sassenhagen Mar 4, 2015
9b93666
redo accidentally removed line
jona-sassenhagen Mar 8, 2015
daf2f17
Address comments, simplify return
jona-sassenhagen Mar 8, 2015
8de11d5
Use fast_dot
jona-sassenhagen Mar 8, 2015
52137a7
Fix merge conflict
jona-sassenhagen Mar 9, 2015
a1e9319
Denis' vector corr (will do test later)
jona-sassenhagen Mar 9, 2015
47cfdb7
remove 1 "try", change vector corr
jona-sassenhagen Mar 9, 2015
0c2e6d6
fix fast_dot
jona-sassenhagen Mar 9, 2015
ca57023
pep8
jona-sassenhagen Mar 9, 2015
5d1ac0e
fixpy2.6
jona-sassenhagen Mar 9, 2015
b7ff4a2
fix doc
jona-sassenhagen Mar 9, 2015
9ab4384
pep8
jona-sassenhagen Mar 9, 2015
5c02bfb
Add test for utils.compute_corr
jona-sassenhagen Mar 10, 2015
26c6303
typo
jona-sassenhagen Mar 10, 2015
0f65fe0
change "name" keyword to "label"
jona-sassenhagen Mar 12, 2015
5dc3fef
Merge branch 'master' into patch-3
jona-sassenhagen Mar 21, 2015
de27bfa
fix merge conflict
jona-sassenhagen Mar 21, 2015
5b9ec57
pep8
jona-sassenhagen Mar 21, 2015
210fe00
fix merge conflict again?
jona-sassenhagen Mar 21, 2015
224189a
still resolving merge conflict ...
jona-sassenhagen Mar 22, 2015
4781246
pep8
jona-sassenhagen Mar 22, 2015
d66bb6b
properly zscore maps
jona-sassenhagen Mar 22, 2015
c63c16c
corrmap example
jona-sassenhagen Apr 11, 2015
2f82e21
of course, pep8.
jona-sassenhagen Apr 11, 2015
f352927
some cleanup + bug fixes
dengemann Apr 11, 2015
5f91e19
doc + pep8 + revert logger
dengemann Apr 11, 2015
3656f62
Merge pull request #1 from dengemann/patch-3
jona-sassenhagen Apr 13, 2015
3f02722
simplify returns
jona-sassenhagen Apr 18, 2015
8cdd181
remove now unused variable new_icas
jona-sassenhagen Apr 18, 2015
26be7f3
label figs
jona-sassenhagen Apr 18, 2015
664951c
fix return
jona-sassenhagen Apr 18, 2015
b949ab8
i guess this counts as pep8?
jona-sassenhagen Apr 18, 2015
57bc753
turn corrmap plot test on again
jona-sassenhagen Apr 19, 2015
877a4db
redo testing threshold 'auto
jona-sassenhagen Apr 19, 2015
54c9a4b
set plotter to test mode for test_ica
jona-sassenhagen Apr 19, 2015
0f500db
Update whats_new.rst
jona-sassenhagen Apr 19, 2015
3076bd1
undo whats new
jona-sassenhagen Apr 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
jona-sassenhagen committed Feb 22, 2015
commit e37b2702c24322c8ec1f2c764f8ed62dae3d7ade
9 changes: 4 additions & 5 deletions mne/preprocessing/ica.py
Original file line number Diff line number Diff line change
@@ -2083,7 +2083,7 @@ def _band_pass_filter(ica, sources, target, l_freq, h_freq, verbose=None):

@verbose
def corrmap(icas, template, threshold="auto", name="bads",
plot=True, inplace=False, ch_type="eeg"):
plot=True, inplace=False, ch_type="eeg"):

Copy link
Member

Choose a reason for hiding this comment

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

empty line not needed

"""Corrmap (Viola et al. 2009 Clin Neurophysiol) identifies the best group
match to a supplied template. Typically, feed it a list of fitted ICAs and
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, put a summary here that fits in the first line, mov detaile description 1 line down and add a blank line in between

@@ -2189,10 +2189,9 @@ def _plot_corrmap(data, subjs, indices, ch_type, name):
from mne.viz.utils import (_prepare_trellis, tight_layout,
_setup_vmin_vmax)
from mne.viz.topomap import (_prepare_topo_plot, _check_outlines,
_make_image_mask, plot_topomap)
plot_topomap)

Copy link
Member

Choose a reason for hiding this comment

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

why nested imports? do we have circular import issue here?

if so, you should do relative imports using ..

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid import make_axes_locatable

title = 'Detected components of type ' + name
picks = list(range(len(data)))
@@ -2245,10 +2244,10 @@ def _plot_corrmap(data, subjs, indices, ch_type, name):
target = all_maps[template[0]][template[1]]

if plot is True:
t = 'Template IC (Subj. ' + str(template[1]) + ')'
ttl = 'Template IC (Subj. ' + str(template[1]) + ')'
Copy link
Member

Choose a reason for hiding this comment

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

... string formatting

icas[template[0]].plot_components(picks=template[1],
ch_type=ch_type,
title=t)
title=ttl)
Copy link
Member

Choose a reason for hiding this comment

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

this one too


# first run: use user-selected map
if isinstance(threshold, (int, float)):