Epoching CTF data using scanMarkers


I currently have MEG CTF data that has the following block format:
Block start (trigger portcode t11)
Ready trial (t12)
Tap trial (t13)
NoTap trial (t14)
Block end (t15)

The tap and noTap trials will repeat (tap, noTap, tap, noTap, tap, noTap…) until 20 seconds have elapsed, and you read the block end. I have managed to add markers (addMarkers) for each of the trigger portcodes.

For analysis, I’d like to add in another marker to mark the first occurrence of the “noTap” trial within the block and name it “begintime”. Currently, I have this:

scanMarkers -f -includeBad -marker t14_noTap -overlap 0 -time -1 0.1 -excludeEvent1 t14_noTap 0.2 22 -add begintime ${DATASET} begintimes.evt

However, it’s not working as intended… I thought this would scan for any occurrence of t14 between -1 and 0.1 seconds of t14, then exclude any other occurence of marker t14 0.2 s to 22 s after that first occurrence of t14 (since I only want to include the first one).

Instead, it seems to be picking up the last two occurrences of noTap in the block, and the time points aren’t even correct when I compare them to when those trigger actually occur. Not really sure what I’m doing wrong, would appreciate any guidance. Thanks!