[Mne_analysis] regarding morphing in matlab

Hari Bharadwaj hari at nmr.mgh.harvard.edu
Tue Mar 29 23:53:39 EDT 2011
Search archives:

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.


Cheers,
Hari


On Tue, March 29, 2011 10:35 pm, Alexandre Gramfort wrote:
> Hi Eric,
>
> 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
>
> On Tue, Mar 29, 2011 at 9:51 PM, Eric Larson <larson.eric.d at gmail.com>
> wrote:
>> 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
>>
>> On Tue, Mar 15, 2011 at 5:17 PM,
>> <mne_analysis-request at nmr.mgh.harvard.edu> wrote:
>>> 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}
>>>
>>> I hope this helps.
>>>
>>> - Matti
>> _______________________________________________
>> 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


-- 
Hari Bharadwaj



More information about the Mne_analysis mailing list