Back to the main page.

Bug 494 - Problems reading events with ft_read_event

Status CLOSED FIXED
Reported 2011-02-14 15:23:00 +0100
Modified 2011-02-16 15:29:39 +0100
Product: FieldTrip
Component: yokogawa
Version: unspecified
Hardware: Macintosh
Operating System: Mac OS
Importance: P1 critical
Assigned to: Tilmann Sander-Thommes
URL:
Tags:
Depends on:
Blocks:
See also:

- 2011-02-14 15:23:50 +0100

Created attachment 23 Example .sqd file with 2 types of trigger on channels 167 and 168 Since some time, I try to use fieldtrip to analyze MEG obtained from a KIT MEG machine with 157 gradial axiometers (Yokogawa format). While reading the proprietary .sqd format works fine, importing events or trials consistently fails. In total, the resulting .sqd data files consist of 192 channels, 157 of which contain MEG data, the rest are trigger and denoising-channels. In the attached test.sqd file, there are 2 different trial types, and 123 trials. Trials are indexed on channels 162:169; i.e. triggers are defined by the channel number of which there is a trigger signal. Trigger signals are 5ms spikes, sent from the presentation computer. In the test.sqd file, there are triggers on channel 168 (many) and on 167 (few). The ft_read_event(cfg.dataset) command never finds any events, nor is there any obvious way to read in trials or trial times in fieldtrip. Any help is greatly appreciated!


Tilmann Sander-Thommes - 2011-02-15 17:09:50 +0100

Created attachment 24 demo script for reading events from Yokogawa raw files


Tilmann Sander-Thommes - 2011-02-15 17:11:12 +0100

(In reply to comment #0) > Created attachment 23 [details] > Example .sqd file with 2 types of trigger on channels 167 and 168 > > Since some time, I try to use fieldtrip to analyze MEG obtained from a KIT MEG > machine with 157 gradial axiometers (Yokogawa format). While reading the > proprietary .sqd format works fine, importing events or trials consistently > fails. > In total, the resulting .sqd data files consist of 192 channels, 157 of which > contain MEG data, the rest are trigger and denoising-channels. > > In the attached test.sqd file, there are 2 different trial types, and 123 > trials. > Trials are indexed on channels 162:169; i.e. triggers are defined by the > channel number of which there is a trigger signal. Trigger signals are 5ms > spikes, sent from the presentation computer. In the test.sqd file, there are > triggers on channel 168 (many) and on 167 (few). > > The ft_read_event(cfg.dataset) command never finds any events, nor is there any > obvious way to read in trials or trial times in fieldtrip. > > Any help is greatly appreciated! Hi there, The core of the problem is a lack of trigger channel definitions within the Yokogawa / KIT recording software: Load your file into MEG160, then menu "Edit" section "Channel info" and scroll down to the trigger channels. They are marked as "null channels". Nevertheless FieldTrip can read the events from those channels, you just have to tell it about the channels. I have created and attached a little demo script extracting events, and calculating an average over one type of event and displaying field maps. The main points is that you input the trigger channel indices into ft_read_event. The attached code could be simplified using ft_definetrial, but the demo code shows better, what is actually happening. A last and very important issue: Channel indices in KIT / Yokogawa start at 0 and go to 159, in Matlab it is 1 to 160, therefore your trigger channels 167 and 168 become indices 168 and 169 in FieldTrip. Yours, Till