keep_intervals#
- pypillometry.keep_intervals(intervals)#
Pipeline step for
keep_intervals()(d | pp.keep_intervals(...)).Exclude everything outside the given periods (e.g., keep only the task blocks or the fMRI run).
Same as
exclude_intervals(intervals.complement(d)): the time before, between and after the periods is excluded (seeexclude_intervals()). Periods that are already excluded stay excluded, also if they are within intervals.- Parameters:
intervals (Intervals, Epochs or list of tuple) – the periods to keep: an
Intervalsobject (e.g., fromget_intervals(); in time units or sample indices),Epochsor a list of(start, end)tuples (in ms, or with units;"<start>"and"<end>"stand for the start and end of the recording); ends are exclusiveinplace (bool or None, optional) – if True, make change in-place and return the object; if False, make and return copy before making changes; if None, use the object-level setting (specified in the constructor)
- Return type:
- Returns:
the object with the excluded periods (self or a copy, depending on inplace)
Examples
>>> run = d.get_intervals(start="rsfMRI_ONSET", end="rsfMRI_END", units="ms") >>> d = d.keep_intervals(run)