I am trying to automatically mark segments as bad for all my subjects raw EEG data, from the beginning of the signal to the first trigger event, minus 100ms.
The first trigger event is different in time for every subject.
I have seen this post:
But as I mentioned before, in my case the bad segment would be different for every subject.
Nothing in the existing processes would allow you to create a new "BAD" event based only on the first marker. You could make work something out with a combination of multiple processes used a bit away from their initial goal:
Group by name: to duplicate an existing category into an new event category that includes the string "BAD"
Detect multiple responses, with a very long "minimum delay between events" and "keep only the first even": In order to keep only the first event of the duplicated category
Convert to extended event with a time window that includes all the beginning of the file, until the baseline of the first stim (eg. [-100, -0.500]s)
Otherwise, it might be simpler to write a Matlab script edit directly the event structure: