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

Adela Glez. adelaglezcom at gmail.com
Thu May 10 04:05:15 EDT 2018
Search archives:

        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

On 10 May 2018 at 08:37, <mne_analysis-request at nmr.mgh.harvard.edu> wrote:

>
>    1. Re: How to obtain MNI coords using mne.vertex_to_mni      (newbie)
>       (Alexandre Gramfort)

 ----------
> From: Alexandre Gramfort <alexandre.gramfort at inria.fr>
> Subject: Re: [Mne_analysis] How to obtain MNI coords using
>         mne.vertex_to_mni       (newbie)
> To: Discussion and support forum for the users of MNE Software
>         <mne_analysis at nmr.mgh.harvard.edu>
> Message-ID:
>         <CADeotZr4Z0oa7QWVitPPGRCzaKBe-ju7ngOckTUSL=N0fOqxhw at mail.
> gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
>         External Email - Use Caution
>
> hi,
>
> what do you mean your MEG data?
>
> vertices here are SourceEstimate (aka stc) vertices.
>
>
> HTH
> Alex
>
>
> On Thu, May 10, 2018 at 2:14 AM, Adela Glez. <adelaglezcom at gmail.com>
> wrote:
>
> >         External Email - Use Caution
> >
> > Hi,
> >
> > In order to obtain the MNI coordinates of my MEG data, I have to use
> mne.vertex_to_mni.
> > Could someone give me an example of its usage?
> >
> > As for the first argument, how to obtain the vertex numbers of my data?
> > I'm new in Python. Then, second argument, I can't find what code is right
> > or left hemisphere. Is there a way to get in one output both hemispheres
> > (=the whole brain)?
> >
> > Thank you,
> > Adela
> >
> > This is the help of the function:
> >
> > mne.vertex_to_mni(*vertices*, *hemis*, *subject*, *subjects_dir=None*,
> > *mode=None*, *verbose=None*)
> > [source]
> > <http://github.com/mne-tools/mne-python/blob/master/doc/%
> 3Cstring%3E#L1129-L1187>
> > <https://martinos.org/mne/dev/generated/mne.vertex_to_mni.
> html#mne.vertex_to_mni>
> >
> > Convert the array of vertices for a hemisphere to MNI coordinates.
> > Parameters: *vertices* : int, or list of int
> >
> > Vertex number(s) to convert
> > *hemis* : int, or list of int
> >
> > Hemisphere(s) the vertices belong to
> > *subject* : string
> >
> > Name of the subject to load surfaces from.
> > *subjects_dir* : string, or None
> >
> > Path to SUBJECTS_DIR if it is not set in the environment.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180510/d2f10b89/attachment.html 


More information about the Mne_analysis mailing list