[FieldTrip] eeglab2fieldtrip --> cluster based permutation analysis help

Abdullah Mosabbir amosabbir at research.baycrest.org
Wed Feb 10 19:56:38 CET 2021


Hello FieldTrip community,

I would like to take pre-processed eeglab data into field trip for cluster
based permutation analysis of ERP. After using the eeglab2fieldtrop
function, the output 'eegdata' is the following:

eegdata =

  struct with fields:

      label: {1×76 cell}
    fsample: 512
       elec: [1×1 struct]
      trial: {1×46 cell}
       time: {1×46 cell}
        cfg: [1×1 struct]

I average the trials together for a grand average manually to make
eegdata.avg, and I delete eegdata.trials. Then I collect multiple subjects
under one structure called Resp_Inc_SE1, to be compared to another group
Resp_Inc_SE2. My cfg structure is the following:

cfg         = [];
cfg.channel = Resp_Inc_SE1{1}.label';
cfg.latency = 'all';

cfg.method           = 'montecarlo';
cfg.statistic        = 'depsamplesT';
cfg.correctm         = 'cluster';
cfg.clusteralpha     = 0.05;
cfg.clusterstatistic = 'maxsum';
cfg.minnbchan        = 1;
cfg.neighbours     = neighbours5;
cfg.neighbourdist  = .6;
cfg.tail             = 0;
cfg.clustertail      = 0;
cfg.alpha            = 0.025;
cfg.numrandomization = 500;
cfg.frequency = [0 50];
%cfg.dim = [64 3072];

Nsubj  = 7;
design = zeros(2, Nsubj*2);
design(1,:) = [1:Nsubj 1:Nsubj];
design(2,:) = [ones(1,Nsubj) ones(1,Nsubj)*2];

cfg.design = design;
cfg.uvar   = 1;
cfg.ivar   = 2;

I run

[stat] = ft_timelockstatistics(cfg, Resp_Inc_SE1{:}, Resp_Inc_SE2{:})

I get the error message:

Error using findcluster (line 53)
invalid dimension of spatdimneighbstructmat

Error in clusterstat (line 197)
      posclusobs = findcluster(reshape(postailobs,
      [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);

Error in ft_statistics_montecarlo (line 347)
  [stat, cfg] = clusterstat(cfg, statrand, statobs);

Error in ft_timelockstatistics (line 184)
    [stat, cfg] = statmethod(cfg, dat, design);

If anyone can help with this I would appreciate it. I suspect I need to
configure the data structure in a way that field trip can process its
functions, but without prior examples I don't know how that structure would
be. Note, I created an elec file based on the 64 channel model and
realigned and eventually used to create cfg.neighbours5.

I would appreciate any help, thanks.

-- 
Abdullah Mosabbir, PhD
Post Doctoral Researcher

cfg.design = design;
cfg.uvar   = 1;es
3560 Bathurst Street
Toronto, Ontario, M6A 2E1

P: 416-785-2500 x3561
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20210210/5e843f7f/attachment.htm>


More information about the fieldtrip mailing list