Back to the main page.

Bug 1942 - flank detection should look at difference, rather than absolute value of trigger channel

Reported 2013-01-22 15:15:00 +0100
Modified 2019-08-10 12:29:29 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Eelke Spaak
Depends on:
See also:

Eelke Spaak - 2013-01-22 15:15:17 +0100

Created attachment 408 default flank detection: flank from 2 to 3 results in trig value 3 I'm not sure if this should be implemented, but to me it seems quite handy. When I detect events in my MEG data in channel UPPT002 (the response channel), the events will get the value that the channel has just after the flank has occurred. (At least, this is the default behaviour for the CTF system). However, it seems that the UPPT002 values are bitmasks: when buttons 1 and 2 are pressed together, the trigger value assigned is 3. This is annoying, because when people are really fast in paradigms requiring subsequent button presses, trialfuns get tedious to code. It would be easily solvable by assigning the voltage difference after and before the flank to the trigger value. To see this, look at the attached screenshots. up.png is using the default 'up' flank detection, updiff.png is using 'updiff', which I implemented. This results in trigger values 2 and 1 for these particular button presses, which is what I would want (instead of 2 and 3). I have already implemented (not committed) this, but whether it is actually desired behaviour needs to be discussed.

Eelke Spaak - 2013-01-22 15:15:36 +0100

Created attachment 409 updiff flank detection: flank from 2 to 3 results in trig value 1

Jörn M. Horschig - 2013-01-22 16:16:20 +0100

I agree that this is a good idea, it would solve many problems I encountered the last two years ;)

Jan-Mathijs Schoffelen - 2013-01-30 13:51:22 +0100

make a start with a faq related to the quirks of events and trigger reading.\ commit the updiff

Eelke Spaak - 2013-06-06 12:18:47 +0200

committed in 8212

Eelke Spaak - 2014-01-29 13:31:39 +0100

this is committed. Marking as fixed for now, in case someone wants updiff as a default I can fix this. Writing the FAQ is open for volunteers :)

Robert Oostenveld - 2019-08-10 12:29:29 +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