[FieldTrip] ft_sourcestatistics startup memory problem

Akiko Ikkai akiko.ikkai at gmail.com
Sun Oct 7 17:36:50 CEST 2012

Dear Fieldtrip users,

I've been trying to run group stats on my EEG source data, which contains
14 subjects' normalized beamformer data, and having serious swap memory
issue (not Matlab memory issue, but OS swap memory).

I'm trying to contrast 2 conditions (within subject design). Each subject's
normalized beamformer data (1 condition) is

source_lTMI_intNorm =

      anatomy: [181x217x181 double]

       inside: [181x217x181 logical]

          avg: [1x1 struct]

    transform: [4x4 double]

          dim: [181 217 181]

          cfg: [1x1 struct]


Name                     Size                Bytes  Class     Attributes

  source_lTMI_intNorm      1x1             520114791  struct

therefore, when I open all subjects' data ("data1group" and "data2group"),
it's huge...

Name            Size                 Bytes  Class     Attributes

  data1group      1x14            5909429438  cell

  data2group      1x14            6705652782  cell

data1group & data2group are both 1x14 struct (1 cell/subject). Therefore,


anatomy: [181x217x181 double]

       inside: [181x217x181 logical]

          avg: [1x1 struct]

    transform: [4x4 double]

          dim: [181 217 181]

          cfg: [1x1 struct]

So, when I try to run


 cfg.dim         = data1group{1}.dim;

 cfg.method      = 'montecarlo';

 cfg.statistic   = 'depsamplesT';

 cfg.parameter   = 'avg.pow';

 cfg.correctm    = 'cluster';

 cfg.numrandomization = 100;

 cfg.alpha       = 0.05;

 cfg.tail        = 0;


 cfg.design(1,:) = [1:nsubj 1:nsubj];

 cfg.design(2,:) = [ones(1,nsubj) ones(1,nsubj)*2];

 cfg.uvar        = 1;

 cfg.ivar        = 2;

 stat = ft_sourcestatistics(cfg, data1group{:}, data2group{:});

 stat.anatomy = data1group{1}.anatomy;

my computer (os 10.6.8, 6G memory) runs out of swap memory (startup
memory?), which forces me to quit Matlab. I'm running above processes in a
function, so I'm not running into Matlab memory error.

Could someone help me how it could run more efficiently? I guess
cfg.inputfile is not available for ft_sourcestatistics, so I have to
eventually load 2 group data in Matlab workspace...?

Thank you in advance! Akiko

Akiko Ikkai, Ph.D.
Postdoctoral Fellow
Department of Psychological and Brain Sciences
Johns Hopkins University
Ames Hall, 3400 N. Charles St.
Baltimore, MD 21218
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20121007/01f4e629/attachment-0001.html>

More information about the fieldtrip mailing list