mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

ENH: Making EEG layout on the fly for plot_projs_topomap?

Open haribharadwaj opened this issue 12 years ago • 20 comments

Is this in anyway possible? i.e., is there a simple way to associate channel location info with the projs objects?

haribharadwaj avatar Nov 15 '14 06:11 haribharadwaj

info['projs'] is not aware of dig or cardinal points so plot_projs cannot guess layouts. But we should have a method of data containers in a mixin class to do inst.plot_projs()

wdyt?

On Sat, Nov 15, 2014 at 7:10 AM, Hari Bharadwaj [email protected] wrote:

Is this in anyway possible? i.e., is there a simple way to associate channel location info with the projs objects?

— Reply to this email directly or view it on GitHub https://github.com/mne-tools/mne-python/issues/1655.

agramfort avatar Nov 15 '14 08:11 agramfort

+1

teonbrooks avatar Nov 17 '14 15:11 teonbrooks

-0.0 I don't use projs, never. Would prefer a function.

dengemann avatar Nov 17 '14 15:11 dengemann

+1 on method :)

agramfort avatar Nov 18 '14 09:11 agramfort

Not sure I understand the benefit/issue with the distinction you are making between a function versus a mixin class method. There is a viz.plot_projs_topomap(.) that doesn't work for non-vectorview projectors... Are you suggesting we add a function to extract lout from evoked or epochs or raw and then pass to the viz.plot_projs_topomap(.)?

haribharadwaj avatar Nov 18 '14 15:11 haribharadwaj

Not sure I understand the benefit/issue with the distinction you are making between a function versus a mixin class method.

methods pollute the objects API and make them too smart.

There is a viz.plot_projs_topomap(.) that doesn't work for non-vectorview projectors... Are you suggesting we add a function to extract lout from evoked or epochs or raw and then pass to the viz.plot_projs_topomap(.)?

yes the .lout would be generated on the fly from the container instance.

agramfort avatar Nov 18 '14 15:11 agramfort

Ok.. In that case, the functionality already seems to exist... Close this issue?

haribharadwaj avatar Nov 28 '14 16:11 haribharadwaj

i don't think the method has been written yet for proj

teonbrooks avatar Nov 28 '14 17:11 teonbrooks

Hmm... @t3on: I was thinking two steps that the user does:

from mne.channels.layout import make_eeg_layout
lout = make_eeg_layout(container.info, ...)
from mne.viz.topomap import plot_projs_topomap
plot_projs_topomap(proj, layout=lout)

haribharadwaj avatar Nov 28 '14 17:11 haribharadwaj

yeah, those steps work. would you want a method to plot the proj of objects that have proj in the info? that would be advantage of a method. if not, that is sufficient.

teonbrooks avatar Nov 28 '14 19:11 teonbrooks

On 28 nov. 2014, at 20:51, Teon [email protected] wrote:

yeah, those steps work. would you want a method to plot the proj of objects that have proj in the info? that would be advantage of a method.

I would like that

— Reply to this email directly or view it on GitHub.

agramfort avatar Nov 28 '14 21:11 agramfort

I like the idea of a method too..

haribharadwaj avatar Nov 29 '14 01:11 haribharadwaj

we just need a PR then.

A clean way would be to have a ProjMixin class in proj.py that offers this feature to container class. In the spirit of PickDropChannelsMixin and ContainsMixin implemented in channels.py

any taker?

agramfort avatar Nov 29 '14 09:11 agramfort

I got it. I am actually working on adding a mixin to channels. I can bundle this in.

teonbrooks avatar Nov 29 '14 10:11 teonbrooks

We have a projs mixin, i'd add it there

On 29 Nov 2014, at 11:51, Teon [email protected] wrote:

I got it. I am actually working on adding a mixin to channels. I can bundle this in.

— Reply to this email directly or view it on GitHub.

dengemann avatar Nov 29 '14 11:11 dengemann

Great

agramfort avatar Nov 29 '14 11:11 agramfort

I mean I would suggest to add it there.

On 29 Nov 2014, at 12:54, Alexandre Gramfort [email protected] wrote:

Great — Reply to this email directly or view it on GitHub.

dengemann avatar Nov 29 '14 11:11 dengemann

+1

agramfort avatar Nov 29 '14 12:11 agramfort

yep yep, roger that. i am adding the get_electrode_position and set_electrode_position in the channel mixin, I just figured I would expand that pr for this method for the projs mixin.

teonbrooks avatar Nov 29 '14 12:11 teonbrooks

closing for https://github.com/mne-tools/mne-python/pull/1677.

teonbrooks avatar Dec 05 '14 14:12 teonbrooks