[FieldTrip] ICA - problem with ft_rejectcomponent

Lei, A. (Anqi) anqi.lei at ru.nl
Sun Mar 27 23:38:28 CEST 2022


Hello,

I'm new to Fieldtrip and I encountered a problem in ICA – after rejecting bad components with ft_rejectcomponent I noticed my data can't be plotted by databrowser anymore, but before this step it can be visualized just fine. This is how I am perform ICA – is there something wrong in the ft_rejectcomponent part? Thank you for your help!




    %% ICA

    % perform the independent component analysis (i.e., decompose the data), downsampling first

    cfg            = [];

    cfg.resamplefs = 150;

    cfg.detrend    = 'no';

    data           = ft_resampledata(cfg, data_all);



    cfg        = [];

    cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB

    comp = ft_componentanalysis(cfg, data);



    %Identify components reflecting eye artifacts

    % plot the components for visual inspection

    figure

    cfg = [];

    cfg.component = 1:20;       % specify the component(s) that should be plotted

    cfg.layout    = 'acticap-64ch-standard2_XZ.mat'; % specify the layout file that should be used for plotting

    cfg.comment   = 'no';

    ft_topoplotIC(cfg, comp)



    %Further inspection of time course of component

    cfg = [];

    cfg.layout = 'acticap-64ch-standard2_XZ.mat'; % specify the layout file that should be used for plotting

    cfg.viewmode = 'component';

    ft_databrowser(cfg, comp)



    %Removing bad artifacts and backprojecting data

    cfg = [];

    cfg.component = 1; % to be removed component(s)

    data_all = ft_rejectcomponent(cfg, comp, data_all);

Best,
Anqi


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220327/518e2115/attachment.htm>


More information about the fieldtrip mailing list