<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dear Alistair,<br>
<br>
I am not quite sure whether I understand your request correctly,
but you are looking for help to get the maximum activity per trial
in your source reconstructed data? I guess your confusion arises
because of the different subfields, so here a short explanation:<br>
<br>
Every dipole has strengths in 3 directions (think of it as
magnetic field strength in the x,y and z direction), this is
stored in .mom<br>
In order to get it down to one number instead of three, there are
different possibilities, but what's roughly happening by default
is that an SVD is computed then the principal direction is taken,
i.e. the strongest of these three vectors. This is what you find
back in .pow. The filter matrix is the filter per grid position
to get from your sensor data to the source data. Noise is an
approximation of the noise level per trial.<br>
<br>
So, if you want to get the maximum activity, I would suggest to
take [~, idx] = max(sourceDiff.avg.pow{i}), where idx then is the
the grid position of maximal power. If you are interested in the
maximum over e.g. the posterior part of the brain, you should
limit your search. You can best do that by using sourceDiff.pos
and an atlas.<br>
<br>
If that does not answer your question, feel free to clarify your
request ;)<br>
<br>
Best,<br>
Jörn<br>
<br>
On 10/25/2012 10:40 PM, Alistair Vardy - 3ME wrote:<br>
</div>
<blockquote
cite="mid:7E8E8A2DF53088489583543F38570D7A1EBDBF7F@SRV362.tudelft.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I trying to reconstruct
the activity in a source using the LCMV beamformer with EEG
data. My code follows several examples that stop at the
source localization. Unfortunately, I am unable to
reconstruct the source.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The data is a series of
198 button presses, self-paced. The two time locked data
sets are pre- and post-event windows. The data is filtered
in the beta band (13-30 Hz). There are 128 EEG channels,
three of which are excluded due to excessive noise. The data
was re-referenced to the common average. The source that
provides the normalized difference in power between the two
time windows has a field avg with subfields, filter, noise,
pow, and mom:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">sourceDiff = <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> dim: [17 13 14]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> time: [1x819
double]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> pos: [3094x3
double]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> inside: [1x1567
double]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> outside: [1x1527
double]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> method: 'average'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> avg: [1x1
struct]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> cfg: [1x1
struct]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">sourceDiff.avg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ans = <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> pow: [1x3094
double]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> mom: {1x3094
cell}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> noise: [1x3094
double]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> filter: {1x3094
cell}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The moment entries are
sized 3 x 819, the filter 3 x 65.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I hope someone can help
me with the code required to reconstruct the source at the
voxel with the largest power during the entire duration of
each trial. The code used to determine the source is below.
MRI, head model and leadfield were computed as well but are
not included in the code below.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Kind regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Alistair<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black">channel = {</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0">'EEG'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black">,
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0">'-AFF1'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black">,
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0">'-AFZ'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black">,
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0">'-AF1'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black">};</span><span
style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg1 =
[];</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg1.keeptrials =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'yes'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg1.covariance =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'yes'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg1.channel =
channel;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">dataPre =
ft_redefinetrial(cfg1, data1FIC);</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">timelock1 =
ft_timelockanalysis(cfg1, dataPre);</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">
</span><span style="font-size:12.0pt;font-family:"Courier
New"" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg2 =
[];
</span><span style="font-size:12.0pt;font-family:"Courier
New"" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg2.keeptrials =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'yes'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg2.covariance =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'yes'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg2.channel =
channel;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">dataPost =
ft_redefinetrial(cfg2, data2FIC);</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">timelock2 =
ft_timelockanalysis(cfg2, dataPost);</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:forestgreen" lang="EN-US">%% Source analysis</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg = [];</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.grid = grid;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.hdmfile = volname;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.elec = sens;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.vol = vol;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.method =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'lcmv'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.channel = channel;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.lcmv.keeptrials =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'yes'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:forestgreen" lang="EN-US">%
cfg.lcmv.projectnoise = 'yes';</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:forestgreen" lang="EN-US"></span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.lmvc.lambda =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'5%'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">cfg.lcmv.keepfilter =
</span><span style="font-size:10.0pt;font-family:"Courier
New";color:#A020F0" lang="EN-US">'yes'</span><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">[source1] =
ft_sourceanalysis(cfg, timelock1);</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">[source2] =
ft_sourceanalysis(cfg, timelock2);</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">sourceDiff = source2;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:black" lang="EN-US">sourceDiff.avg.pow =
(source2.avg.pow - source1.avg.pow) ./ source1.avg.pow;</span><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:12.0pt;font-family:"Courier New""
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
Neuronal Oscillations Group
FieldTrip Development Team
P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands
Contact:
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>
Tel: +31-(0)24-36-68493
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a>
Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands</pre>
</body>
</html>