Skip to content

radiens_core.models.spikesorter

Spike sorter control and status domain models.

CLASS DESCRIPTION
DashElement

Elements available for the spike sorter dashboard.

InputFeatureType

Feature types used for spike sorting.

SpikeDetectParams

Detection parameters for a single recording channel.

SpikeSorterClustererParams

Parameters for the spike clustering algorithm.

SpikeSorterCommand

Commands for controlling an active spike sorter.

SpikeSorterCriterionLevel

Stringency levels for AI evaluation.

SpikeSorterDashboard

Comprehensive spike sorter dashboard data.

SpikeSorterDashboardGeneral

General summary metrics for the spike sorter dashboard.

SpikeSorterDynamicConfig

Configuration for AI dynamic tracking auto-updates.

SpikeSorterDynamicCriteria

Criteria stringency levels for AI auto-updates.

SpikeSorterDynamicUpdatePeriod

Update periods in seconds for AI auto-updates.

SpikeSorterFeatureParams

Parameters for feature extraction during spike sorting.

SpikeSorterLaunchParams

Parameters for launching a new spike sorter.

SpikeSorterLaunchResult

Result of a spike sorter launch request.

SpikeSorterParamCommand

Commands for updating individual spike sorter detection parameters.

SpikeSorterPhase

Where an offline sort is in its pipeline.

SpikeSorterState

Current state and progress of a spike sorter.

SpikeSorterStateSystem

Overall system state of a spike sorter.

SpikeSorterSubCommand

Sub-commands for spike sorter operations.

SpikeSorterType

Supported spike sorter types.

ATTRIBUTE DESCRIPTION
FlexDashElement

DashElement that also accepts a string name (case-insensitive) or int value.

FlexSpikeSorterCommand

SpikeSorterCommand that also accepts a string name (case-insensitive).

FlexSpikeSorterSubCommand

SpikeSorterSubCommand that also accepts a string name (case-insensitive).

Attributes

FlexDashElement module-attribute

FlexDashElement = DashElement | DashElementStr | int

DashElement that also accepts a string name (case-insensitive) or int value.

FlexSpikeSorterCommand module-attribute

FlexSpikeSorterCommand = SpikeSorterCommand | SpikeSorterCommandStr

SpikeSorterCommand that also accepts a string name (case-insensitive).

FlexSpikeSorterSubCommand module-attribute

FlexSpikeSorterSubCommand = SpikeSorterSubCommand | SpikeSorterSubCommandStr

SpikeSorterSubCommand that also accepts a string name (case-insensitive).

Classes

DashElement

Bases: IntEnum

Elements available for the spike sorter dashboard.

InputFeatureType

Bases: IntEnum

Feature types used for spike sorting.

SpikeDetectParams

Bases: BaseModel

Detection parameters for a single recording channel.

All fields are optional to allow for partial updates.

ATTRIBUTE DESCRIPTION
is_enabled

Whether detection is enabled on this channel.

TYPE: bool | None

ntv_chan_idx

Native channel index (used in return structures, not set via bulk update).

TYPE: int | None

thr

Threshold values in microvolts [neg, pos].

TYPE: list[float] | None

thr_sd

Threshold values in standard deviations [neg, pos].

TYPE: list[float] | None

thr_wdw_pts

thr_wdw in samples. Read-only; update_detect_params() ignores it.

TYPE: list[int] | None

thr_wdw

Spike window around the threshold crossing in seconds [pre, post, total]. update_detect_params() sends only pre and post; the server reports the window with its peak-search margin added.

TYPE: list[float] | None

shadow

Dead time after a detected spike during which no new spike is detected, in seconds.

TYPE: float | None

shadow_pts

shadow in samples. Read-only; update_detect_params() ignores it.

TYPE: int | None

is_set_thr

Whether the detection threshold is armed [neg, pos].

TYPE: list[bool] | None

weak_thr

Artifact-rejection level in microvolts [neg, pos]. When armed, a detected waveform that goes past it is discarded as an artifact.

TYPE: list[float] | None

weak_thr_sd

Artifact-rejection level in noise standard deviations [neg, pos].

TYPE: list[float] | None

is_set_weak_thr

Whether the artifact-rejection level is armed [neg, pos]. Setting a level does not arm it.

TYPE: list[bool] | None

spike_width_sec

[min, max] seconds a detected spike may span at half its peak on its detecting site and still be clustered. One outside the bounds is marked noise and never assigned to a unit. Defaults to [0.00015, 0.002]; the 0.15 ms minimum rejects narrow spikes such as cerebellar ones (about 0.1 ms). Applies with the WFM and WFM_POS feature types; WFM_POS is the default.

TYPE: list[float] | None

SpikeSorterClustererParams

Bases: BaseModel

Parameters for the spike clustering algorithm.

ATTRIBUTE DESCRIPTION
pos_influence_frac

Influence of spike position on clustering.

TYPE: float | None

wfm_shape_influence_frac

Influence of waveform shape on clustering.

TYPE: float | None

eps

Epsilon parameter for DBSCAN-like clustering.

TYPE: float | None

min_pts

Minimum points for a cluster.

TYPE: int | None

disabled

Whether clustering is disabled.

TYPE: bool

SpikeSorterCommand

Bases: IntEnum

Commands for controlling an active spike sorter.

SpikeSorterCriterionLevel

Bases: IntEnum

Stringency levels for AI evaluation.

SpikeSorterDashboard

Bases: BaseModel

Comprehensive spike sorter dashboard data.

ATTRIBUTE DESCRIPTION
enabled_ports

List of hardware ports with active sorting.

TYPE: list[Port]

general

General summary metrics.

TYPE: SpikeSorterDashboardGeneral | None

SpikeSorterDashboardGeneral

Bases: BaseModel

General summary metrics for the spike sorter dashboard.

SpikeSorterDynamicConfig

Bases: BaseModel

Configuration for AI dynamic tracking auto-updates.

ATTRIBUTE DESCRIPTION
is_enabled

Whether dynamic AI tracking is enabled.

TYPE: bool | None

update_period_sec

Schedule for dynamic updates.

TYPE: SpikeSorterDynamicUpdatePeriod | None

criteria

Stringency criteria for updates.

TYPE: SpikeSorterDynamicCriteria | None

SpikeSorterDynamicCriteria

Bases: BaseModel

Criteria stringency levels for AI auto-updates.

SpikeSorterDynamicUpdatePeriod

Bases: BaseModel

Update periods in seconds for AI auto-updates.

SpikeSorterFeatureParams

Bases: BaseModel

Parameters for feature extraction during spike sorting.

ATTRIBUTE DESCRIPTION
num_features

Number of features to extract.

TYPE: int

feature_type

Type of features to extract. Also accepts string names (e.g. "wfm", "spd_pos"). Defaults to WFM_POS, matching the server.

TYPE: InputFeatureType | InputFeatureTypeStr

latent_dim

Latent dimension for feature reduction.

TYPE: int | None

resample_wfm_len

Length to resample waveforms to.

TYPE: int | None

SpikeSorterLaunchParams

Bases: BaseModel

Parameters for launching a new spike sorter.

ATTRIBUTE DESCRIPTION
dsource_id

ID of the data source to sort (required for file sorting).

TYPE: str | None

sub_cmd

Sub-command for the sorting operation. SpikeSorterSubCommand.DETECT_ONLY detects spikes without clustering them into neurons.

TYPE: SpikeSorterSubCommand

clusterer_params

Optional clustering parameters.

TYPE: SpikeSorterClustererParams | None

feature_params

Optional feature extraction parameters.

TYPE: SpikeSorterFeatureParams | None

neighbor_radius_um

Per-site neighbor search radius, in microns. None keeps the dataset's current radius, which an earlier launch may have changed.

TYPE: float | None

max_num_site_neighbors

Cap on the number of neighbors kept per site (closest first). 0 detects on every channel independently, so a threshold crossing is never discarded for being smaller than a neighbor's. None keeps all neighbors within the radius when neighbor_radius_um is set; with both None the current neighborhood is kept.

TYPE: int | None

seed

Root of every random draw the sort makes, recorded in the sort's provenance. None draws one from the clock. Passing the seed a previous sort recorded reproduces that sort, given the same recording, settings and server build. Detect-only sorts record no seed.

TYPE: int | None

SpikeSorterLaunchResult

Bases: BaseModel

Result of a spike sorter launch request.

ATTRIBUTE DESCRIPTION
spike_sorter_id

Unique ID of the launched sorter.

TYPE: str

sorter_type

Type of the launched sorter.

TYPE: SpikeSorterType

msg

Status message from the server.

TYPE: str

SpikeSorterParamCommand

Bases: IntEnum

Commands for updating individual spike sorter detection parameters.

SpikeSorterPhase

Bases: IntEnum

Where an offline sort is in its pipeline.

A streaming sorter's phase has no fixed meaning. UNSPECIFIED is a sort that has not started. FINALIZING covers writing out the result. For a recording still being written, DETECTING and FINALIZING can last until recording stops. Once COMPLETE, the output fileset can be read. Older servers always report UNSPECIFIED.

SpikeSorterState

Bases: BaseModel

Current state and progress of a spike sorter.

ATTRIBUTE DESCRIPTION
sys

Overall system state (ON, OFF, NOT_CONFIGURED).

TYPE: SpikeSorterStateSystem

phase

Which stage of the pipeline an offline sort is in.

TYPE: SpikeSorterPhase

frac_complete

Fraction of the current phase completed (0.0 to 1.0). It returns to 0 at each phase change and reads 1 at the end of training as well as at the end of the sort, so a caller waiting on a sort reads phase, not this.

TYPE: float

is_on

Whether the sorter is currently active.

TYPE: bool

msg

phase as a display string.

TYPE: str

error_msg

Error message if the sorter is in an error state.

TYPE: str

warn_msg

Warning message from the server.

TYPE: str

SpikeSorterStateSystem

Bases: IntEnum

Overall system state of a spike sorter.

SpikeSorterSubCommand

Bases: IntEnum

Sub-commands for spike sorter operations.

SpikeSorterType

Bases: IntEnum

Supported spike sorter types.