<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;"> External Email - Use Caution </span></p><p></p><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Eric,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">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?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Best,</div><div class="gmail_default" style="font-size:small">Gladia</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 23, 2021 at 10:32 PM Eric Larson <<a href="mailto:larson.eric.d@gmail.com">larson.eric.d@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)"> External Email - Use Caution </span></p><p></p><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,0);font-family:arial,sans-serif">Also, I'm using MNE 0.20.7. The function 'spatial_tris_connectivity' seems to be gone in the latest</span><br></div><div><pre><font face="arial, sans-serif" color="#000000">stable MNE (0.22.1). Is there an updated way of getting the nearest neighbors matrix?</font></pre></div></div></blockquote><div>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:</div><div><br></div><div><a href="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" target="_blank"><font color="red"><b>MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be</b></font> https://mne.tools/dev/whats_new.html#id6</a><br></div><div><br></div><div>Suggests you should do something like:</div><div></div><div><pre style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block">>>> 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>
</code></pre><div title="MDH:PGRpdj5gYGA8L2Rpdj48ZGl2PiZndDsmZ3Q7Jmd0OyBzcmMgPSBtbmUuc2V0dXBfc291cmNlX3Nw
YWNlKCdzYW1wbGUnLCBzcGFjaW5nPSdpY28zJywgc3ViamVjdHNfZGlyPScvaG9tZS9sYXJzb25l
ci9tbmVfZGF0YS9NTkUtc2FtcGxlLWRhdGEvc3ViamVjdHMnLCBhZGRfZGlzdD1GYWxzZSk8YnI+
Jmd0OyZndDsmZ3Q7IG1uZS5zcGF0aWFsX3NyY19hZGphY2VuY3koc3JjKTxicj4mbHQ7MTI4NHgx
Mjg0IHNwYXJzZSBtYXRyaXggb2YgdHlwZSAnJmx0O2NsYXNzICdudW1weS5pbnQ2NCcmZ3Q7Jzxi
cj4Jd2l0aCA4OTY0IHN0b3JlZCBlbGVtZW50cyBpbiBDT09yZGluYXRlIGZvcm1hdCZndDs8YnI+
PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2PjwvZGl2Pg==" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px"></div></div><div>Or you could use remap_vertices to use the tris function if you want (but I find the above code to be cleaner):</div><div></div><div><pre style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block">>>> 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>
</code></pre><div title="MDH:PGRpdj5gYGA8L2Rpdj48ZGl2PiZndDsmZ3Q7Jmd0OyBtbmUuc3BhdGlhbF90cmlzX2FkamFjZW5j
eShzcmNbMF1bJ3VzZV90cmlzJ10sIHJlbWFwX3ZlcnRpY2VzPVRydWUpPGJyPiZsdDs2NDJ4NjQy
IHNwYXJzZSBtYXRyaXggb2YgdHlwZSAnJmx0O2NsYXNzICdudW1weS5pbnQ2NCcmZ3Q7Jzxicj4J
d2l0aCA0NDgyIHN0b3JlZCBlbGVtZW50cyBpbiBDT09yZGluYXRlIGZvcm1hdCZndDs8YnI+PC9k
aXY+PGRpdj5gYGA8L2Rpdj48ZGl2PjwvZGl2Pg==" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px"></div></div><div>Eric<br></div><div><br></div></div></div>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="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" rel="noreferrer" target="_blank"><font color="red"><b>MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be</b></font> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>