[FieldTrip] ICA - Can I visualize Activity power spectrum of single components?
Lozano Soldevilla, D. (Diego)
d.lozanosoldevilla at fcdonders.ru.nl
Wed May 28 14:24:06 CEST 2014
Hi Katrin, First, to display the independent components: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cfg = []; cfg.layout = 'CTF151.lay'; % specify the layout file that should be used for plotting cfg.viewmode = 'component' ft_databrowser(cfg, comp) Take a look to the following example script: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_eog_artifacts Second, you'll have to compute the power spectrum for each independent component with ft_freqanalaysis: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cfg = []; cfg.output = 'pow'; cfg.channel = 'all';%compute the power spectrum in all ICs cfg.method = 'mtmfft'; cfg.taper = 'hanning'; cfg.foi = 2:2:30; freq = ft_freqanalysis(cfg, comp); And you can plot the spectra: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nsubplots = 25; nbyn = sqrt(nsubplots);% sqrt(nsubplots) should not contain decimals, type doc subplot Nfigs = ceil(size(comp.topo,1)/nsubplots); tot = Nfigs*nsubplots; rptvect = 1:size(comp.topo,1); rptvect = padarray(rptvect, [0 tot-size(comp.topo,1)], 0,'post'); rptvect = reshape(rptvect,nsubplots,Nfigs)'; for r=1:size(rptvect,1); figure;set(gcf,'units','normalized','outerposition',[0 0 1 1]);%full screen k=0; for j=1:size(rptvect,2); if~(rptvect(r,j)==0); k=k+1; cfg=[]; cfg.channel = rptvect(r,j); subplot(nbyn,nbyn,k);ft_singleplotER(cfg,freq); end end end For the IC topos you'll follow the same logic as above but with: figure cfg = []; cfg.component = [1:20]; % specify the component(s) that should be plotted cfg.layout = 'GSN-HydroCel-129.sfp'; cfg.comment = 'no'; ft_topoplotIC(cfg, comp) I hope it helps Diego ----- Original Message -----
> From: "KatrinH Heimann" <katrinheimann at gmail.com>
> To: "FieldTrip discussion list" <fieldtrip at science.ru.nl>
> Sent: Wednesday, 28 May, 2014 12:59:38 PM
> Subject: [FieldTrip] ICA - Can I visualize Activity power spectrum of
> single components?
> Dear all,
> another question:
> Is it possible to visualize the Activity power spectrum of the single
> components after an ICA by using ft_databrowser (or something else). I
> like this feature from EEG lab as I find it easier to detect
> artifactual components.
> Thanks a lot for your help
> Katrin
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-- PhD Student Neuronal Oscillations Group Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen NL-6525 EN Nijmegen The Netherlands http://www.ru.nl/people/donders/lozano-soldevilla-d/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140528/39ebb560/attachment-0002.html>
More information about the fieldtrip
mailing list