[FieldTrip] ft_sourcestatistics: cfg.design and memory issues

Paul Metzak pmetzak at gmail.com
Tue Nov 3 00:34:52 CET 2015


Hello,

I am new to FieldTrip (and MEG) and I have been working through the
walkthroughs and tutorials in an attempt to use beamforming to source
localize my MEG data. In this experiment, there are 3 conditions and 2
groups. I have been following the Example: Source Statistics (
http://www.fieldtriptoolbox.org/example/source_statistics) tutorial but I
have encountered a couple of difficulties.

1) The first issue is in the choice of design matrix for the analyses I
would like to run. The tutorial offers a very clear example of how to
assess differences between conditions within a single group, but it is less
straightforward (to me at least) how to run an analysis of the differences
between two groups on a single condition. In my case, I have 17
participants from group 1 and 14 participants from group 2. I have created
17x1 and 14x1 cell array containing the output from each subject's beamform
(at the individual subject level, I contrasted a period of interest from
condition 1 with an equivalent length of time from the prestim baseline).
My call to ft_sourcestatistics is below. Is this the proper way to set up
the design matrix to run this analysis? I know that participants are not
true 'independent variables' but it seems to me that treating them as such
will randomise group assignment to produce the monte carlo distribution
that I am looking for.

cfg=[];
cfg.dim=cond1_h{1}.dim;
cfg.method      = 'montecarlo';
cfg.statistic   = 'ft_statfun_indepsamplesT';
cfg.parameter   = 'pow';
cfg.correctm    = 'cluster';
cfg.numrandomization = 1000;
cfg.alpha       = 0.05; % note that this only implies single-sided testing
cfg.tail        = 0;

nsubj=17;
cfg2.design(1,:) = [ones(1,nsubj) ones(1,nsubj)*2];  %create over-large
desmtx
cfg.design=cfg.design(:,1:31); %trim desmtx to correct specs
cfg.ivar        = 1; % row of design matrix that contains independent
variable (the participants)

stat = ft_sourcestatistics(cfg, cond1_h{:}, cond1_s{:});

2) The second issue is that it appears I have been inefficient in my memory
use as matlab crashes when I attempt to run this analysis ( FYI I have 16GB
of RAM and 16GB of swap space). I have employed the -nojvm flag when
starting matlab, and I have used struct2single to try and reduce the memory
load but matlab still crashes out (without message) when I attempt to run
this analysis. This code will run on my computer with a maximum of 4
subjects from each group and 50 randomizations, which is obviously not
ideal for me. Please find the contents of a single cell from one of the
groups below. Is there something that is obviously problematic in what I
have so far?

       inside: [256x256x256 logical]
          pow: [256x256x256 single]
          dim: [256 256 256]
    transform: [4x4 single]
      anatomy: [256x256x256 single]
     coordsys: 'ctf'
         unit: 'mm'
          cfg: [1x1 struct]


Thank you very much for any help you can offer me with this! If any further
information or clarifications would be useful to help diagnose or overcome
this issue, please let me know.

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20151102/d7378697/attachment.html>


More information about the fieldtrip mailing list