[FieldTrip] Problem reading neuromag data - fixed by changing ft_read_event. Is this correct?

Jacqueline Scholl jacquie.scholl at gmail.com
Thu Dec 9 09:56:01 CET 2021

Dear Fieldtrip team,

Fieldtrip version: 20211203

I've collected data (just diode check for now) on a Neuromag scanner (OHBA,
Oxford). I tried to read in the events with this code:


cfg = [];

cfg.dataset ='/MYPATH/Pilot_diode/MEG/data_1.fif';

cfg.trialdef.eventtype = 'STI101'; % define channel for events

dummy                   = ft_definetrial(cfg);

This gave me the error that no events were detected. I've followed through
the scripts called by ft_definetrial and noticed that in ft_read_event,

 case {'neuromag_fif','neuromag_mne',neuromag_mex'}
there was a problem detecting the triggers:
all of these were empty:

binaryindx = find(strcmp(ft_chantype(hdr), 'digital trigger'));

      otherindx  = find(strcmp(ft_chantype(hdr), 'other trigger'));

      analogindx = find(strcmp(ft_chantype(hdr), 'analog trigger'));

And as a result, binary indices that were not in my data got defined (see
what I've commented out below). I've replaced this by telling the script to
look for STI101 and this now works.

if isempty(binaryindx) && isempty(analogindx) && isempty(otherindx)

        % in case of problems with older systems and MNE reader we use a
predefined set of channel names

        %binary     = {'STI 014', 'STI 015', 'STI 016'};

        %binaryindx = match_str(hdr.label, binary);



Was there something else I somehow missed? As I realise making my own
changes to the field trip toolbox is not good as it will be gone when I get
the newer version at some point.

Best wishes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211209/526296c3/attachment.htm>

More information about the fieldtrip mailing list