[FieldTrip] Problems using ft_qualitycheck

Hannah Terborg hannah_terborg at sfu.ca
Fri Aug 23 21:53:45 CEST 2019



Hello everyone,
I am trying to use ft_qualitycheck for my MEG data. However, it always gives me the warning saying it could not determine the file type of my subject.hist file. It further gives me, I think, an incomplete analysis picture. Further I get the warning: Error updating legend not enough input arguments as well as the warning: tiralfun not specified using ft_trialfun_general.


In short:

- no error message

- multiple warnings:

  *   couldn't determine file type (regarding the subject.hist file)
  *   error updating legend not enough input arguments
  *   trialfun not specified using  ft_trialfun_general

- The image created by ft_qualitycheck: added in the attachments

- System info:

  *   operating system: linux (in a (vnc) server system)
  *   matlab version: I tried 2019a,2018b and 2011b
  *   fieldtrip version:  20180410
  *   MEG system: high density 275 Channel system (MISL CTF )

- Code specific info:

  *   We are using .ds files for each subject
  *   We have continuous data
  *   We have a custom trial function (which so far seems to be working fine)
     *   however it doesn't seem to take it into account (I tried to use cfg.trialfun as well as cfg.trl ).Giving the warning trialfun not specfied
        *   I also tried other different fields (and combinations) for the cfg (I put down most of them in the down below code but I am not fully sure in how far they are recognized)
     *   I could imagine this being the core of the issue

- The code:
%%define trial
cfg=[];
cfg.trialdef.eventtype='trial';
cfg.trialfun = 'our_trialfun';
cfg.dataset= datapath;
[trl, event] = our_trialfun(cfg);
cfg = definetrial(cfg);
%% Inspect data
cfg = [];
cfg.trl = trl;
cfg.channel ={'MEG'};
cfg.trialdef.eventtype= 'trial';
cfg.trialfun = 'our_trialfun'
cfg.continuous = 'yes';
cfg.savemat = 'no';
cfg.saveplot = 'no';
cfg.dataset = datapath;
cfg.plotunit = 500;
[info,timelock,frq,summary,headpos]=ft_qualitycheck(cfg);

%%%custom trial function
function [trl, event] = our_trialfun(cfg)
event = ft_read_event(cfg.dataset);
hdr = ft_read_header(cfg.dataset);

cfg.trialdef.prestim  = 0.2; %seconds
cfg.trialdef.poststim = 0.7;
pretrig = -round(cfg.trialdef.prestim*hdr.Fs);
posttrig = round(cfg.trialdef.poststim*hdr.Fs);

con_labels = {'LOW_W';'HIGH_W';'LOW_W';'HIGH_W';'HIGH_F';'LOW_F';'HIGH_F';'LOW_F'};
con_values = {'11'; '12'; '13'; '14'; '15'; '16'; '17'; '18'};

%a = {event.type}';
a= {event.type};
sample = [];
for j=1:length(con_values)
    for i=1:length(a)
    %if a{i} == con_values{j}
value = [event(find(strcmp(con_values{j},{event.type}))).value]';
newsample = [event(find(strcmp(con_values{j},{event.type}))).sample]';
    %end
    end
    sample = [sample; newsample];
    sample = sortrows(sample);
end

trl = [];
for i = 1:length(sample)
    trlbegin = sample(i) + pretrig;
    trlend = sample(i) + posttrig;
    offset = pretrig;
    newtrl = [trlbegin trlend offset];
    trl = [trl; newtrl];
end
end

Thank you,

Hannah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190823/948287a9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_qualitycheck.png
Type: image/png
Size: 174603 bytes
Desc: ft_qualitycheck.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190823/948287a9/attachment-0001.png>


More information about the fieldtrip mailing list