[FieldTrip] Regarding analysis of MEG data

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Mon May 2 09:17:06 CEST 2022

Hi Saini,

The error you get is caused by the fact that FieldTrip is not clairvoyant. Specifically, it is not able to figure out what the fileformat of your data is. You need to explicitly point to an existing file (with file extension) in cfg.dataset. I am not clairvoyant either, but given your specifications, my guess would be that you need to write something like: ‘C:\blabla\subject_1_MEG_data\4\c,rfDC’, assuming you are dealing with 4D neuroimaging data. If it’s another MEG data format your are using, you’d need to specify the appropriate filename for that system.

Best wishes and good luck.


On 22 Apr 2022, at 18:58, Shubhangi Saini via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

This is my code
cfg = [];
cfg.dataset = 'C:\Users\hp\Documents\MATLAB\subject_1\MEG_data\4';
data_meg = ft_preprocessing(cfg,MEG_data);
for trialsel=1:10
chansel = 1; % this is the STIM channel that contains the trigger
plot(data_meg.time{trialsel}, data_meg.trial{trialsel}(chansel, :))
xlabel('time (s)')
ylabel('channel amplitude (a.u.)')
title(sprintf('trial %d', trialsel));

And I am getting the following error please someone help me out.
Error using ft_read_header
unsupported header format "unknown"

Error in ft_preprocessing (line 404)
  hdr = ft_read_header(cfg.headerfile, headeropt{:});
fieldtrip mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20220502/ba952f9c/attachment.htm>

More information about the fieldtrip mailing list