radiens_core.videre_client
VidereClient — offline file-based analysis client.
Attributes
Classes
VidereClient
Bases: BaseFileClient
Client for offline file-based analysis.
Auto-discovers a running radiensserver on the local machine.
Usage::
with VidereClient() as client:
meta = client.link_data_file("/path/to/recording.xdat")
sigs = client.get_signals(meta, time_range=[0, 1], signals=[0, 1, 2])
Functions
clear_data_sources
Clear (unlink) data sources from the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dsource_ids
|
list[str] | str
|
List of IDs (or a single ID) to clear. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of successfully cleared IDs. |
copy_data_source_file
Copy a server-side data source file to a new location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src_path
|
str | Path
|
Source file path on the server. |
required |
dest_path
|
str | Path
|
Destination file path on the server. |
required |
force
|
bool
|
If |
False
|
export_data_source
Export a data source to a new file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dsource
|
FlexDataset
|
The data source to export (ID or metadata object). |
required |
dest_path
|
str | Path
|
Destination file path. |
required |
force
|
bool
|
If |
False
|
get_detect_params
Fetch active detection configurations per channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter. |
required |
channels
|
list[int] | None
|
Optional list of native channel indices. If |
None
|
Returns:
| Type | Description |
|---|---|
dict[int, SpikeDetectParams]
|
Map from native channel index to its |
get_dsp_group
Get DSP filter configuration for a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
Returns:
| Type | Description |
|---|---|
DSPGroup
|
The current hardware and software filter parameters. |
get_kpi_metrics
get_kpi_metrics(
dataset,
metrics,
channel_indices=None,
time_range=None,
signal_type=SignalType.AMP,
)
Retrieve computed KPI signal metrics for a linked dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
metrics
|
list[KpiMetricId]
|
List of KPI metric identifiers to retrieve. |
required |
channel_indices
|
list[int] | None
|
Native channel indices (ntvIdxs) to query.
|
None
|
time_range
|
FlexTimeRange | None
|
Time range within the dataset (e.g. |
None
|
signal_type
|
SignalType
|
Signal type to query (default |
AMP
|
Returns:
| Type | Description |
|---|---|
KpiMetricsResult
|
Metric values as a |
Raises:
| Type | Description |
|---|---|
ValueError
|
If lookback time range mode is used (not supported offline). |
RadiensError
|
On communication failure or server error. |
get_kpi_status
Get the current KPI cache status for a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
Returns:
| Type | Description |
|---|---|
KpiStatus
|
Number of packets in cache, packet duration, memory usage, and availability state. |
get_neurons
Retrieve neuron descriptors for a linked dataset.
Returns spike count, rate, SNR, waveform peak amplitude, and probe position for each sorted neuron, organized by recording channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
channels
|
FlexSignalSpec | None
|
Channels to include. Accepts a |
None
|
time_range
|
FlexTimeRange | None
|
Time range within the dataset (e.g. |
None
|
spikes_id
|
str | None
|
Explicit spikes datasource ID. When |
None
|
Returns:
| Type | Description |
|---|---|
NeuronsResult
|
Neuron descriptors grouped by native channel index. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If lookback time range mode is used (not supported offline). |
RadiensError
|
On communication failure or server error. |
get_signals
Retrieve signal data for a specific time range and channel selection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
time_range
|
FlexTimeRange | None
|
Time range specification (e.g. |
None
|
signals
|
FlexSignalSpec | None
|
Signal selection (e.g. list of amplifier channel indices).
|
None
|
Returns:
| Type | Description |
|---|---|
SignalArrays
|
The requested signal data as numpy arrays. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If lookback time range mode is used (not supported offline). |
RadiensError
|
On communication failure or server error. |
get_spike_sorter_dashboard
Get the spike sorter dashboard for monitoring sorting progress.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter to query. |
required |
elements
|
list[DashElement] | None
|
Optional list of dashboard elements to include.
If |
None
|
Returns:
| Type | Description |
|---|---|
SpikeSorterDashboard
|
Comprehensive dashboard data including summary metrics and port status. |
get_spike_sorter_ids
Get the IDs of all active spike sorters for a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of active spike sorter IDs. |
get_spike_sorter_state
Get the current state and progress of a spike sorter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter to query. |
required |
Returns:
| Type | Description |
|---|---|
SpikeSorterState
|
Current state including system status, progress, and messages. |
get_spikes_by_channel
get_spikes_by_channel(
dataset,
channels=None,
time_range=None,
include_waveforms=False,
*,
spikes_id=None,
)
Retrieve spike timestamps and neuron labels per recording channel.
Returns one ChannelSpikeData entry per channel that has spikes in the requested time range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
channels
|
FlexSignalSpec | None
|
Channels to include. Accepts a |
None
|
time_range
|
FlexTimeRange | None
|
Time range within the dataset (e.g. |
None
|
include_waveforms
|
bool
|
If |
False
|
spikes_id
|
str | None
|
Explicit spikes datasource ID. When |
None
|
Returns:
| Type | Description |
|---|---|
dict[int, ChannelSpikeData]
|
Map from native channel index to spike data. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If lookback time range mode is used (not supported offline). |
RadiensError
|
On communication failure or server error. |
get_spikes_by_neuron
get_spikes_by_neuron(
dataset,
channels=None,
time_range=None,
include_waveforms=False,
*,
spikes_id=None,
)
Retrieve spike timestamps per sorted neuron.
Same data as get_spikes_by_channel() but regrouped by neuron identity rather than by channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
channels
|
FlexSignalSpec | None
|
Channels to include. Accepts a |
None
|
time_range
|
FlexTimeRange | None
|
Time range within the dataset (e.g. |
None
|
include_waveforms
|
bool
|
If |
False
|
spikes_id
|
str | None
|
Explicit spikes datasource ID. When |
None
|
Returns:
| Type | Description |
|---|---|
dict[int, NeuronSpikeData]
|
Map from integer neuron label to spike data. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If lookback time range mode is used (not supported offline). |
RadiensError
|
On communication failure or server error. |
get_spikes_spec
Retrieve spike interface metadata for a linked dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to query (metadata object, ID string, or file path). |
required |
spikes_id
|
str | None
|
Explicit spikes datasource ID. When |
None
|
Returns:
| Type | Description |
|---|---|
SpikesSpec
|
Spike metadata including the biointerface ID, enabled channel indices, and spike time range. |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |
healthcheck
Verify the radiensserver is responsive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
service
|
ServiceEndpoint
|
Which gRPC service to probe (default |
RADIENS_LIFECYCLE
|
Raises:
| Type | Description |
|---|---|
RadiensError
|
If the health check fails or the server is unresponsive. |
kpi_calculate
Trigger KPI computation for a linked dataset.
Must be called before get_kpi_metrics returns useful data
on a freshly linked file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to compute KPIs for (metadata object, ID string, or file path). |
required |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |
kpi_clear
Clear the KPI cache for a dataset.
Resets accumulated KPI state. Useful before rerunning with changed parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to clear KPI state for (metadata object, ID string, or file path). |
required |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |
link_data_file
Link a recording file and return its metadata.
Also discovers and registers any associated .spikes file found
alongside the recording. If found, the returned DatasetMetadata will have
associated_spikes_ids populated, enabling the spike data methods on
VidereClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path to the recording file (e.g. |
required |
Returns:
| Type | Description |
|---|---|
DatasetMetadata
|
Metadata for the linked dataset. |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |
list_data_source_ids
List IDs of all currently linked data sources.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of data source IDs. |
list_data_sources
List linked data sources and their metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dsource_ids
|
list[str] | str | None
|
Optional list of specific IDs to query. If |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, DatasetMetadata]
|
Map of data source ID to metadata. |
list_directory
List files in a remote server-side directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directory
|
str | Path
|
Server-side directory path to list. |
required |
Returns:
| Type | Description |
|---|---|
list[FileInfo]
|
Metadata for each file found in the directory. |
move_data_source_file
Move a server-side data source file to a new location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src_path
|
str | Path
|
Source file path on the server. |
required |
dest_path
|
str | Path
|
Destination file path on the server. |
required |
force
|
bool
|
If |
False
|
remove_data_source_file
Remove a server-side data source file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
File path on the server to remove. |
required |
force
|
bool
|
If |
False
|
set_detect_params
Bulk-apply threshold, shadow, and window updates to targeted channels.
Fields in params that are None will not be modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter. |
required |
params
|
SpikeDetectParams
|
The detection parameters to apply. |
required |
channels
|
list[int]
|
List of native channel indices to apply the parameters to. |
required |
set_dsp_group
Update DSP filter configuration for a specific dataset and stage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to update (metadata object, ID string, or file path). |
required |
stage
|
FilterStage
|
The filter stage to update (e.g. |
required |
params
|
list[DSPParams]
|
List of filter parameters for this stage. |
required |
set_kpi_packet_dur
Set the KPI packet duration (integration window) for a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
FlexDataset
|
Dataset to configure (metadata object, ID string, or file path). |
required |
packet_dur
|
float
|
Duration of each KPI packet in seconds. |
required |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |
spike_sorter_cancel
Cancel a running spike sorter.
Sends an OFF command. After this call, the server removes the sorter
immediately — subsequent calls to get_spike_sorter_state or
get_spike_sorter_dashboard with the same ID will raise
ServerCommunicationError ("not found"). Use
spike_sorter_delete() afterward only if auto-cleanup did not occur.
Equivalent to spike_sorter_command(id, SpikeSorterCommand.OFF).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter to cancel. |
required |
spike_sorter_command
Send a command to a running spike sorter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter to control. |
required |
cmd
|
SpikeSorterCommand
|
The command to execute (e.g., OFF, REBASE, CLEAR_SORT). |
required |
sub_cmd
|
SpikeSorterSubCommand
|
Optional sub-command modifier. |
NULL
|
spike_sorter_delete
Delete a spike sorter and release its resources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spike_sorter_id
|
str
|
Unique ID of the spike sorter to delete. |
required |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |
spike_sorter_launch
Launch a new spike sorter on a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
SpikeSorterLaunchParams
|
Parameters for the sorter launch, including the target dataset ID, optional clustering/feature parameters, and noise discovery settings. |
required |
Returns:
| Type | Description |
|---|---|
SpikeSorterLaunchResult
|
The unique ID and type of the launched sorter. |
Raises:
| Type | Description |
|---|---|
RadiensError
|
On communication failure or server error. |