[Mne_analysis] Plotting multiple individual's dipole locations on standard brain

Alexandre Gramfort alexandre.gramfort at telecom-paristech.fr
Mon Aug 15 05:04:55 EDT 2016
Search archives:

hi,

> dip_1[idx_1+1].pos = dip_2[idx_2].pos

does not copy indeed. This:

dip_1[idx_1+1].pos = dip_2[idx_2].pos.copy()

will copy.

now what you need is a way to "morph" dipoles from each subjects to
fsaverage or MNI space. AFAIK there is no such function in mne-python yet
although you can find some hints:

http://martinos.org/mne/stable/generated/mne.vertex_to_mni.html#mne.vertex_to_mni

please open an issue on github:

https://github.com/mne-tools/mne-python/issues

so we can follow up on this.

Best,
Alex

On Sun, Aug 14, 2016 at 4:46 AM, Talitha Ford <tcford at swin.edu.au> wrote:
> Hello,
>
> I was wondering whether anyone has used Dipole.plot_locations to plot the maximal dipole for a each subject/participant on the same brain structure (a standardised T1, for example)? I am interested in relative dipole location and strengths between two groups, for each hemisphere. So ideally would like to plot each participants left and right auditory dipole, on the same brain, with the groups differentiated by colour (e.g. blue for group1 and red for group2).
>
> I have tried copying the pos of each individuals maximal dipole into sequential indices of the 1st individual Dipole object, however the pos won’t copy in.
>
>
>  evoked = mne.read_evokeds(fname_ave, baseline=(None, 0))[0]
> # crop at individual maximum peak latency and 1ms later
> evoked.crop(.15, .20 )
>
> # this plots each individual on a separate brain for the max dipole across the cortex
> for pid in [‘1’,’2’,’3’]:
>         # Fit a dipole
>         dip = mne.fit_dipole(evoked, fname_cov, fname_bem, fname_trans)[0]
>
>         m = dip.amplitude.max()
>         t = np.where(dip.amplitude == m)
>         idx = t[0][0]
>         dip[idx:idx+1].plot_locations(fname_trans, 'app'+pid, subjects_dir)
>
>
> # I tried something like this, to hack the position of the second participant into the index+1 of the max for participant 1 (if that makes sense)
> evoked_1 = mne.read_evokeds(fname_1, baseline=(None, 0))[0]
> dip_1 = mne.fit_dipole(evoked_1, fname_cov, fname_bem, fname_trans)[0]
> m = dip_1.amplitude.max()
> t = np.where(dip_1.amplitude == m)
> idx_1 = t[0][0]
>
> evoked_2 = mne.read_evokeds(fname_2, baseline=(None, 0))[0]
> dip_2 = mne.fit_dipole(evoked_2, fname_cov, fname_bem, fname_trans)[0]
> m = dip_2.amplitude.max()
> t = np.where(dip_2.amplitude == m)
> idx_2 = t[0][0]
>
> dip_1[idx_1+1].pos = dip_2[idx_2].pos # this doesnt copy
>
> I tried several variations of copy
> dip_1[idx_1+1][:].pos = dip_2[idx_2][:].pos
> dip_1[idx_1+1][:].pos[:] = dip_2[idx_2][:].pos[:]
> dip_1[idx_1+1][:].pos = copy(dip_2[idx_2][:].pos)
> etc.
>
> Any help would be greatly appreciated.
>
> Cheers,
> Talitha
>
>
>
> _______________________________________________
> 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.



More information about the Mne_analysis mailing list