[FieldTrip] possible bugs in using mask in ft_topoplotTFR?

berry van den berg berryv.dberg at gmail.com
Tue Dec 18 20:56:12 CET 2012


Hi Fieldtrip experts,

Im working on an EEG analysis in fieldtrip and I came across some possible
bugs or perhaps I am doing something wrong.... I have a dataset with 28
subjects and my grandavg (including the 28 individuals) look like this:

grandavg =

    individual: [28x64x1251 double]
         label: {64x1 cell}
          time: [1x1251 double]
        dimord: 'subj_chan_time'
           cfg: [1x1 struct]
          mask: [1x64 double]

 I first tried to use a mask in ft_topoplotER in the  11/11/2012 fieldtrip
version but this did not work:

input:

cfg = [];
cfg.xlim = [0.3 0.4];
cfg.baseline = [-.2 0];
cfg.layout = ft_prepare_layout(timelock_mat{1,1})
cfg.interactive='yes';
grandavg.mask = [ones(1, 60) zeros(1,4)]; %just an example
cfg.maskparameter = 'mask';
ft_topoplotER(cfg,grandavg)

Reference to non-existent field 'mask'.
Error in ft_topoplotTFR (line 713)
  datmask = data.(cfg.maskparameter);

it seems that around line 420 in the function   data =
ft_timelockanalysis(tmpcfg, data) it does not retrieve the mask parameter.

To check if it was an old bug I downloaded the newest FT version:
16/12/2012: the mask parameter does not work in this version yet..

Moreover:
topoplotTFR line 409-411 there is a section added compared to version
11/11/2012:

%%%%%%%
if isfield(cfg, 'parameter') && ~isfield(data, cfg.parameter)
  error('cfg.parameter=%s is not present in data structure', cfg.parameter);
end
%%%%%%%

which checks whether the is present... but because I have all my individual
subjects in the data I am waiting for line 425:data =
ft_timelockanalysis(tmpcfg, data) to average my dataset. It crashes here
(after removal of these lines it runs like normal)

Error using ft_topoplotTFR (line 412)
cfg.parameter=avg is not present in data structure

Is there something I am missing?

Thanks a lot! (also for providing this very good package!)

Berry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20121218/f5312ccb/attachment.html>


More information about the fieldtrip mailing list