<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
<!--
@font-face
{font-family:Calibri}
@font-face
{font-family:Tahoma}
@font-face
{font-family:Consolas}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:#1F497D}
@page WordSection1
{margin:70.85pt 70.85pt 70.85pt 70.85pt}
-->
</style><style type="text/css" id="owaParaStyle"></style>
</head>
<body lang="NL" link="blue" vlink="purple" fpstyle="1" ocsi="0" class=" hasGoogleVoiceExt">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>Hi Antonietta,</div>
<div><br>
I'm pretty new to fieldtrip, but I was able to do something similar by doing the following:</div>
<div><br>
</div>
<div>1) conducting the timelocked analysis</div>
<div>2) <span style="font-size: 10pt;">computing the lcmv for all trials</span></div>
<div><span style="font-size: 10pt;">3) extracting the common filter</span></div>
<div><span style="font-size: 10pt;">4) multiplying the common filter by the sensor timecourses</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">I haven't really figured out how to plot these timecourses just yet, but it's a work in progress. Here's the code I used, hope it helps. </span></div>
<div><br>
</div>
<div>
<div style="font-size: 13.3333px;">% 1) conducting the timelocked analysis</div>
<div><span style="font-size: 10pt;">disp('################################timelocked')</span></div>
<div>cfg = [];</div>
<div>cfg.vartrllength = 2;</div>
<div>cfg.covariance = 'yes';</div>
<div>cfg.covariancewindow = 'prestim';</div>
<div>cfg.keeptrials = 'yes';</div>
<div>cfg.channel = 'MEG';</div>
<div>cfg.inputfile = strcat(subject, '.alltrials.clean.mat');</div>
<div>cfg.outputfile = strcat(subject, '.alltrials.clean.timelocked.mat');</div>
<div>timelocked = ft_timelockanalysis(cfg);</div>
</div>
<div><br>
</div>
<div>
<div style="font-size: 13.3333px;">% 2) <span style="font-size: 10pt;">computing the lcmv for all trials</span></div>
<div style="font-size: 13.3333px;"><span style="font-size: 10pt;">disp('################################create lcmv filter')</span></div>
<div>cfg = [];</div>
<div>cfg.method = 'lcmv';</div>
<div>cfg.grid = leadfield_ctf;</div>
<div>cfg.vol = vol_ctf;</div>
<div>cfg.grad = grad;</div>
<div>cfg.channel = 'MEG';</div>
<div>cfg.lambda = '5%';</div>
<div>cfg.lcmv.fixedori = 'yes';</div>
<div>cfg.keepfilter = 'yes';</div>
<div>cfg.outputfile = strcat(subject, '.alltrials.clean.beamformer.filter.mat');</div>
<div>beamformer_avg = ft_sourceanalysis(cfg, timelocked);</div>
<div><br>
</div>
<div><br>
</div>
<div style="font-size: 13.3333px;"><span style="font-size: 10pt;">% 3) extracting the common filter</span></div>
<div>disp('################################create extract common filter')</div>
<div>commonfilter = cell2mat(beamformer_avg.avg.filter);</div>
<div><br>
</div>
<div>beamformer_virt = [];</div>
<div><span style="font-size: 10pt;">beamformer_virt.fsample = data.fsample;</span></div>
<div>beamformer_virt.trial = [];</div>
<div>beamformer_virt.time = time;</div>
<div>beamformer_virt.trialinfo = timelocked.trialinfo;</div>
<div>beamformer_virt.dimord = timelocked.dimord;</div>
<div><br>
</div>
<div style="font-size: 13.3333px;"><span style="font-size: 10pt;">% 4) multiplying the common filter by the sensor timecourses</span></div>
<div style="font-size: 13.3333px;">disp('################################create source timecourse')</div>
<div>for i=1:size(timelocked.trial,1)</div>
<div> disp(strcat('################################computing timecourse for trial: ', int2str(i)));</div>
<div> beamformer_virt.trial{i} = commonfilter*squeeze(timelocked.trial(i,:,:));</div>
<div>end</div>
</div>
<div><br>
</div>
<div>-nick</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF128939" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> Pelt, S. van (Stan) [stan.vanpelt@donders.ru.nl]<br>
<b>Sent:</b> Monday, February 29, 2016 8:47 AM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] Time series of sources activation by using LCMV Beamformer<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Dear Antonietta,</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">In addition to the tutorial Vasan is referring to (where you can find the relevant information under the paragraph “Connectivity between MEG
virtual channel and EMG”), there is also a dedicated tutorial for your question:
<a href="http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors" target="_blank">
http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors</a></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Best,</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">Stan</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:Consolas">--</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:Consolas">Stan van Pelt, PhD</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:Consolas">Donders Institute for Brain, Cognition and Behaviour</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:Consolas">Radboud University</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:Consolas">Montessorilaan 3, B.01.34</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt; font-family:Consolas">6525 HR Nijmegen, the Netherlands</span></p>
<p class="MsoNormal"><span style="font-size:10.5pt; font-family:Consolas">tel: +31 24 3616288
</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt; font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt; font-family:"Tahoma","sans-serif""> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl]
<b>On Behalf Of </b>Sreenivasan R. Nadar, Ph.D.<br>
<b>Sent:</b> maandag 29 februari 2016 13:57<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] Time series of sources activation by using LCMV Beamformer</span></p>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">Hello Antonietta,</p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Please find the following link for extracting source time series:</p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.fieldtriptoolbox.org/tutorial/connectivity" target="_blank">http://www.fieldtriptoolbox.org/tutorial/connectivity</a></p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Vasan</p>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On Mon, Feb 29, 2016 at 4:31 AM, Antonietta Sorriso <<a href="mailto:antonietta.sorriso@uniparthenope.it" target="_blank">antonietta.sorriso@uniparthenope.it</a>> wrote:</p>
<p class="MsoNormal"><br>
Hello,<br>
I am using fieltrip in order to obtain source reconstruction from MEG data.<br>
I succesfully implemented a code that exploit the function ft_sourceanalysis<br>
for performing beamformer. Unfortunately I was not able to obtain the output<br>
I need, i.e. the time series of sources activation. In particular I only was<br>
able to achieve the mean activation value for each source, divided for<br>
frequency bands or not, but I found no way for computing the activation<br>
intensity of each source for each time sample. Is it possible to achieve<br>
such goal via fieldtrip? If yes, which function and which input parameters<br>
should I exploit?<br>
<br>
Thanks and best regards<br>
-- <br>
Antonietta Sorriso<br>
<br>
Ph.D. Student<br>
Dipartimento di Ingegneria<br>
Laboratorio di TLC ed Elaborazione Segnali ed Immagini<br>
Centro Direzionale di Napoli, Isola C4, Stanze 326-327, lato Sud, piano 3<br>
80143, Napoli, Italia<br>
e-mail: <a href="mailto:antonietta.sorriso@uniparthenope.it" target="_blank">antonietta.sorriso@uniparthenope.it</a><br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>