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

VERRIER Clement clement.VERRIER at univ-amu.fr
Fri Apr 10 15:51:39 EDT 2020
Search archives:

        External Email - Use Caution        

Hello Eric,

Thank you for your help. It seems there are some extra vertices in the final mesh information, but I found a way to solve this in the context of my problem.

Thank you again,

Clément

Le 9 avr. 2020 à 20:20, Eric Larson <larson.eric.d at gmail.com<mailto:larson.eric.d at gmail.com>> a écrit :


        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

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu<mailto:Mne_analysis at nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200410/4a612fb5/attachment.html 


More information about the Mne_analysis mailing list