[Mne_analysis] Number of used triangles and vertices in source space

Eric Larson larson.eric.d at gmail.com
Thu Apr 9 14:20:11 EDT 2020
Search archives:

        External Email - Use Caution        

>
> >> I was told that for some good reasons, a part of these vertices can be
> deleted by some MNE-Python functions in order to make things working right.
> For example, if we consider the left hemisphere (i.e. src[0]), we can see
> that there are only 3732 used vertices with the ’nuse’ key. I looked
> through all the keys of src[0] and I found that ‘patch_inds’ seems to
> answer my question (at least it has a size of 3732), provided you rename
> the vertices of src[0][‘use_tris’] before (using, for example,
> numpy.searchsorted function).
>

Really you should look at `src[0]['vertno']` or
`np.where(src[0]['inuse'])[0]` (should be the same), which give the
vertices from the original mesh that are actually used.

To know which triangles these points correspond to, you can go back to the
original source space (before vertices are removed from the forward) and
look at src[0]['vertno'] there. From the difference, you can figure out
which ones have been dropped (~np.in1d(orig_src[0]['vertno'],
fwd['src'][0]['vertno'])), and then include whichever of the
`orig_src[0]['use_tris']` you want, e.g., those for which all vertices are
present in the forward source space, or those for which at least one vertex
is present in the source space, depending on your needs.

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200409/f9e95e9d/attachment.html 


More information about the Mne_analysis mailing list