Skip to content

radiens_core.models.stim

Stimulation domain models and enums.

CLASS DESCRIPTION
StimKeypressIndex

Keypress trigger number, 1-8.

StimParams

Stimulation parameters for a single channel.

StimPolarity

Stimulation polarity.

StimPulseMode

Stimulation pulse mode.

StimShape

Stimulation waveform shape.

StimStep

Stimulation step size.

StimStepState

Current stimulation step size setting.

StimTriggerEdgeOrLevel

Stimulation trigger edge/level mode.

StimTriggerHighOrLow

Stimulation trigger high/low.

ATTRIBUTE DESCRIPTION
FlexStimKeypressIndex

StimKeypressIndex that also accepts a keypress number (1-8).

Attributes

FlexStimKeypressIndex module-attribute

FlexStimKeypressIndex = StimKeypressIndex | int

StimKeypressIndex that also accepts a keypress number (1-8).

Classes

StimKeypressIndex

Bases: IntEnum

Keypress trigger number, 1-8.

StimParams

Bases: BaseModel

Stimulation parameters for a single channel.

All timing values are in microseconds (μs). Amplitudes are in μA for amplifier channels and V for DAC channels.

ATTRIBUTE DESCRIPTION
stim_sys_chan_idx

System channel index.

TYPE: int

stim_shape

Stimulation waveform shape. Also accepts string names (e.g. "biphasic"). Defaults to StimShape.BIPHASIC.

TYPE: StimShape | StimShapeStr

stim_polarity

Stimulation polarity. Also accepts string names (e.g. "cathodic_first"). Defaults to StimPolarity.CATHODIC_FIRST.

TYPE: StimPolarity | StimPolarityStr

first_phase_duration

Duration of the first phase in μs. Defaults to 100.0.

TYPE: float

second_phase_duration

Duration of the second phase in μs. Defaults to 100.0.

TYPE: float

interphase_delay

Delay between phases in μs. Defaults to 0.0.

TYPE: float

first_phase_amplitude

Amplitude of the first phase (μA for amp, V for DAC). Defaults to 0.1.

TYPE: float

second_phase_amplitude

Amplitude of the second phase (μA for amp, V for DAC). Defaults to 0.0.

TYPE: float

baseline_voltage

Baseline voltage in V. Defaults to 0.0.

TYPE: float

trigger_edge_or_level

Trigger mode. Also accepts string names. Defaults to StimTriggerEdgeOrLevel.EDGE.

TYPE: StimTriggerEdgeOrLevel | StimTriggerEdgeOrLevelStr

trigger_high_or_low

Trigger polarity. Also accepts string names. Defaults to StimTriggerHighOrLow.HIGH.

TYPE: StimTriggerHighOrLow | StimTriggerHighOrLowStr

enabled

Whether stimulation is enabled for this channel. Defaults to True.

TYPE: bool

post_trigger_delay

Delay after trigger before stimulation in μs. Defaults to 0.0.

TYPE: float

pulse_or_train

Pulse or train mode. Also accepts string names. Defaults to StimPulseMode.SINGLE_PULSE.

TYPE: StimPulseMode | StimPulseModeStr

number_of_stim_pulses

Number of pulses in a train. Defaults to 1.

TYPE: int

pulse_train_period

Period of pulses in a train in μs. Defaults to 0.0.

TYPE: float

refractory_period

Refractory period in μs. Defaults to 0.0.

TYPE: float

pre_stim_amp_settle

Pre-stimulation amplifier settle time in μs. Defaults to 0.0.

TYPE: float

post_stim_amp_settle

Post-stimulation amplifier settle time in μs. Defaults to 0.0.

TYPE: float

maintain_amp_settle

Whether to maintain amplifier settle. Defaults to False.

TYPE: bool

enable_amp_settle

Whether to enable amplifier settle. Defaults to False.

TYPE: bool

headstage_global_amp_settle

Whether to enable global headstage amp settle. Defaults to False.

TYPE: bool

post_stim_charge_recov_on

Post-stimulation charge recovery on time in μs. Defaults to 0.0.

TYPE: float

post_stim_charge_recov_off

Post-stimulation charge recovery off time in μs. Defaults to 0.0.

TYPE: float

enable_charge_recovery

Whether to enable charge recovery. Defaults to False.

TYPE: bool

trigger_source_is_keypress

Whether the trigger source is a keypress. Defaults to False.

TYPE: bool

trigger_source_idx

A StimKeypressIndex when trigger_source_is_keypress is set, otherwise the system channel index of an AIN or DIN channel. biphasic() sets both fields from one argument.

TYPE: int | StimKeypressIndex

RAISES DESCRIPTION
ValidationError

If trigger_source_idx is a StimKeypressIndex but trigger_source_is_keypress is False.

METHOD DESCRIPTION
biphasic

Create symmetric biphasic stimulation parameters.

Functions

biphasic classmethod
biphasic(
    *,
    amplitude: float,
    pulse_duration: float,
    polarity: StimPolarity,
    stim_sys_chan_idx: int,
    trigger_source_idx: int | StimKeypressIndex,
    enabled: bool = True,
    **overrides: object,
) -> StimParams

Create symmetric biphasic stimulation parameters.

Both phases get the same amplitude and duration. A StimKeypressIndex trigger sets trigger_source_is_keypress; a plain int is an AIN/DIN system channel index.

PARAMETER DESCRIPTION
amplitude

Amplitude of each phase (μA for amplifier channels).

TYPE: float

pulse_duration

Duration of each phase in μs.

TYPE: float

polarity

Which phase comes first.

TYPE: StimPolarity

stim_sys_chan_idx

System channel index.

TYPE: int

trigger_source_idx

Keypress or AIN/DIN system channel that triggers the stimulation.

TYPE: int | StimKeypressIndex

enabled

Whether stimulation is enabled for this channel.

TYPE: bool DEFAULT: True

**overrides

Any other StimParams field.

TYPE: object DEFAULT: {}

StimPolarity

Bases: IntEnum

Stimulation polarity.

StimPulseMode

Bases: IntEnum

Stimulation pulse mode.

StimShape

Bases: IntEnum

Stimulation waveform shape.

StimStep

Bases: IntEnum

Stimulation step size.

StimStepState

Bases: BaseModel

Current stimulation step size setting.

ATTRIBUTE DESCRIPTION
stim_step

Current stimulation step size.

TYPE: StimStep

StimTriggerEdgeOrLevel

Bases: IntEnum

Stimulation trigger edge/level mode.

StimTriggerHighOrLow

Bases: IntEnum

Stimulation trigger high/low.