read_event for Neuromag 122 trigger events

Yang Zhang zhang470 at UMN.EDU
Fri Jan 8 07:43:28 CET 2010

More details for Fieldtrip developers: I tried modifying read_event.m for my
Neuromag-122 data as follows for the Neuromag part since Neuromag 122 is a
pretty old system. 
    if isempty(binaryindx)&&isempty(analogindx) 
      analog ={'STI 001', 'STI 002', 'STI 003', 'STI 004', 'STI 005','STI
      analogindx = match_str(hdr.label, analog);

 if ~isempty(analogindx)
        trigger = read_trigger(filename, 'header', hdr, 'dataformat',
dataformat, 'begsample', flt_minsample, 'endsample', flt_maxsample,
'chanindx', analogindx, 'detectflank', detectflank, 'trigshift', trigshift,
'fixneuromag', 1);
        event   = appendevent(event, trigger);

I also tried the default to be neuromag_MEX instead of  neuromag_MNE to deal
with the triggers. 

analogindx properly extracted the designated channels for triggers. The
problem seems to be at read_trigger.m and the fixneuromag option. In
read_trigger.m,  all triggers for Neuromag smaller than 5 are excluded when
fixneuromag = 1. This is clearly not applicable to the Neuromag-122 data set
- the common triggers were 1 to 6 for Neuromag-122 system. Regardless of
whether I set fixneuromag to 1 or 0, regardless of whether I use
neuromag_MNE or neuromag_mex, the resulting events for read_event.m did not
look right. 

I tried to rewrite the read_trigger.m, but I knew other ways that worked for
me. I could avoid using fieldtrip. Jensen's 4D toolbox (in combination with
Uutela's fiff access) and the MNEsuite package both worked fine for my
dataset. If possible, I would like to apply Fieldtrip for my data analysis.
Fieldtrip appears to be very powerful and appealing - it worked with all
other data formats for both EEG  and MEG that I have tested so far. 

Thank you very much for your attention.

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and

More information about the fieldtrip mailing list