[FieldTrip] rejectcomponent after ica for 20 comps only

Yuval Harpaz yuvharpaz at gmail.com
Mon Mar 19 20:49:31 CET 2012


thanks a lot. it clears the matter
Yuval

On 19 March 2012 18:59, Gio Piantoni <g.piantoni at nin.knaw.nl> wrote:

> Hi Yuval,
>
> If you pass data as third argument, the function will substract the
> weights of rejected component(s) from your data. So, your data will
> have the initial rank minus the number of rejected component. No
> reconstruction occurs.
>
> See line 121 of ft_rejectcomponent or try the code below.
>
> nelec = 50;
> fs = 1000;
> ntrl = 5;
>
> data = [];
> data.label = cellfun(@(x)['E' num2str(x)], num2cell(1:nelec), 'uni', 0);
> data.fsample = fs;
> for i =1:ntrl
>  data.trial{i} = randn(nelec, fs);
>  data.time{i} = 1/fs:1/fs:1;
> end
>
> cfg = [];
> cfg.method = 'fastica';
> cfg.numcomponent = 10;
> comp = ft_componentanalysis(cfg, data);
>
> cfg = [];
> cfg.component = 2;
> data2 = ft_rejectcomponent(cfg, comp, data); % subtract comp from data
> data3 = ft_rejectcomponent(cfg, comp); % reconstruct from comp
>
> rank(data.trial{1}) % full rank
> rank(data2.trial{1}) % full rank - 1 rejected
> rank(data3.trial{1})  % rank of 'comp' - 1 rejected
>
> On Mon, Mar 19, 2012 at 16:46, Yuval Harpaz <yuvharpaz at gmail.com> wrote:
> > Dear ft_emaillist
> >
> > I want to reject components obtained with with fastica.
> >
> > if I only run ft_componentanalysis with cfg.numcomponent=20, creating
> only
> > 20 components, can I still reject a specific component by
> > ft_rejectcomponent(cfg,comp,data) or will it only reconstruct the date
> based
> > on the 20 components I calculated?
> >
> > thanks,Yuval
> >
> > --
> >
> > Y.Harpaz
> >
> > a link to the BIU MEG lab:
> > http://faculty.biu.ac.il/~goldsa/index.html
> >
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>



-- 

Y.Harpaz

a link to the BIU MEG lab:
http://faculty.biu.ac.il/~goldsa/index.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120319/04d6139d/attachment.html>


More information about the fieldtrip mailing list