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, from least to most strict. |
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 |
|
FlexSpikeSorterCommand |
|
FlexSpikeSorterSubCommand |
|
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.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ENABLED_PORTS |
Ports the sorter is enabled on.
|
GENERAL |
Sorter-wide summary.
|
PORT_STATS |
Per-port statistics.
|
SITE_STATS |
Per-site statistics.
|
SITE_PANEL |
Per-site panel data.
|
NEURON_STATS |
Per-neuron statistics.
|
NEURON_PANEL |
Per-neuron panel data.
|
AI |
AI tracking state.
|
InputFeatureType
Bases: IntEnum
Feature types used for spike sorting.
SPD and SPD_POS are not supported at the moment.
| ATTRIBUTE | DESCRIPTION |
|---|---|
WFM |
Spike waveform.
|
SPD |
Shape, phase and distribution features.
|
WFM_POS |
Waveform plus site position.
|
SPD_POS |
Shape, phase and distribution features plus site position.
|
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:
|
ntv_chan_idx |
Native channel index (used in return structures, not set via bulk update).
TYPE:
|
thr |
Threshold values in microvolts |
thr_sd |
Threshold values in standard deviations |
thr_wdw_pts |
|
thr_wdw |
Spike window around the threshold crossing in seconds
|
shadow |
Dead time after a detected spike during which no new spike is detected, in seconds.
TYPE:
|
shadow_pts |
TYPE:
|
is_set_thr |
Whether the detection threshold is armed |
weak_thr |
Artifact-rejection level in microvolts |
weak_thr_sd |
Artifact-rejection level in noise standard deviations |
is_set_weak_thr |
Whether the artifact-rejection level is armed |
spike_width_sec |
|
SpikeSorterClustererParams
Bases: BaseModel
Parameters for the spike clustering algorithm.
| ATTRIBUTE | DESCRIPTION |
|---|---|
pos_influence_frac |
Influence of spike position on clustering.
TYPE:
|
wfm_shape_influence_frac |
Influence of waveform shape on clustering.
TYPE:
|
eps |
Epsilon parameter for DBSCAN-like clustering.
TYPE:
|
min_pts |
Minimum points for a cluster.
TYPE:
|
disabled |
Whether clustering is disabled.
TYPE:
|
SpikeSorterCommand
Bases: IntEnum
Commands for controlling an active spike sorter.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ON |
Start sorting.
|
OFF |
Stop sorting.
|
CLEAR_SORT |
Discard the sorter's spikes.
|
REBASE |
Stop, discard the spikes, apply new feature and clusterer parameters, and start again.
|
INIT |
Stop, discard the spikes, reset detection parameters to defaults and rebuild the site neighborhoods. A sorter that was running is started again.
|
SpikeSorterCriterionLevel
Bases: IntEnum
Stringency levels for AI evaluation, from least to most strict.
| ATTRIBUTE | DESCRIPTION |
|---|---|
LEAST |
Least strict.
|
LESS |
Less strict than balanced.
|
BALANCED |
The middle level.
|
MORE |
More strict than balanced.
|
MOST |
Most strict.
|
SpikeSorterDashboard
Bases: BaseModel
Comprehensive spike sorter dashboard data.
| ATTRIBUTE | DESCRIPTION |
|---|---|
enabled_ports |
List of hardware ports with active sorting. |
general |
General summary metrics.
TYPE:
|
SpikeSorterDashboardGeneral
SpikeSorterDynamicConfig
Bases: BaseModel
Configuration for AI dynamic tracking auto-updates.
| ATTRIBUTE | DESCRIPTION |
|---|---|
is_enabled |
Whether dynamic AI tracking is enabled.
TYPE:
|
update_period_sec |
Schedule for dynamic updates.
TYPE:
|
criteria |
Stringency criteria for updates.
TYPE:
|
SpikeSorterDynamicCriteria
SpikeSorterDynamicUpdatePeriod
SpikeSorterFeatureParams
Bases: BaseModel
Parameters for feature extraction during spike sorting.
| ATTRIBUTE | DESCRIPTION |
|---|---|
num_features |
Number of features to extract.
TYPE:
|
feature_type |
Type of features to extract:
TYPE:
|
latent_dim |
Latent dimension for feature reduction.
TYPE:
|
resample_wfm_len |
Length to resample waveforms to.
TYPE:
|
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:
|
sub_cmd |
Sub-command for the sorting operation.
TYPE:
|
clusterer_params |
Optional clustering parameters.
TYPE:
|
feature_params |
Optional feature extraction parameters, with the same
TYPE:
|
neighbor_radius_um |
Per-site neighbor search radius, in microns.
TYPE:
|
max_num_site_neighbors |
Cap on the number of neighbors kept per site
(closest first).
TYPE:
|
seed |
Root of every random draw the sort makes, recorded in the sort's
provenance.
TYPE:
|
SpikeSorterLaunchResult
Bases: BaseModel
Result of a spike sorter launch request.
| ATTRIBUTE | DESCRIPTION |
|---|---|
spike_sorter_id |
Unique ID of the launched sorter.
TYPE:
|
sorter_type |
Type of the launched sorter.
TYPE:
|
msg |
Status message from the server.
TYPE:
|
SpikeSorterParamCommand
Bases: IntEnum
Commands for updating individual spike sorter detection parameters.
update_detect_params() sends these for you, one per SpikeDetectParams field set.
| ATTRIBUTE | DESCRIPTION |
|---|---|
THR_LEVEL |
Sets
|
THR_LEVEL_SD |
Sets
|
THR_WDW |
Sets
|
WEAK_THR_LEVEL |
Sets
|
WEAK_THR_LEVEL_SD |
Sets
|
SHADOW |
Sets
|
THR_ACTIVATE |
Sets
|
WEAK_THR_ACTIVATE |
Sets
|
SPIKE_WIDTH |
Sets
|
SpikeSorterPhase
Bases: IntEnum
Where an offline sort is in its pipeline.
A streaming sorter's phase has no fixed meaning. For a recording still being written,
DETECTING and FINALIZING can last until recording stops. Older servers always
report UNSPECIFIED.
| ATTRIBUTE | DESCRIPTION |
|---|---|
UNSPECIFIED |
The sort has not started.
|
DETECTING |
Detecting spikes.
|
TRAINING |
Training the sorter on the detected spikes.
|
SORTING |
Clustering spikes into units.
|
FINALIZING |
Writing out the result.
|
COMPLETE |
Done. The output fileset can be read.
|
SpikeSorterState
Bases: BaseModel
Current state and progress of a spike sorter.
| ATTRIBUTE | DESCRIPTION |
|---|---|
sys |
Overall system state (ON, OFF, NOT_CONFIGURED).
TYPE:
|
phase |
Which stage of the pipeline an offline sort is in.
TYPE:
|
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
TYPE:
|
is_on |
Whether the sorter is currently active.
TYPE:
|
msg |
TYPE:
|
error_msg |
Error message if the sorter is in an error state.
TYPE:
|
warn_msg |
Warning message from the server.
TYPE:
|
SpikeSorterStateSystem
Bases: IntEnum
Overall system state of a spike sorter.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ON |
Running.
|
OFF |
Stopped.
|
NOT_CONFIGURED |
Not set up yet.
|
SpikeSorterSubCommand
Bases: IntEnum
Sub-commands for spike sorter operations.
| ATTRIBUTE | DESCRIPTION |
|---|---|
NULL |
Full sorting, with clustering.
|
DETECT_ONLY |
Detect spikes without clustering them.
|
SpikeSorterType
Bases: IntEnum
Supported spike sorter types.
| ATTRIBUTE | DESCRIPTION |
|---|---|
NULL |
No sorter.
|
VEX_STREAM |
Sorts a live stream in Allego.
|
SPIKES_STREAM |
Not produced by current servers.
|
VEX_FILE |
Sorts a recording's signals.
|
SPIKES_FILE |
Sorts the spikes in a spikes fileset.
|