[Mne_analysis] Identifying adjacent sources

Gladia Hotan gladiach at gmail.com
Mon Mar 5 09:11:56 EST 2018
Search archives:

Hi Alex,

Thanks for your reply! I did:

surf = fwd['src'][hemi_idx]
tris = surf['use_tris']

edges = mesh_edges(tris)

The dimensions of 'edges' are 642*642 in my case.

I'm not sure I understand how coo_matrix in the mesh_edges function works.

I saw that in the mesh_edges function,

npoints = np.max(tris) + 1

Which gives one extra point.

Then:

edges = coo_matrix((ones_ntris, (x, y)), shape=(npoints, npoints))

Which I interpreted as adding a '1' at element (x[i],y[i]) of 'edges' each
time (x[i],y[i]) appears in (x,y), like in this example on constructing a
matrix using ijv format
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.coo_matrix.html>
.

However, since the largest element of 'tris' is np.max(tris), why are
there nonzero entries for the (np.max(tris) + 1)th row/col in the
'edges' matrix?

Should I be using edges[0:npoints-1,0:npoints-1] as my adjacency matrix?


Thanks and Best,

Gladia




On Sun, Mar 4, 2018 at 3:29 PM, Alexandre Gramfort <
alexandre.gramfort at inria.fr> wrote:

> i suppose you mean use_tris with _
>
> it's normal to have twice more triangles than vertices.
>
> see for example here:
>
> https://github.com/mne-tools/mne-python/blob/master/mne/viz/_3d.py#L1444
>
> how we get the triangles in low resolution with vertices index that go
> from 0 to 581 in your case.
>
> HTH
> Alex
>
>
> On Sat, Mar 3, 2018 at 10:58 PM, Gladia Hotan <gladiach at gmail.com> wrote:
>
>> Hi Alex,
>>
>> I'm still not sure how to get the adjacency matrix, based on the example.
>> It seems like lh_faces and rh_faces contain the faces from the original
>> cortical parcellation, before some sources are removed? I have an ico 3
>> source space. My leadfield matrix has 1162 sources in total. Thus
>> fwd['src'][0]['vertno'].shape = 581 and fwd['src'][1]['vertno'].shape =
>> 581. However, fwd['src'][0]['usetris'].shape = 1280 and
>> fwd['src'][1]['usetris'].shape = 1280, so I'm not sure which faces
>> correspond to which vertices?
>>
>> Thanks and Best,
>> Gladia
>>
>> On Tue, Feb 6, 2018 at 5:26 AM, Alexandre Gramfort <
>> alexandre.gramfort at inria.fr> wrote:
>>
>>> This is the old script I was pointing to:
>>>
>>> https://github.com/mne-tools/mne-python/blob/maint/0.4/examp
>>> les/plot_read_forward.py
>>>
>>> HTH
>>> Alex
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom
>>> it is
>>> addressed. If you believe this e-mail was sent to you in error and the
>>> e-mail
>>> contains patient information, please contact the Partners Compliance
>>> HelpLine at
>>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>> in error
>>> but does not contain patient information, please contact the sender and
>>> properly
>>> dispose of the e-mail.
>>>
>>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>> The information in this e-mail is intended only for the person to whom it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>> in error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180305/3b20fb9b/attachment-0001.html 


More information about the Mne_analysis mailing list