Dear Clara,<br><br>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)...<br>
<br>  tmpmask = data.(cfg.maskparameter); <br>  data          = ft_timelockanalysis(tmpcfg, data);<br>  data.(cfg.maskparameter) = tmpmask;<br><br>plus removing lines 411-413:<br><br>% if isfield(cfg, 'parameter') && ~isfield(data, cfg.parameter)<br>
%   error('cfg.parameter=%s is not present in data structure', cfg.parameter);<br>% end<br><br>Cheers!<br><br>Berry<br><br><div class="gmail_quote">2012/12/18 Clara A. Scholl <span dir="ltr"><<a href="mailto:clara.scholl@gmail.com" target="_blank">clara.scholl@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Berry,<br>
<br>
I found that the mask works when plotting  topos directly from an<br>
average field (grandavg.avg), but not when plotting the individual<br>
data ( grandavg.individual -- which are averaged from the individual<br>
field, so effectively the same thing).  Can you try averaging over the<br>
first dimension of grandavg.individual<br>
(grandavg.avg=squeeze(mean(grandavg.individual))) and removing the<br>
individual field? Does that work?<br>
<br>
Good luck,<br>
Clara<br>
<div><div><br>
On Tue, Dec 18, 2012 at 2:56 PM, berry van den berg<br>
<<a href="mailto:berryv.dberg@gmail.com" target="_blank">berryv.dberg@gmail.com</a>> wrote:<br>
> Hi Fieldtrip experts,<br>
><br>
> Im working on an EEG analysis in fieldtrip and I came across some possible<br>
> bugs or perhaps I am doing something wrong.... I have a dataset with 28<br>
> subjects and my grandavg (including the 28 individuals) look like this:<br>
><br>
> grandavg =<br>
><br>
>     individual: [28x64x1251 double]<br>
>          label: {64x1 cell}<br>
>           time: [1x1251 double]<br>
>         dimord: 'subj_chan_time'<br>
>            cfg: [1x1 struct]<br>
>           mask: [1x64 double]<br>
><br>
>  I first tried to use a mask in ft_topoplotER in the  11/11/2012 fieldtrip<br>
> version but this did not work:<br>
><br>
> input:<br>
><br>
> cfg = [];<br>
> cfg.xlim = [0.3 0.4];<br>
> cfg.baseline = [-.2 0];<br>
> cfg.layout = ft_prepare_layout(timelock_mat{1,1})<br>
> cfg.interactive='yes';<br>
> grandavg.mask = [ones(1, 60) zeros(1,4)]; %just an example<br>
> cfg.maskparameter = 'mask';<br>
> ft_topoplotER(cfg,grandavg)<br>
><br>
> Reference to non-existent field 'mask'.<br>
> Error in ft_topoplotTFR (line 713)<br>
>   datmask = data.(cfg.maskparameter);<br>
><br>
> it seems that around line 420 in the function   data =<br>
> ft_timelockanalysis(tmpcfg, data) it does not retrieve the mask parameter.<br>
><br>
> To check if it was an old bug I downloaded the newest FT version:<br>
> 16/12/2012: the mask parameter does not work in this version yet..<br>
><br>
> Moreover:<br>
> topoplotTFR line 409-411 there is a section added compared to version<br>
> 11/11/2012:<br>
><br>
> %%%%%%%<br>
> if isfield(cfg, 'parameter') && ~isfield(data, cfg.parameter)<br>
>   error('cfg.parameter=%s is not present in data structure', cfg.parameter);<br>
> end<br>
> %%%%%%%<br>
><br>
> which checks whether the is present... but because I have all my individual<br>
> subjects in the data I am waiting for line 425:data =<br>
> ft_timelockanalysis(tmpcfg, data) to average my dataset. It crashes here<br>
> (after removal of these lines it runs like normal)<br>
><br>
> Error using ft_topoplotTFR (line 412)<br>
> cfg.parameter=avg is not present in data structure<br>
><br>
> Is there something I am missing?<br>
><br>
> Thanks a lot! (also for providing this very good package!)<br>
><br>
> Berry<br>
><br>
</div></div>> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Berry van den Berg<br><a href="mailto:berryv.dberg@gmail.com" target="_blank">berryv.dberg@gmail.com</a><br>