gastropy.neuro.fmri.create_volume_windows#
- gastropy.neuro.fmri.create_volume_windows(onsets, tr, n_volumes)[source]#
Create volume window index pairs from trigger onsets.
Maps trigger onset times to
(start_idx, end_idx)pairs at the fMRI sampling rate (1/TR Hz).- Parameters:
- Returns:
windows – List of
(start_idx, end_idx)pairs for each volume.- Return type:
Examples
>>> onsets = np.arange(0, 100, 1.856) # ~54 volumes >>> windows = create_volume_windows(onsets, tr=1.856, n_volumes=50)