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

Talitha Ford tcford at swin.edu.au
Sat Aug 13 22:46:34 EDT 2016
Search archives:

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





More information about the Mne_analysis mailing list