[FieldTrip] error with databrowser after rejecting components in ICA

Lei, A. (Anqi) anqi.lei at ru.nl
Sat Mar 26 10:10:35 CET 2022


Hello,

I was performing ICA on my EEG data and the script was running smoothly until I rejected bad components using 'ft_rejectcomponent' – after that I couldn't visualize my data using databrowser and got this error:

"Error using ft_fetch_data (line 168)
some of the requested samples occur twice in the data and have conflicting values"

This is the script I used for ICA, could you let me know what might be wrong? Thank you so much!


%% ICA

%Decomposition of EEG data

    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)



    %Removing bad artifacts and backprojecting data

    cfg = [];

    cfg.component = [1 2]; % e.g. to be removed component(s)

data_all = ft_rejectcomponent(cfg, comp, data_all);



    %Display data (this is where the error message occurs)

    cfg = [];

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

    cfg.viewmode = 'vertical';

    ft_databrowser(cfg, data_all);





Best,
Anqi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220326/f6a0d7c4/attachment.htm>


More information about the fieldtrip mailing list