How to obtain MNI coords using mne.vertex_to_mni (newbie)

External Email - Use Caution

Thanks, Alex.

Since I don't know how to write python code (I work with Matlab), I want to
do my statistical analysis in Matlab. But first I need to have the data in
MNI coordinates. I need a piece of Python code that gives me the MNI
coordinates for the source locations for each subject. The only code I
could find is this, which calculates MNI coordinates of center of mass. How
to modify this to give me instead the stc locations?

# calculate center of mass and transform to mni coordinatesvtx, _,
t_lh = stc_lh.center_of_mass('sample')mni_lh = mne.vertex_to_mni
<https://martinos.org/mne/stable/generated/mne.vertex_to_mni.html#mne.vertex_to_mni>(vtx,
0, 'sample')[0]vtx, _, t_rh = stc_rh.center_of_mass('sample')mni_rh =
mne.vertex_to_mni
<https://martinos.org/mne/stable/generated/mne.vertex_to_mni.html#mne.vertex_to_mni>(vtx,
1, 'sample')[0]

Thanks again,
Adela

External Email - Use Caution

If you already have a STC, doing:

left_mni = mne.vertex_to_mni(stc.vertices[0], 0)
right_mni = mne.vertex_to_mni(stc.vertices[1], 1)

?
might do it.

Eric