I have been using a nearest-neighbor mapping between subjects based on
the morphing maps, but now I am trying to implement the smoothing
operator in MATLAB as Matti suggested in an earlier email. However, I
have encountered a problem at step 2 ("On each row, insert ones to the
columns corresponding to the vertices adjacent to the vertex
corresponding to the row."): I am unsure how to determine which
vertices are adjacent to other vertices in the original
(~100,000-element) source space, which I think is where Matti is
suggesting the spreading operator needs to be applied.
I tried using mne_add_patch_info with a distance argument, but that
only seems to determine:
1) distances between elements in the decimated source space (thus why
it shows up as dist_limit=-0.01 for 10mm distance calculation when
using "mne_read_source_space(fname,true)" in MATLAB), and
2) the nearest vertex in the decimated source space for each vertex in
the original source space.
Is there some function I can use to determine which vertices in the
original, un-decimated source space are neighbors? Or am I missing
something about how to calculate the smoothing operator?
here is a matlab function that takes the faces (ie. the triangles)
of a mesh and returns a sparse adjacency matrix.
hope this helps
Alex
Hello all,
I have been using a nearest-neighbor mapping between subjects based on
the morphing maps, but now I am trying to implement the smoothing
operator in MATLAB as Matti suggested in an earlier email. However, I
have encountered a problem at step 2 ("On each row, insert ones to the
columns corresponding to the vertices adjacent to the vertex
corresponding to the row."): I am unsure how to determine which
vertices are adjacent to other vertices in the original
(~100,000-element) source space, which I think is where Matti is
suggesting the spreading operator needs to be applied.
I tried using mne_add_patch_info with a distance argument, but that
only seems to determine:
1) distances between elements in the decimated source space (thus why
it shows up as dist_limit=-0.01 for 10mm distance calculation when
using "mne_read_source_space(fname,true)" in MATLAB), and
2) the nearest vertex in the decimated source space for each vertex in
the original source space.
Is there some function I can use to determine which vertices in the
original, un-decimated source space are neighbors? Or am I missing
something about how to calculate the smoothing operator?
Eric
Here is the recipe we came up with Alex Gramfort during lunch to make
the spreading operator matrix. The C code uses direct iteration
instead of forming this matrix explicitly. By "valid neigboring
vertex" I mean a vertex which is adjacent to the vertex of interest
AND belongs to the source space OR has been defined during previous
iterations of the spreading operator.
This is what you need to do:
0. Initialize the spreading operator as an nvert x nvert identity
matrix (S_0)
1. Create an nvert x nvert empty matrix (S)
2. On each row, insert ones to the columns corresponding to the
vertices adjacent to the vertex corresponding to the row.
3. Zero columns corresponding to vertices that are not valid.
4. Divide each row by the number of non-zero entries on that row.
4. Compute the spreading operator corresponding to the k'th smoothstep
as S_k = S*S_{k-1}
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.
Just to clarify, the triangulation information i.e the 'faces' variable in
Alex's code can be found in inv.src(1).tris and inv.src(2).tris in the
Inverse operator matlab structure.