gastropy.neuro.fmri.find_scanner_triggers

gastropy.neuro.fmri.find_scanner_triggers#

gastropy.neuro.fmri.find_scanner_triggers(annotations, label='R128')[source]#

Extract fMRI scanner trigger onset times from MNE annotations.

Searches for annotations matching the given label (typically R128 for volume triggers) and returns their onset times.

Parameters:
  • annotations (mne.Annotations) – MNE annotations object from a Raw file.

  • label (str, optional) – Trigger label to search for. Default is "R128". Matches exact label, "*/R128" suffixes, or substring.

Returns:

onsets – Sorted array of trigger onset times in seconds. Empty if no matching annotations found.

Return type:

np.ndarray

Examples

>>> import mne
>>> raw = mne.io.read_raw_fif("egg_data.fif")
>>> onsets = find_scanner_triggers(raw.annotations, label="R128")