[FieldTrip] possible bugs in using mask in ft_topoplotTFR?

berry van den berg berryv.dberg at gmail.com
Tue Dec 18 21:38:00 CET 2012


Dear Clara,

Thanks for the quick reply! That indeed does the job! Im new to fieldtrip
so I dont know all the details but it seems to be the same as adding the
following around line 428 in ft_topoplotTFR (fieldtrip 20121216)...

  tmpmask = data.(cfg.maskparameter);
  data          = ft_timelockanalysis(tmpcfg, data);
  data.(cfg.maskparameter) = tmpmask;

plus removing lines 411-413:

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

Cheers!

Berry

2012/12/18 Clara A. Scholl <clara.scholl at gmail.com>

> Dear Berry,
>
> I found that the mask works when plotting  topos directly from an
> average field (grandavg.avg), but not when plotting the individual
> data ( grandavg.individual -- which are averaged from the individual
> field, so effectively the same thing).  Can you try averaging over the
> first dimension of grandavg.individual
> (grandavg.avg=squeeze(mean(grandavg.individual))) and removing the
> individual field? Does that work?
>
> Good luck,
> Clara
>
> On Tue, Dec 18, 2012 at 2:56 PM, berry van den berg
> <berryv.dberg at gmail.com> wrote:
> > 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
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>



-- 
Berry van den Berg
berryv.dberg at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20121218/6d342465/attachment-0002.html>


More information about the fieldtrip mailing list