expyriment.design.extras.StimulationProtocol

class expyriment.design.extras.StimulationProtocol(unit)[source]

A class implementing a stimulation protocol.

Methods

__init__(unit)[source]

Create a stimulation protocol.

Parameters:

unit : str

The unit of the stimulation protocol (‘time’ or ‘volume’)

add_condition(name)[source]

Add a condition to the stimulation protocol.

Parameters:

name : str

The name of the condition to add

add_event(condition, begin, end, weight=1)[source]

Add an event to a condition.

Parameters:

condition : str or int

The name or index of the condition to add the event to

begin : int

The beginning time of the event

end : int

The end time of the event

weight : int, optional

A weight for parametric modulation (default = 1)

export2brainvoyager(exp_name, filename)[source]

Convert the stimulation protocol to BrainVoyager ‘.prt’ format.

Parameters:

exp_name : str

The name of the Experiment

filename : str

The name of the file to write

load(filename, encoding=None)[source]

Load a stimulation protocol from a csv file.

Parameters:

filename : str

The filename to read the protocol from

encoding : str, optional

The encoding to be used when reading from the file

save(filename)[source]

Save the stimulation protocol to a csv file.

Parameters:

filename : str

The name of the file to save the protocol to