[FieldTrip] grad field missing in ft_appenddata

Tzvetan Popov tzvetan.popov at uni-konstanz.de
Mon Jul 27 10:44:20 CEST 2015


Hi Mats,
this is expected behavior of ft_appenddata. Since a mismatch between head position and sensors is expected in the context of different datasets or sessions these shouldn’t be combined. Therefore you loos that information. Why don’t you go all the way down to the output of the frequency analysis and combine (e.g. grand average) the three separate structures?
best
tzvetan


> 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:
> 
> cfg=[];
> 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;
> end
> 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?
> 
> 
> Best,
> Mats van Es
> 
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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


More information about the fieldtrip mailing list