[Mne_analysis] Finding nearest neighbors with 'use_tris'?

Gladia Hotan gladiach at gmail.com
Wed May 12 00:11:44 EDT 2021
Search archives:

        External Email - Use Caution        

Hi Eric,

Thanks for your help! This function seems to add distances between sources
in the same hemisphere. Is there a way to get the distances between sources
in different hemispheres?

Best,
Gladia

On Fri, Apr 23, 2021 at 10:32 PM Eric Larson <larson.eric.d at gmail.com>
wrote:

>         External Email - Use Caution
>
> Also, I'm using MNE 0.20.7. The function 'spatial_tris_connectivity' seems
>> to be gone in the latest
>>
>> stable MNE (0.22.1). Is there an updated way of getting the nearest neighbors matrix?
>>
>> When versions change functions can be deprecated and renamed. For this
> you'd want to look at the release notes, in this case for both 0.21 and
> 0.22, to see if something changed, in this case this:
>
> *MailScanner has detected a possible fraud attempt from
> "secure-web.cisco.com" claiming to be*
> https://secure-web.cisco.com/1oMA_T4WoHYNa3AwNmVc__52wm1UYifJ88oFWO2iv9h7SDNAEwdZFljq7qm90l5_uAsTYuCfF-Cq1_1fhvktabYg9CROQAa0QkcAd8TTfBa85VCOXy3n7fkDzNoH6S0o95Qm3vh8Ko6i2J28UBi1x2fOgDJO823ODfuGBHfTH5vA9pdpKEGQ-yIHx9_5iRxtgQZRwrCNpESH-rxzZ1Rbozk57pcsLPKLJPBvn90RyVUTuyFdEcI3IpLwck9lD0Q8jwl2JsjruDbnDr8TMc5-HvA/https%3A%2F%2Fmne.tools%2Fdev%2Fwhats_new.html%23id6
> <https://secure-web.cisco.com/1Edhzwz42XchQKf_0yIyY2MkV6nIV_igPALHq6GIBc0mh138b-w9G2oKnyxQt571p2TEGVTs-DwTxVJ2QwXyI0eyU7aK0UelYolh7GLByaoBOM2X7lR1urySDFkLlBYG2sMr_87qs1yJxzW6YHeFam6Ht98v2LrZ-lZ0Sa5OdNmPW8V2PW7JL7gwgPGwMQWCIVY5W_If8HGgHH5mF8F6R-EfLtMSHE3dm20G5mkkORTibBYvK3Nse5jwSMEIMwhJY3J_TZ6zz6UmI3W-vnQGufQ/https%3A%2F%2Fmne.tools%2Fdev%2Fwhats_new.html%23id6>
>
> Suggests you should do something like:
>
> >>> src = mne.setup_source_space('sample', spacing='ico3', subjects_dir='/home/larsoner/mne_data/MNE-sample-data/subjects', add_dist=False)
> >>> mne.spatial_src_adjacency(src)
> <1284x1284 sparse matrix of type '<class 'numpy.int64'>'
>     with 8964 stored elements in COOrdinate format>
>
> Or you could use remap_vertices to use the tris function if you want (but
> I find the above code to be cleaner):
>
> >>> mne.spatial_tris_adjacency(src[0]['use_tris'], remap_vertices=True)
> <642x642 sparse matrix of type '<class 'numpy.int64'>'
>     with 4482 stored elements in COOrdinate format>
>
> Eric
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1Y0U4QOZCNKFE0piEBTADI_l8_CUQZea1jEzuhIjy6JYgPGHcmxR40Co3AmGVlnTzdM7chDBPpZUN0Mk-a_Y38ZrtpG83n11c3wONbSp4yKaMJE_jkVUXklGRpHukxBo5LwY4-oHEpwgYASXMokFR-vcQYTVaGOfsIQb9vSSO7GuVdmr0Xc0ax4Pwl5IXJl_VWRNs7A-W7sJBsQP44UpYxgH0TtHRozkSZpDja67RrGiT1PeD-PuTzrHjeSUQLcJeh-5kGtg3b_85C9q4rRidGw/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Fmne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20210512/1517a8ee/attachment.html 


More information about the Mne_analysis mailing list