Skip to content

Conversation

@jaeilepp
Copy link
Contributor

Proposed at #2251.
screenshot from 2015-07-15 16 43 08

@dengemann
Copy link
Member

looks clean to me! I see a bit of code reduplication. Maybe worth a small function. Other than that do you thinki we should add a test?

@agramfort
Copy link
Member

is this a MRG PR?

mne/viz/ica.py Outdated
Copy link
Member

Choose a reason for hiding this comment

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

use the defaults._handle_default

@jaeilepp jaeilepp changed the title EOG and ECG channels added to the bottom of ICA plot. [MRG] EOG and ECG channels added to the bottom of ICA plot. Jul 16, 2015
@jaeilepp
Copy link
Contributor Author

Ready for merge?

@agramfort
Copy link
Member

not yet... why is this not captured by tests?

In [2]: ica.plot_sources(epochs)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-99fbf26e752b> in <module>()
----> 1 ica.plot_sources(epochs)

/Users/alex/work/src/mne-python/mne/preprocessing/ica.py in plot_sources(self, inst, picks, exclude, start, stop, title, show, block)
   1389         return plot_ica_sources(self, inst=inst, picks=picks, exclude=exclude,
   1390                                 title=title, start=start, stop=stop, show=show,
-> 1391                                 block=block)
   1392
   1393     def plot_scores(self, scores, exclude=None, axhline=None,

/Users/alex/work/src/mne-python/mne/viz/ica.py in plot_ica_sources(ica, inst, picks, exclude, start, stop, show, title, block)
    116         fig = _plot_sources_epochs(ica, inst, picks, exclude, start=start,
    117                                    stop=stop, show=show, title=title,
--> 118                                    block=block)
    119     elif isinstance(inst, Evoked):
    120         sources = ica.get_sources(inst)

/Users/alex/work/src/mne-python/mne/viz/ica.py in _plot_sources_epochs(ica, epochs, picks, exclude, start, stop, show, title, block)
    693                                n_epochs=n_epochs, scalings=scalings,
    694                                title=title, picks=picks,
--> 695                                order=['misc', 'eog', 'ecg'])
    696     params['hsel_patch'].set_x(params['t_start'])
    697     callback_close = partial(_close_epochs_event, params=params)

/Users/alex/work/src/mne-python/mne/viz/epochs.py in _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings, title, picks, order)
    660     inds = np.concatenate(inds).astype(int)
    661     if not len(inds) == len(picks):
--> 662         raise RuntimeError('Some channels not classified. Please'
    663                            ' check your picks')
    664     ch_names = [params['info']['ch_names'][x] for x in inds]

RuntimeError: Some channels not classified. Please check your picks

@agramfort
Copy link
Member

works like a charm.

thanks @jaeilepp !

agramfort added a commit that referenced this pull request Jul 16, 2015
[MRG] EOG and ECG channels added to the bottom of ICA plot.
@agramfort agramfort merged commit 9168e9f into mne-tools:master Jul 16, 2015
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