Back to the main page.

Bug 1216 - when calling ft_read_event(), different results from version 20110907 and the beta-test

Status CLOSED FIXED
Reported 2011-12-06 06:32:00 +0100
Modified 2019-08-10 11:46:22 +0200
Product: FieldTrip
Component: yokogawa
Version: unspecified
Hardware: All
Operating System: All
Importance: P3 critical
Assigned to: Tilmann Sander-Thommes
URL:
Tags:
Depends on:
Blocks:
See also:

Paul Chang - 2011-12-06 06:32:06 +0100

dear all, We have a data set that may cause fieldtrip-20110907 and the beta-test code (from Dr. Sander on Nov. 15, 2011) producing different results. They are explained as follows: ==================================================================== 1. calling ft_read_events() evt = ft_read_event('20111115_Part1.con') evt = 1053531x1 struct array with fields: type sample value offset duration Both versions (20110907 and the beta-test) generates the same result. ===================== However, when ================================== 2. calling ft_read_events() with argument "trigindx" event = ft_read_event('20111115_Part1.con', 'trigindx', 193:200, 'threshold',3e3, 'detectflank', 'up'); #2.1 Version 20110907 will return: event = 414x1 struct array with fields: type sample value offset duration #2.2 But the beta-test will return: Warning: no triggers were detected, please specify the "trigindx" option > In fileio\private\read_yokogawa_event at 137 In ft_read_event at 1439 event = Empty matrix: 0-by-1 Can you help to explore this problem in the beta-test code? In the attachment, we provide this dataset "20111115_Part1.con" (sized around 70 MB) for you to explore this problem.


Paul Chang - 2011-12-06 06:42:09 +0100

Created attachment 197 testcase to generate this problem


Tilmann Sander-Thommes - 2011-12-06 10:49:54 +0100

I downloaded the example file and will work on the problem. Yours, Till


Tilmann Sander-Thommes - 2011-12-09 15:51:55 +0100

An error in the Yokogawa toolbox selection was removed in ft_read_event.m, but this was not the main cause of the bug: The correct result for your datafile can be obtained using the Yokogawa MEG Reader 1.4 toolbox only by evt = ft_read_event('20111115_Part1.con', 'trigindx', 193:200, 'threshold',4, 'detectflank', 'up'); The crucial point is that you set the threshold to 4. The signals on lines 193-200 are 5 V TTL levels for logic 1. To detect them a threshold of 4 (V) is appropriate. The older toolbox did not read the voltage correctly and you had to set a different threshold. With this command I get: event = 414x1 struct array with fields: type sample value offset duration If you do not set 'trigindx', 'threshold', and 'detectflank' the following happens: All triggerchannels are used, which are channels 193-224 (see Edit-> Channel Info in MEG 160 software, note channel index starts at 0 in ET 160 and at 1 in FieldTrip). Any non-zero value is detected as an event without the threshold option and the small noise around zero between the actual triggers leads to the many events detected. 'detectflank' defaults to 'up', so no real problem here. For illustration I attach a screen shot of the trigger signals from your file. I consider the bug resolved, but leave it open for furthe replies / changes. Yours, Till


Tilmann Sander-Thommes - 2011-12-09 15:52:28 +0100

Created attachment 201 Screen shot of trigger lines


Tilmann Sander-Thommes - 2011-12-09 15:53:42 +0100

status change


Robert Oostenveld - 2019-08-10 11:46:22 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.