problem with plotting the positions of a selection of magnetometers

Dear list,
I'm having problems with plotting the positions of a selection of left
magnetometers. In the following I describe what I'm doing in steps to make
it easier to follow up with me (my apologies in advance if you find it too
long):

1. I selected the: 'Left-temporal', 'Left-parietal' and 'Left-frontal'
magnetometers:

*evoked = mne.read_evokeds()*

*left_chs= mne.read_selection(name= ['Left-temporal', 'Left-parietal',
                                    'Left-frontal'], info= evoked.info
<http://evoked.info>)my_evo= evoked.pick_types(meg='mag', selection=
left_chs)*

2. Then I tried to get the layout of only selected magnetometers using:

*pos = mne.channels.find_layout(my_evo.info <http://my_evo.info>)*

but this returned the layout of all 102 magnetometers although the
documentations says it chooses a layout based on the channels in the info
?chs? field!

To overcome this issue I had to use this:

*pos = mne.channels.find_layout(my_evo.info <http://my_evo.info>, exclude=
excluded_chs)*

where excluded_chs contains all magnetometers which are not in my selected
list *(left_chs)*
This worked and I checked the names of channels in *pos.names.*

3. when I tried to plot the positions of the selected sensors using:

*pos.plot() * and *mne.viz.plot_layout(pos) *

the plots showed the positions of the sensors spanning the whole head
scheme (please see attached figure_1).

4. I had the same problem also when plotting the topography of my own
defined evoked object *my_evo *(attached as figure_2):

*my_evo.plot_topomap()*
I would appreciate any suggestion to solve this problem.

Best regards
Rasha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180403/91c294de/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Figure_1.png
Type: image/png
Size: 25986 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180403/91c294de/attachment-0002.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Figure_2.png
Type: image/png
Size: 130999 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180403/91c294de/attachment-0003.png

hi Rasha,

just to be sure I understand what you want to do. You want to see the
channels
present in a selection like we show in red bad channels in
evoked.plot_sensors()
or do you want to plot a topography restricted to a selection?

ALex

Hi Alexander,

what I mainly want to do is potting the results of permutations on these
selected magnetometers similar to the example here:

https://mne-tools.github.io/dev/auto_tutorials/plot_stats_spatio_temporal_cluster_sensors.html#sphx-glr-auto-tutorials-plot-stats-spatio-temporal-cluster-sensors-py

when I plotted the results I've got the attached figure, which shows the
positions of significant sensors in the right hemisphere despite the fact
that I'm selecting only left magnetometers. After I checked that my
selected channels are correct I thought the problem was in the plotting
part:

*image, _ = plot_topomap(f_map, positions, *
* mask=mask, *
* axes=ax_topo,*
* cmap='Reds', vmin=np.min,
vmax=np.max)*

where:
*pos = mne.channels.find_layout(my_evo.info <http://my_evo.info>, exclude=
excluded_chs)*
*positions= pos.pos*

and when I tried to plot the layout of sensors (*pos.plot()*) I had the
problem.

Hope I made it clear enough,

Thank you and regards
Rasha

hi Rasha,

just to be sure I understand what you want to do. You want to see the
channels
present in a selection like we show in red bad channels in
evoked.plot_sensors()
or do you want to plot a topography restricted to a selection?

ALex

Dear list,
I'm having problems with plotting the positions of a selection of left
magnetometers. In the following I describe what I'm doing in steps to make
it easier to follow up with me (my apologies in advance if you find it too
long):

1. I selected the: 'Left-temporal', 'Left-parietal' and 'Left-frontal'
magnetometers:

*evoked = mne.read_evokeds()*

*left_chs= mne.read_selection(name= ['Left-temporal', 'Left-parietal',
                                    'Left-frontal'], info= evoked.info
<http://evoked.info>)my_evo= evoked.pick_types(meg='mag', selection=
left_chs)*

2. Then I tried to get the layout of only selected magnetometers using:

*pos = mne.channels.find_layout(my_evo.info <http://my_evo.info>)*

but this returned the layout of all 102 magnetometers although the
documentations says it chooses a layout based on the channels in the
info ?chs? field!

To overcome this issue I had to use this:

*pos = mne.channels.find_layout(my_evo.info <http://my_evo.info>,
exclude= excluded_chs)*

where excluded_chs contains all magnetometers which are not in my
selected list *(left_chs)*
This worked and I checked the names of channels in *pos.names.*

3. when I tried to plot the positions of the selected sensors using:

*pos.plot() * and *mne.viz.plot_layout(pos) *

the plots showed the positions of the sensors spanning the whole head
scheme (please see attached figure_1).

4. I had the same problem also when plotting the topography of my own
defined evoked object *my_evo *(attached as figure_2):

*my_evo.plot_topomap()*
I would appreciate any suggestion to solve this problem.

Best regards
Rasha

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180403/59a55034/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Figure.png
Type: image/png
Size: 96524 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180403/59a55034/attachment-0001.png

I guess this https://github.com/mne-tools/mne-python/pull/5085
can help.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180404/223e8b1d/attachment.html

Many thanks Alex. When I added the head_pos to* plot_topomap* arguments
I've got attached figure_1 using:

*image, _ = plot_topomap(f_map, positions, mask=mask,*
* head_pos=dict(center=(0., 0.), scale=(1.,
1.)),*
* axes=ax_topo,*
* cmap='Reds', vmin=np.min, vmax=np.max)*

however, when I used the info object instead of the positions returned from
*mne.channels.find_layout*, I've got correct positions of the sensors but
the topography map had all the same color even after using many values of
vmin & vmax (attached figure_2):

*image, _ = plot_topomap(f_map, my_evo.info <http://my_evo.info>,
mask=mask,*
* head_pos=dict(center=(0., 0.), scale=(1.,
1.)),*
* axes=ax_topo,*
* cmap='Reds', vmin=np.min, vmax=np.max)*

Any idea why I had this problem with the coloring of topography map? and
should I be worried that the positions returned from
*mne.channels.find_layout * are incorrect?

Rasha

I guess this https://github.com/mne-tools/mne-python/pull/5085
can help.

Alex

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180404/c22dad86/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: figure_1.png
Type: image/png
Size: 86727 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180404/c22dad86/attachment-0002.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: figure_2.png
Type: image/png
Size: 86633 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180404/c22dad86/attachment-0003.png

please open an issue or comment on the PR I pointed you to.

I don't think it's a bug but just a surprising behavior of the function you
are using.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180404/da42a1ab/attachment.html

Thank you Alex, I've commented on the same PR you pointed to.

All the best
Rasha