<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(171, 171, 171) solid;font-family:'Segoe UI WPC', 'Segoe UI', Tahoma, 'Microsoft Sans Serif', Verdana, sans-serif;font-size:11pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(223, 237, 250);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 2px 4px 0px 4px;vertical-align:sub;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(223, 237, 250) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}.wf {speak:none; font-weight:normal; font-variant:normal; text-transform:none; -webkit-font-smoothing:antialiased; vertical-align:middle; display:inline-block;}.wf-family-owa {font-family:'o365Icons'}@font-face { font-family:'o365IconsIE8'; src:url('https://r4.res.outlook.com/owa/prem/15.0.913.9/resources/styles/office365icons.ie8.eot?#iefix') format('embedded-opentype'), url('https://r4.res.outlook.com/owa/prem/15.0.913.9/resources/styles/office365icons.ie8.woff') format('woff'), url('https://r4.res.outlook.com/owa/prem/15.0.913.9/resources/styles/office365icons.ie8.ttf') format('truetype'); font-weight:normal; font-style:normal;}@font-face { font-family:'o365IconsMouse'; src:url('https://r4.res.outlook.com/owa/prem/15.0.913.9/resources/styles/office365icons.mouse.eot?#iefix') format('embedded-opentype'), url('https://r4.res.outlook.com/owa/prem/15.0.913.9/resources/styles/office365icons.mouse.woff') format('woff'), url('https://r4.res.outlook.com/owa/prem/15.0.913.9/resources/styles/office365icons.mouse.ttf') format('truetype'); font-weight:normal; font-style:normal;}.wf-family-owa {font-family:'o365IconsMouse'}.ie8 .wf-family-owa {font-family:'o365IconsIE8'}.ie8 .wf-owa-play-large:before {content:'\e254';}.notIE8 .wf-owa-play-large:before {content:'\e054';}.ie8 .wf-owa-play-large {color:#FFFFFF/*$WFWhiteColor*/;}.notIE8 .wf-owa-play-large {border-color:#FFFFFF/*$WFWhiteColor*/; width:1.4em; height:1.4em; border-width:.1em; border-style:solid; border-radius:.8em; text-align:center; box-sizing:border-box; -moz-box-sizing:border-box; padding:0.1em; color:#FFFFFF/*$WFWhiteColor*/;}.ie8 .wf-size-play-large {width:40px; height:40px; font-size:30px}.notIE8 .wf-size-play-large {width:40px; height:40px; font-size:30px}--></style>
</head>
<body dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p style="">Hello all,<br>
</p>
<p style=""><br>
</p>
<p style="">Im really interested in calculating granger causality using method in connectivity extended (last bit of the document).<br>
</p>
<p style=""><br>
</p>
<p>Specifically, I would like to c<span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">ompute the spectrally resolved granger connectivity.</span><br>
</p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">How would one go about doing that?</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">Is it just be</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<pre class="code" style="padding: 0.5em; margin-top: 0px; margin-left: -10px; font-size: 12px; border: 1px dashed rgb(204, 204, 204); overflow: hidden; font-family: Consolas, 'Andale Mono', Menlo, Monaco, monospace; background-color: rgb(247, 249, 250); white-space: pre-wrap; width: 640px; text-align: justify;">cfg = [];
cfg.output = 'fourier';
cfg.method = 'mtmfft';
cfg.foilim = [5 100];
cfg.tapsmofrq = 5;
cfg.keeptrials = 'yes';
cfg.channel = {'visual' 'motor' 'EMGlft' 'EMGrgt'};
freq = ft_freqanalysis(cfg, combineddata);
cfg = [];
cfg.method = 'granger';
coherence = ft_connectivityanalysis(cfg, freq);<br></pre>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">or would you need to calculate multivariate autoregressive coefficients.</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">Because my data keeps crashing when I try to running it.</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<div style=""> cfg = [];</div>
<div style=""> cfg.order = 5;</div>
<div style=""> cfg.toolbox = 'bsmart';</div>
<div style=""> mdata = ft_mvaranalysis( cfg, comp);<br>
</div>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">With an error of:</span></p>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);"><br>
</span></p>
<div>Index exceeds matrix dimensions.</div>
<div><br>
</div>
<div>Error in ft_mvaranalysis (line 321)</div>
<div style=""> tmpcfg.toilim = [timeaxis(sample-floor(tfwin/2)) timeaxis(sample+ceil(tfwin/2)-1)];<br>
</div>
<div style=""><br>
</div>
<p><span style="font-family: Calibri, Geneva, Arial, Verdana, sans-serif; font-size: 15px; line-height: 22px; text-align: justify; background-color: rgb(255, 255, 255);">Tyler</span></p>
<div>
<p><br>
</p>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-size:13px">*************************
<div style="font-family:Tahoma"><br>
</div>
<div><font face="Arial"><i>Tyler Grummett ( BBSc, BSc(Hons I))</i></font></div>
<div><font face="Arial"><i>PhD Candidate</i></font></div>
<div><font face="Arial"><i>Brain Signals Laboratory</i></font></div>
<div><font face="Arial"><i>Flinders University</i></font></div>
<div><font face="Arial"><i>Rm 5A301</i></font></div>
<div><font face="Arial"><i>Ext 66124</i></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="color: rgb(40, 40, 40);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> fieldtrip-bounces@science.ru.nl <fieldtrip-bounces@science.ru.nl> on behalf of kousik sarathy <sarathykousik@gmail.com><br>
<b>Sent:</b> Sunday, 6 April 2014 6:39 PM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] spatial and temporal ICA after beamformer</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hey Tyler,
<div><br>
</div>
<div>Check out the "Computation of virtual MEG channels in source-space" in this page (<a href="http://fieldtrip.fcdonders.nl/tutorial/connectivityextended">http://fieldtrip.fcdonders.nl/tutorial/connectivityextended</a>).</div>
<div>It gives some hints on what x-y-z components are, how to collapse it and use the filters.</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div dir="ltr">
<div><font color="#000000">--</font></div>
<div><font color="#000000">Regards,<br>
</font></div>
<div><span style="font-family:arial,sans-serif; font-size:13px; background-color:rgb(255,255,255)">
<div style="text-align:left"><font color="#000000">Kousik Sarathy, S</font></div>
</span></div>
<div style="text-align:left"><br>
</div>
</div>
</div>
<br>
<br>
<div class="gmail_quote">On Sun, Apr 6, 2014 at 7:43 AM, Tyler Grummett <span dir="ltr">
<<a href="mailto:tyler.grummett@flinders.edu.au" target="_blank">tyler.grummett@flinders.edu.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Hi Jorn,<br>
<br>
I think the fundamental issue with this is that the spatial filter has three dimensions, each corresponding to either x y or z.<br>
<br>
I must admit I am confused at this point, because I dont know whether to choose x, y or z or somehow combine them or have them as additional channels.<br>
<br>
>> source_inside.avg.filter<br>
<br>
ans =<br>
<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
[3x123 double]<br>
etc....<br>
<br>
Currently I am chosing only the first dimension ie source_inside.avg.filter{ 1}( 1, :) and then multiplying that by the data.<br>
<br>
for j = 1:numel( source_inside.avg.filter),<br>
temp{ j} = source_inside.avg.filter{ j}( 1, :) * data.trial{ 1}(chans,:);<br>
virtual_chans.trial( j, :) = temp{ j};<br>
end<br>
<br>
to end up with:<br>
<br>
virtual_chans =<br>
<br>
label: {1x642 cell}<br>
time: {[1x19767 double]}<br>
trial: [642x19767 double]<br>
<br>
Like I said, I dont know what to with the 2nd and 3rd dimension filters.<br>
<div class=""><br>
Tyler<br>
<br>
*************************<br>
<br>
Tyler Grummett ( BBSc, BSc(Hons I))<br>
PhD Candidate<br>
Brain Signals Laboratory<br>
Flinders University<br>
Rm 5A301<br>
Ext 66124<br>
<br>
</div>
________________________________________<br>
From: <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a> <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>> on behalf of "Jörn M. Horschig" <<a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>><br>
Sent: Saturday, 5 April 2014 7:21 PM<br>
To: FieldTrip discussion list<br>
Subject: Re: [FieldTrip] spatial and temporal ICA after beamformer<br>
<div class="HOEnZb">
<div class="h5"><br>
Hi Tyler,<br>
<br>
> However as I have 642 source.avg.filter, which filter do I chose? Or<br>
> do I calculate EEG channels for each voxel I landed with (I only had<br>
> one trial).<br>
<br>
Yep, you will (should) get 642 virtual channels, where each of these<br>
virtual channels correspond to the activity at the grid-point you<br>
specified when computing the spatial filter.<br>
<br>
<br>
Best,<br>
Jörn<br>
<br>
<br>
On 4/4/2014 4:19 PM, Tyler Grummett wrote:<br>
><br>
> Hello All,<br>
><br>
><br>
> So once I have calculated the preprocessing data, timelock data,<br>
> headmodel, lead field and source.<br>
><br>
><br>
> I have the following code to create virtual EEG channels of data<br>
> (similar to the tutorial):<br>
><br>
> % find sensor names and indices<br>
> chans = ft_channelselection( 'EEG', data.label);<br>
> chans = match_str( data.label, chans);<br>
> % compute virtual channels<br>
> virtual_chans = [];<br>
> virtual_chans.label = data.label;<br>
> virtual_chans.time = data.time;<br>
> virtual_chans.trial = source.avg.filter{ 1} *<br>
> timelock.trial{ 1}(chans,:);<br>
><br>
> However as I have 642 source.avg.filter, which filter do I chose? Or<br>
> do I calculate EEG channels for each voxel I landed with (I only had<br>
> one trial).<br>
><br>
> Btw, the source was calculated with the following code:<br>
><br>
> **<br>
> cfg = [];<br>
> cfg.method = 'lcmv';<br>
> cfg.grid.inside = grid.inside;<br>
> cfg.grid.outside = [];<br>
> cfg.vol = vol;<br>
> cfg.keepfilter = 'yes';<br>
> source = ft_sourceanalysis( cfg, timelock);<br>
><br>
> Thankyou for all the help you have provided me thus far.<br>
><br>
> tyler<br>
><br>
><br>
><br>
><br>
><br>
> *************************<br>
><br>
> /Tyler Grummett ( BBSc, BSc(Hons I))/<br>
> /PhD Candidate/<br>
> /Brain Signals Laboratory/<br>
> /Flinders University/<br>
> /Rm 5A301/<br>
> /Ext 66124/<br>
> ------------------------------------------------------------------------<br>
> *From:* <a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a><br>
> <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>> on behalf of jan-mathijs schoffelen<br>
> <<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>><br>
> *Sent:* Friday, 4 April 2014 7:02 PM<br>
> *To:* FieldTrip discussion list<br>
> *Subject:* Re: [FieldTrip] spatial and temporal ICA after beamformer<br>
> Hi all,<br>
><br>
> Allow me to chime in here. As I understand it Tyler wants to do ICA on<br>
> the output of an LCMV beamformer. This is in general allowed, and can<br>
> be done if you know how to handle the data. In Fieldtrip there is no<br>
> pre-cooked way of doing it. What you need is to fool<br>
> ft_componentanalysis into believing that your source reconstructed<br>
> data is of the type 'raw'. To get started, you can have a look at<br>
> <a href="http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors" target="_blank">
http://fieldtrip.fcdonders.nl/tutorial/shared/virtual_sensors</a>. In this<br>
> particular tutorial, only a few 'virtual channels' are created. You<br>
> probably want many of those, defined on a 3D grid. The only constraint<br>
> there is probably the amount of RAM on your computer. Note that you<br>
> want to do (and will do) temporal ICA in this case. Also, note that<br>
> you probably should pre-PCA your data (this will be a parameter in the<br>
> specs for the options for the ICA algorithm you are going to use). If<br>
> you want to apply the ICA algorithm on amplitude envelope timeseries<br>
> of band-limited activity, rumour has it that the fastica method works<br>
> quite well.<br>
><br>
> Cheers,<br>
> Jan-Mathijs<br>
><br>
> On Apr 4, 2014, at 10:17 AM, Jörn M. Horschig wrote:<br>
><br>
>> Hi Tyler,<br>
>><br>
>> sorry, I realized too late that you want to use LCMV on ICA<br>
>> components - mostly because your approach resulted in many different<br>
>> erros ;). Afaik, it is not possible to use beamforming on ICA<br>
>> components. On Wednesday we talked about this in our weekly FieldTrip<br>
>> meeting and identified some occasions where FieldTrip is not handling<br>
>> IC-data well. This can lead to unexpected results and missing<br>
>> warnings or errors. However, you can use dipole modelling (like<br>
>> EEGlab does) or MNE if you want to. These should work with ICs.<br>
>><br>
>> Any reason why you want to use LCMV on ICs? In theory, both steps<br>
>> constitute a spatial filter, so you can try to be smart and first to<br>
>> LCMV on all your channel level data, and then apply the LCMV spatial<br>
>> filter on the individual backprojected ICs. Somewhat a complicated<br>
>> procedure, but I think it would work?<br>
>><br>
>> Best,<br>
>> Jörn<br>
>><br>
>><br>
>><br>
>> On 4/4/2014 7:23 AM, Tyler Grummett wrote:<br>
>>><br>
>>> Hello fieldtrip,<br>
>>><br>
>>><br>
>>> I was wondering whether it was possible in the fieldtrip toolbox to<br>
>>> run a spatial and temporal ICA on data after it has been run through<br>
>>> ft_sourceanalysis (We can a LCMV beamformer on EEG data that had<br>
>>> been timelocked).<br>
>>><br>
>>><br>
>>> Currently it is saying that I need raw data for it to be processed.<br>
>>><br>
>>><br>
>>> Tyler<br>
>>><br>
>>><br>
>>> *************************<br>
>>><br>
>>> /Tyler Grummett ( BBSc, BSc(Hons I))/<br>
>>> /PhD Candidate/<br>
>>> /Brain Signals Laboratory/<br>
>>> /Flinders University/<br>
>>> /Rm 5A301/<br>
>>> /Ext 66124/<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> fieldtrip mailing list<br>
>>> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a> <mailto:<a href="mailto:fieldtrip@donders.ru.nl">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><br>
>><br>
>><br>
>> --<br>
>> Jörn M. Horschig<br>
>> PhD Student<br>
>> Donders Institute for Brain, Cognition and Behaviour<br>
>> Centre for Cognitive Neuroimaging<br>
>> Radboud University Nijmegen<br>
>> Neuronal Oscillations Group<br>
>> FieldTrip Development Team<br>
>><br>
>> P.O. Box 9101<br>
>> NL-6500 HB Nijmegen<br>
>> The Netherlands<br>
>><br>
>> Contact:<br>
>> E-Mail: <a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a> <mailto:<a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>><br>
>> Tel: <a href="tel:%2B31-%280%2924-36-68493" value="+31243668493">+31-(0)24-36-68493</a><br>
>> Web: <a href="http://www.ru.nl/donders" target="_blank">http://www.ru.nl/donders</a><br>
>><br>
>> Visiting address:<br>
>> Trigon, room 2.30<br>
>> Kapittelweg 29<br>
>> NL-6525 EN Nijmegen<br>
>> The Netherlands<br>
>><br>
>> _______________________________________________<br>
>> fieldtrip mailing list<br>
>> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a> <mailto:<a href="mailto:fieldtrip@donders.ru.nl">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><br>
><br>
> Jan-Mathijs Schoffelen, MD PhD<br>
><br>
> Donders Institute for Brain, Cognition and Behaviour,<br>
> Centre for Cognitive Neuroimaging,<br>
> Radboud University Nijmegen, The Netherlands<br>
><br>
> Max Planck Institute for Psycholinguistics,<br>
> Nijmegen, The Netherlands<br>
><br>
> <a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a> <mailto:<a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a>><br>
> Telephone: <a href="tel:%2B31-24-3614793" value="+31243614793">+31-24-3614793</a><br>
><br>
> <a href="http://www.hettaligebrein.nl" target="_blank">http://www.hettaligebrein.nl</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">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><br>
<br>
<br>
--<br>
Jörn M. Horschig<br>
PhD Student<br>
Donders Institute for Brain, Cognition and Behaviour<br>
Centre for Cognitive Neuroimaging<br>
Radboud University Nijmegen<br>
Neuronal Oscillations Group<br>
FieldTrip Development Team<br>
<br>
P.O. Box 9101<br>
NL-6500 HB Nijmegen<br>
The Netherlands<br>
<br>
Contact:<br>
E-Mail: <a href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a><br>
Tel: <a href="tel:%2B31-%280%2924-36-68493" value="+31243668493">+31-(0)24-36-68493</a><br>
Web: <a href="http://www.ru.nl/donders" target="_blank">http://www.ru.nl/donders</a><br>
<br>
Visiting address:<br>
Trigon, room 2.30<br>
Kapittelweg 29<br>
NL-6525 EN Nijmegen<br>
The Netherlands<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">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><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">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><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>