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 current step size: the current of one DAC step. |
StimStepState |
Current stimulation step size setting. |
StimTriggerEdgeOrLevel |
Stimulation trigger edge/level mode. |
StimTriggerHighOrLow |
Stimulation trigger high/low. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
FlexStimKeypressIndex |
|
Attributes
FlexStimKeypressIndex
module-attribute
FlexStimKeypressIndex = StimKeypressIndex | int
StimKeypressIndex that also accepts a keypress number (1-8).
Classes
StimKeypressIndex
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:
|
stim_shape |
Stimulation waveform shape. Also accepts
string names (e.g.
TYPE:
|
stim_polarity |
Stimulation polarity. Also accepts
string names (e.g.
TYPE:
|
first_phase_duration |
Duration of the first phase in μs. Defaults to 100.0.
TYPE:
|
second_phase_duration |
Duration of the second phase in μs. Defaults to 100.0.
TYPE:
|
interphase_delay |
Delay between phases in μs. Defaults to 0.0.
TYPE:
|
first_phase_amplitude |
Amplitude of the first phase (μA for amp, V for DAC). Defaults to 0.1.
TYPE:
|
second_phase_amplitude |
Amplitude of the second phase (μA for amp, V for DAC). Defaults to 0.0.
TYPE:
|
baseline_voltage |
Baseline voltage in V. Defaults to 0.0.
TYPE:
|
trigger_edge_or_level |
Trigger mode. Also accepts string names. Defaults to StimTriggerEdgeOrLevel.EDGE.
TYPE:
|
trigger_high_or_low |
Trigger polarity. Also accepts string names. Defaults to StimTriggerHighOrLow.HIGH.
TYPE:
|
enabled |
Whether stimulation is enabled for this channel. Defaults to True.
TYPE:
|
post_trigger_delay |
Delay after trigger before stimulation in μs. Defaults to 0.0.
TYPE:
|
pulse_or_train |
Pulse or train mode. Also accepts string names. Defaults to StimPulseMode.SINGLE_PULSE.
TYPE:
|
number_of_stim_pulses |
Number of pulses in a train. Defaults to 1.
TYPE:
|
pulse_train_period |
Period of pulses in a train in μs. Defaults to 0.0.
TYPE:
|
refractory_period |
Refractory period in μs. Defaults to 0.0.
TYPE:
|
pre_stim_amp_settle |
Pre-stimulation amplifier settle time in μs. Defaults to 0.0.
TYPE:
|
post_stim_amp_settle |
Post-stimulation amplifier settle time in μs. Defaults to 0.0.
TYPE:
|
maintain_amp_settle |
Whether to maintain amplifier settle. Defaults to False.
TYPE:
|
enable_amp_settle |
Whether to enable amplifier settle. Defaults to False.
TYPE:
|
headstage_global_amp_settle |
Whether to enable global headstage amp settle. Defaults to False.
TYPE:
|
post_stim_charge_recov_on |
Post-stimulation charge recovery on time in μs. Defaults to 0.0.
TYPE:
|
post_stim_charge_recov_off |
Post-stimulation charge recovery off time in μs. Defaults to 0.0.
TYPE:
|
enable_charge_recovery |
Whether to enable charge recovery. Defaults to False.
TYPE:
|
trigger_source_is_keypress |
Whether the trigger source is a keypress. Defaults to False.
TYPE:
|
trigger_source_idx |
A
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValidationError
|
If |
| 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:
|
pulse_duration
|
Duration of each phase in μs.
TYPE:
|
polarity
|
Which phase comes first.
TYPE:
|
stim_sys_chan_idx
|
System channel index.
TYPE:
|
trigger_source_idx
|
Keypress or AIN/DIN system channel that triggers the stimulation.
TYPE:
|
enabled
|
Whether stimulation is enabled for this channel.
TYPE:
|
**overrides
|
Any other
TYPE:
|
StimPolarity
Bases: IntEnum
Stimulation polarity.
| ATTRIBUTE | DESCRIPTION |
|---|---|
CATHODIC_FIRST |
Negative phase first.
|
ANODIC_FIRST |
Positive phase first.
|
StimPulseMode
Bases: IntEnum
Stimulation pulse mode.
| ATTRIBUTE | DESCRIPTION |
|---|---|
SINGLE_PULSE |
One pulse per trigger.
|
PULSE_TRAIN |
A train of pulses per trigger.
|
StimShape
Bases: IntEnum
Stimulation waveform shape.
| ATTRIBUTE | DESCRIPTION |
|---|---|
BIPHASIC |
Two phases of opposite sign.
|
BIPHASIC_INTERPHASE_DELAY |
Biphasic, with a delay between the phases.
|
TRIPHASIC |
Three phases.
|
MONOPHASIC |
One phase.
|
StimStep
Bases: IntEnum
Stimulation current step size: the current of one DAC step.
| ATTRIBUTE | DESCRIPTION |
|---|---|
STIM_STEP_SIZE_MIN |
The chip's smallest step. Its current is not calibrated.
|
STIM_STEP_SIZE_10_NA |
10 nA.
|
STIM_STEP_SIZE_20_NA |
20 nA.
|
STIM_STEP_SIZE_50_NA |
50 nA.
|
STIM_STEP_SIZE_100_NA |
100 nA.
|
STIM_STEP_SIZE_200_NA |
200 nA.
|
STIM_STEP_SIZE_500_NA |
500 nA.
|
STIM_STEP_SIZE_1_UA |
1 µA.
|
STIM_STEP_SIZE_2_UA |
2 µA.
|
STIM_STEP_SIZE_5_UA |
5 µA.
|
STIM_STEP_SIZE_10_UA |
10 µA.
|
STIM_STEP_SIZE_MAX |
The chip's largest step. Its current is not calibrated.
|
StimStepState
StimTriggerEdgeOrLevel
Bases: IntEnum
Stimulation trigger edge/level mode.
| ATTRIBUTE | DESCRIPTION |
|---|---|
EDGE |
Trigger on a transition of the trigger source.
|
LEVEL |
Trigger while the trigger source holds a level.
|
StimTriggerHighOrLow
Bases: IntEnum
Stimulation trigger high/low.
| ATTRIBUTE | DESCRIPTION |
|---|---|
HIGH |
Rising edge, or high level.
|
LOW |
Falling edge, or low level.
|