[FieldTrip] Virtual electrode data error

Holly Rossiter RossiterH at cardiff.ac.uk
Tue Mar 12 11:29:17 CET 2019


Hi there,

I am creating some virtual electrode data as recommended on your website using this code:

RSN_filter = source_idx.avg.filter{1};
chansel = ft_channelselection('MEG', pain.label);
chansel = match_str(pain.label, chansel);
RSN_data = [];
RSN_data.label = ROI;
RSN_data.time = pain.time;
RSN_data.fsample = pain.fsample;
for i=1:length(pain.trial)
  RSN_data.trial{i} = RSN_filter * pain.trial{i}(chansel,:);
End

Then when I try and view the data using ft_databrowser like this:

cfg = [];
cfg.viewmode = 'vertical';
ft_databrowser(cfg, RSN_data);

I get this error:

the input is raw data with 7 channels and 60 trials
Error using ft_datatype_raw (line 84)
inconsistent number of channels in trial 1

Error in ft_checkdata (line 268)
  data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo);

Error in ft_databrowser (line 281)
  data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback',
  'yes', 'hassampleinfo', 'yes');

I can see that there is only 1 channel in the data structure so I cannot understand why it thinks there are 7. I have tried using a recent version of fieldtrip (20190219) but still get the same error.

Can you help me work out why this is?

Thanks,
Holly

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190312/b6aaa024/attachment-0001.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list