Plotting multiple individual's dipole locations on standard brain

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

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:

so we can follow up on this.

Best,
Alex

Thank you Alex,

Unfortunately, dip_1[idx_1+1].pos = dip_2[idx_2].pos.copy() did not copy (I had tried a number of variations using the .copy() function before emailing).

I have opened an issue in git.

Is there a way to get the vertex of the dipole coordinates from dip.pos? So that I can use the mne.vertex_to_mni function?

Cheers,
Talitha

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:

so we can follow up on this.

Best,
Alex

Hi again,

Is it possible to specify a ROI for dipole fitting? Or a range of coordinates? I?m particularly interested in auditory cortices, but selecting gravimeters over the cortex sometimes results in the max dipole located well away from this region.

I have looked at mne.DipoleFixed, but this function is not suitable as I also want to see the difference in dipole locations within the ROI for different groups of subjects.

Talitha

Thank you Alex,

Unfortunately, dip_1[idx_1+1].pos = dip_2[idx_2].pos.copy() did not copy (I had tried a number of variations using the .copy() function before emailing).

I have opened an issue in git.

Is there a way to get the vertex of the dipole coordinates from dip.pos? So that I can use the mne.vertex_to_mni function?

Cheers,
Talitha

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:

so we can follow up on this.

Best,
Alex

There is currently no way to constrain the location of estimates other than
ensuring they are inside the inner skull surface, which is done
automatically.

Eric

Hi,

Is there a way to get the vertex of the dipole coordinates from dip.pos? So that I can use the mne.vertex_to_mni function?

sadly no. I created an issue on github:

Alex

Hi Talitha,

If you are willing to change methods from dipole fits to mixed-norm
estimates, you could use this, particularly the irMxNE option:
http://martinos.org/mne/stable/auto_examples/inverse/plot_mixed_norm_inverse.html
.

If that's OK, then it's not too hard from there to go to the fsaverage
brain and plot dipole locations (or dipole density, depending on smoothing
parameters), like in panel B of Figures 3-5 here:
http://advances.sciencemag.org/content/1/10/e1500677.figures-only
Note that this step would require the individual MRIs to have been
processed by the entire Freesurfer
autorecon
stream.

It would also allow you to (artificially) constrain the source space to the
superior temporal plane if you're confident that any other activity is
negligible. I achieved this by using each individual's dSPM solution as
weights to the MxNE after zeroing the activity in all non-STP vertices.
This can be empirically justified by the dSPM itself, if it shows only STP
source activity and the usual cross-sulcal mirrors, for example (see Fig.
2A of the same paper referenced above).

Finally, it wouldn't be too hard to color code dipole locations (or
density) for two different groups. If this sounds like it could work, let
me know and I can share some of the code I have privately.

Cheers,
Andy