pliers.stimuli.ImageStim

class pliers.stimuli.ImageStim(filename=None, onset=None, duration=None, data=None, url=None)[source]

Bases: Stim

Represents a static image.

Parameters
  • filename (str) – Path to input file, if one exists.

  • onset (float) – Optional onset of the image (in seconds) with respect to some more general context or timeline the user wishes to keep track of.

  • duration (float) – Optional duration of the ImageStim, in seconds.

  • data (ndarray) – Optional numpy array to initialize the image from, if no filename is passed.

  • url (str) – Optional url to read contents from.

__init__(filename=None, onset=None, duration=None, data=None, url=None)[source]
get_bytestring(encoding='utf-8')[source]

Return the image data as a bytestring.

Parameters

encoding (str) – Encoding to use. Defaults to utf-8.

Returns: A string.

get_filename()

Return the source filename of the current Stim.

property history

Return stimulus history.