[FieldTrip] grad field missing in ft_appenddata

Es, M.W.J. van (Mats) M.vanEs at donders.ru.nl
Mon Jul 27 10:24:13 CEST 2015

Hi fieldtrippers,

I am stuck combining datasets from MEG sessions (note that I do this after preprocessing each individual dataset). I use ft_appenddata to combine the three datasets, which all have a different amount of trials and often there is a discrepency in the channels as well. After running the following code the alldata structure contains only the channels which are presents in all inputs, but the grad field (which is in the single datasets) is not in the combined datastructure:

alldata = ft_appenddata(cfg, data{1}, data{2}, data{3})

If I try to use alldata (w/o .grad), I later run into problems using ft_megplanar when I want to do time-frequency analysis. The error is caused by ft_checkdata:

Error using ft_checkdata (line 527)
This function requires MEG data with a 'grad' field

I already tried solving this by using ft_average_sens:
for ii=1:length(data)
   sens(ii) = data{ii}.grad;
alldata.grad = ft_average_sens(sens);

However, than I get this error:
Error using ft_average_sens (line 101)
all sensor arrays should have the same sensors for averaging

How can I incorporate the grad field while I have different channels in each dataset?

Mats van Es

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150727/0507acb2/attachment-0001.html>

More information about the fieldtrip mailing list