pliers.filters.TemporalTrimmingFilter

class pliers.filters.TemporalTrimmingFilter(start=0, end=None, frames=False, validation='warn')[source]

Bases: Filter

Temporally trims the contents of the audio stimulus using the provided start and end points.

Parameters
  • start (float) – New start point for the trimmed video in seconds.

  • end (float) – New end point for the trimmed video in seconds.

  • frames (bool) – If True, treat the provided start and end values as frame indices, otherwise, treat them as time in terms of seconds. If True, start and end must both be integers.

  • validation (str) –

    String specifying how OOB errors (end > duration) should be handled. Must be one of:

    • ’strict’: Raise an exception on an OOB error

    • ’warn’: Issue a warning for all OOB errors and use the

    maximum bounds

__init__(start=0, end=None, frames=False, validation='warn')[source]
transform(stims, validation='strict', *args, **kwargs)

Executes the transformation on the passed stim(s).

Parameters
  • stims (str, Stim, list) –

    One or more stimuli to process. Must be one of:

    • A string giving the path to a file that can be read in as a Stim (e.g., a .txt file, .jpg image, etc.)

    • A Stim instance of any type.

    • An iterable of stims, where each element is either a string or a Stim.

  • validation (str) –

    String specifying how validation errors should be handled. Must be one of:

    • ’strict’: Raise an exception on any validation error

    • ’warn’: Issue a warning for all validation errors

    • ’loose’: Silently ignore all validation errors

  • args – Optional positional arguments to pass onto the internal _transform call.

  • kwargs – Optional positional arguments to pass onto the internal _transform call.