<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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]-->
</head>
<body lang="NL" link="blue" vlink="purple">
<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 lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg1                 = [];</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg1.keeptrials      =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg1.covariance      =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg1.channel         = channel;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">dataPre             = ft_redefinetrial(cfg1, data1FIC);</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">timelock1           = ft_timelockanalysis(cfg1, dataPre);</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">  
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg2                 = [];    
</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg2.keeptrials      =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg2.covariance      =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg2.channel         = channel;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">dataPost            = ft_redefinetrial(cfg2, data2FIC);</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">timelock2           = ft_timelockanalysis(cfg2, dataPost);</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">%% Source analysis</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg = [];</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.grid = grid;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.hdmfile = volname;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.elec = sens;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.vol = vol;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.method =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'lcmv'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.channel = channel;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.lcmv.keeptrials =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:forestgreen">% cfg.lcmv.projectnoise = 'yes';</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:forestgreen"></span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.lmvc.lambda     =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'5%'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">cfg.lcmv.keepfilter =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:#A020F0">'yes'</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">[source1] = ft_sourceanalysis(cfg, timelock1);</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">[source2] = ft_sourceanalysis(cfg, timelock2);</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">sourceDiff = source2;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";color:black">sourceDiff.avg.pow = (source2.avg.pow - source1.avg.pow) ./ source1.avg.pow;</span><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:12.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" 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>
</div>
</body>
</html>