<div dir="ltr">Dear Fieldtrip team,<br><div><br></div><div>Fieldtrip version: 20211203</div><div><br></div><div>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:</div><div><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;color:rgb(160,32,240)"><span style="color:rgb(0,0,0)">addpath(</span>'/Users/JScholl/Documents/MATLAB/fieldtrip-20211203'<span style="color:rgb(0,0,0)">)</span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica">cfg = [];</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;color:rgb(160,32,240)"><span style="color:rgb(0,0,0)">cfg.dataset =</span>'/MYPATH/Pilot_diode/MEG/data_1.fif'<span style="color:rgb(0,0,0)">;<span class="gmail-Apple-converted-space"> </span></span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica">cfg.trialdef.eventtype = <span style="color:rgb(160,32,240)">'STI101'</span>; <span style="color:rgb(34,139,34)">% define channel for events</span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica">dummy <span class="gmail-Apple-converted-space">                  </span>= ft_definetrial(cfg);<span class="gmail-Apple-converted-space"> </span></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;min-height:14px"><br></p><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;min-height:14px">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, within</p><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;min-height:14px"> case {'neuromag_fif','neuromag_mne',neuromag_mex'}</p>
there was a problem detecting the triggers:</div><div>all of these were empty:</div><div><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica">binaryindx = find(strcmp(ft_chantype(hdr), <span style="color:rgb(160,32,240)">'digital trigger'</span>));</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica"><span class="gmail-Apple-converted-space">      </span>otherindx<span class="gmail-Apple-converted-space">  </span>= find(strcmp(ft_chantype(hdr), <span style="color:rgb(160,32,240)">'other trigger'</span>));</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica"><span class="gmail-Apple-converted-space">      </span>analogindx = find(strcmp(ft_chantype(hdr), <span style="color:rgb(160,32,240)">'analog trigger'</span>));</p>
</div><div><br></div><div>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.</div><div><p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica"><span style="color:rgb(0,0,255)">if</span> isempty(binaryindx) && isempty(analogindx) && isempty(otherindx)</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">        </span></span>% in case of problems with older systems and MNE reader we use a predefined set of channel names</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">        </span></span>%binary <span class="gmail-Apple-converted-space">    </span>= {'STI 014', 'STI 015', 'STI 016'};</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;color:rgb(34,139,34)"><span style="color:rgb(0,0,0)"><span class="gmail-Apple-converted-space">        </span></span>%binaryindx = match_str(hdr.label, binary);</p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica;color:rgb(160,32,240)"><span class="gmail-Apple-converted-space" style="color:rgb(34,34,34)">        </span><span style="color:rgb(34,34,34)">otherindx=match_str(hdr.label,</span>'STI101'<span style="color:rgb(34,34,34)">);</span><br></p>
<p style="margin:0px;font-stretch:normal;line-height:normal;font-family:Helvetica"><span class="gmail-Apple-converted-space">      </span><span style="color:rgb(0,0,255)">end</span></p>
<br class="gmail-Apple-interchange-newline"></div><div>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.</div><div><br></div><div>Best wishes</div><div>Jacquie</div></div>