mnefun.extract_expyfun_events(fname, return_offsets=False)

Extract expyfun-style serial-coded events from file


Filename to use.


If True, return the time of each press relative to trial onset in addition to the press number.


Array of events of shape (N, 3), re-coded such that 1 triggers are renamed according to their binary expyfun representation.

presseslist of ndarray

List of all press events that occurred between each one trigger. Each array has shape (N_presses,). If return_offset is True, then each array has shape (N_presses, 2), with the first column as the time offset from the trial trigger.


Original events array.


When this function translates binary event codes into decimal integers, it adds 1 to the value of all events. This is done to prevent the occurrence of events with a value of 0 (which downstream processing would treat as non-events). If you need to convert the integer event codes back to binary, subtract 1 before doing so to yield the original binary values.