<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>