radiens_core.curate_client
Deprecated alias for VidereClient; removed in 0.1.0.
Classes
CurateClient
Bases: VidereClient
Deprecated alias for VidereClient.
Deprecated
Replace CurateClient() with VidereClient(), which has every transform and
curation method. Removed in 0.1.0.
| METHOD | DESCRIPTION |
|---|---|
apply_protocol |
Run a protocol registered with |
bandpass |
Apply a band-pass filter to a dataset. |
bandstop |
Apply a band-stop (band-reject) filter to a dataset. |
bulk_bandpass |
Apply band-pass filter to multiple datasets at once. |
bulk_bandstop |
Apply band-stop filter to multiple datasets at once. |
bulk_downsample |
Downsample multiple datasets at once. |
bulk_highpass |
Apply high-pass filter to multiple datasets at once. |
bulk_lowpass |
Apply low-pass filter to multiple datasets at once. |
bulk_notch |
Apply notch filter to multiple datasets at once. |
bulk_slice_time |
Slice multiple datasets in time at once. |
car |
Apply Common Average Reference (CAR) re-referencing to a dataset. |
clear_data_sources |
Clear (unlink) data sources from the server. |
close |
Close the client's server connections. |
copy_data_source_file |
Copy a server-side data source file to a new location. |
deselect_channels |
Remove signals from a dataset's selection, leaving the rest untouched. |
downsample |
Downsample a dataset. |
export_data_source |
Copy a data source to a new file in the same format. |
get_all_protocols |
List all saved protocols on the server. |
get_batch_spectral |
Compute spectral analyses for multiple independent requests in one call. |
get_channel_metadata |
Get a dataset's current channel metadata. |
get_detect_params |
Fetch active detection configurations per channel. |
get_dsp_group |
Get DSP filter configuration for a dataset. |
get_kpi_bundle_stats |
Retrieve cross-channel KPI summaries over time for a linked dataset. |
get_kpi_metrics |
Retrieve computed KPI signal metrics for a linked dataset. |
get_kpi_metrics_series |
Retrieve a per-channel KPI metric timeseries for a linked dataset. |
get_kpi_status |
Get the current KPI computation status for a dataset. |
get_neurons |
Retrieve neuron descriptors for a linked dataset. |
get_protocol |
Retrieve a saved protocol by ID. |
get_provenance |
Get the record of how a dataset came to be. |
get_signals |
Retrieve signal data for a specific time range and channel selection. |
get_spectral |
Compute a spectral analysis (periodogram, Welch, or STFT) for a dataset. |
get_spectral_info |
Preview the spectral parameters a request would produce, without reading signal data. |
get_spike_sorter_dashboard |
Get the spike sorter dashboard for monitoring sorting progress. |
get_spike_sorter_ids |
Get the IDs of the spikes filesets registered for a dataset. |
get_spike_sorter_state |
Get the current state and progress of a spike sorter. |
get_spikes_by_channel |
Retrieve spike timestamps per recording channel. |
get_spikes_by_neuron |
Retrieve spike timestamps per sorted neuron. |
get_spikes_ids |
Get the IDs of the spikes filesets registered for a dataset. |
get_spikes_spec |
Retrieve the metadata of a dataset's spikes fileset. |
get_tailing_state |
Report whether a dataset's recording is still growing, and how much of it exists. |
get_units |
List the sorted cells in a fileset, merging each cell's per-site listings. |
healthcheck |
Verify the server is responsive. |
highpass |
Apply a high-pass filter to a dataset. |
kpi_calculate |
Compute KPI for a dataset and wait until it is ready. |
kpi_clear |
Discard all computed KPI for a dataset, including results cached on disk. |
link_data_file |
Link a recording file and return its metadata. |
list_data_source_ids |
List IDs of all currently linked data sources. |
list_data_sources |
List linked data sources and their metadata. |
list_directory |
List files in a remote server-side directory. |
lowpass |
Apply a low-pass filter to a dataset. |
move_data_source_file |
Move a server-side data source file to a new location. |
notch |
Apply a notch filter to a dataset. |
paired_ref |
Apply paired re-referencing between two specific channels. |
remove_data_source_file |
Remove a server-side data source file. |
select_channels |
Add signals to a dataset's selection, leaving the rest selected. |
set_channel_groups |
Make a dataset's color groups exactly groups, discarding existing ones. |
set_detect_params |
Update detection parameters on the given channels. |
set_dsp_group |
Replace a dataset's stage-2 filters. |
set_kpi_packet_dur |
Set the KPI packet duration for a dataset. |
set_protocol |
Register a custom protocol with the server. |
set_selected_channels |
Make a dataset's channel selection exactly signals. |
slice_channels |
Select a subset of channels from a dataset. |
slice_time |
Slice a dataset in time. |
spike_sort |
Sort an offline recording and return the id of the fileset it wrote, once readable. |
spike_sorter_cancel |
Cancel a running spike sorter. |
spike_sorter_command |
Send a command to a running spike sorter. |
spike_sorter_delete |
Delete a spike sorter and release its resources. |
spike_sorter_launch |
Launch a new spike sorter on a dataset. |
update_detect_params |
Update detection thresholds, shadow, window and spike width on the given channels. |
virtual_ref |
Apply virtual reference re-referencing to a dataset. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
server_version |
Connected server version as
TYPE:
|
Attributes
server_version
property
Connected server version as (major, minor, patch).
A development build reports (inf, inf, inf).
Functions
apply_protocol
apply_protocol(protocol_id: str) -> None
Run a protocol registered with set_protocol().
Outputs are not linked; link them with link_data_file().
| PARAMETER | DESCRIPTION |
|---|---|
protocol_id
|
The ID of a protocol already registered with the server
(e.g.
TYPE:
|
bandpass
bandpass(
dataset: FlexDataset,
low_freq: float,
high_freq: float,
output_path: str | Path,
*,
order: int | None = None,
) -> DatasetMetadata
Apply a band-pass filter to a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to filter (metadata object, ID string, or file path).
TYPE:
|
low_freq
|
Lower cutoff frequency in Hz.
TYPE:
|
high_freq
|
Upper cutoff frequency in Hz.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
order
|
Filter order. If
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (filtered) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
bandstop
bandstop(
dataset: FlexDataset,
low_freq: float,
high_freq: float,
output_path: str | Path,
*,
order: int | None = None,
) -> DatasetMetadata
Apply a band-stop (band-reject) filter to a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to filter (metadata object, ID string, or file path).
TYPE:
|
low_freq
|
Lower cutoff frequency in Hz.
TYPE:
|
high_freq
|
Upper cutoff frequency in Hz.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
order
|
Filter order. If
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (filtered) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
bulk_bandpass
bulk_bandpass(
sources: Sequence[FlexDataset],
low_freq: float,
high_freq: float,
output_dir: str | Path,
output_suffix: str,
*,
order: int | None = None,
) -> None
Apply band-pass filter to multiple datasets at once.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to filter (metadata objects, ID strings, or file paths).
TYPE:
|
low_freq
|
Lower cutoff frequency in Hz.
TYPE:
|
high_freq
|
Upper cutoff frequency in Hz.
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
order
|
Filter order. If
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty. |
bulk_bandstop
bulk_bandstop(
sources: Sequence[FlexDataset],
low_freq: float,
high_freq: float,
output_dir: str | Path,
output_suffix: str,
*,
order: int | None = None,
) -> None
Apply band-stop filter to multiple datasets at once.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to filter (metadata objects, ID strings, or file paths).
TYPE:
|
low_freq
|
Lower cutoff frequency in Hz.
TYPE:
|
high_freq
|
Upper cutoff frequency in Hz.
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
order
|
Filter order. If
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty. |
bulk_downsample
bulk_downsample(
sources: Sequence[FlexDataset],
factor: int,
output_dir: str | Path,
output_suffix: str,
) -> None
Downsample multiple datasets at once.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
The signal is not low-pass filtered first; apply bulk_lowpass() beforehand to
avoid aliasing.
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to downsample (metadata objects, ID strings, or file paths).
TYPE:
|
factor
|
Downsampling factor (e.g., 2, 4, 10).
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty. |
bulk_highpass
bulk_highpass(
sources: Sequence[FlexDataset],
frequency: float,
output_dir: str | Path,
output_suffix: str,
*,
order: int | None = None,
) -> None
Apply high-pass filter to multiple datasets at once.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to filter (metadata objects, ID strings, or file paths).
TYPE:
|
frequency
|
Cutoff frequency in Hz.
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
order
|
Filter order. If
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty. |
bulk_lowpass
bulk_lowpass(
sources: Sequence[FlexDataset],
frequency: float,
output_dir: str | Path,
output_suffix: str,
*,
order: int | None = None,
) -> None
Apply low-pass filter to multiple datasets at once.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to filter (metadata objects, ID strings, or file paths).
TYPE:
|
frequency
|
Cutoff frequency in Hz.
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
order
|
Filter order. If
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty. |
bulk_notch
bulk_notch(
sources: Sequence[FlexDataset],
frequency: float,
bandwidth: float,
output_dir: str | Path,
output_suffix: str,
) -> None
Apply notch filter to multiple datasets at once.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
The notch filter is always second-order, so it takes no order.
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to filter (metadata objects, ID strings, or file paths).
TYPE:
|
frequency
|
Center frequency to reject in Hz. Also accepted as the deprecated
TYPE:
|
bandwidth
|
Width of the rejection band in Hz. Must be positive.
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty, or bandwidth is not positive. |
bulk_slice_time
bulk_slice_time(
sources: Sequence[FlexDataset],
start_sec: float,
end_sec: float,
output_dir: str | Path,
output_suffix: str,
) -> None
Slice multiple datasets in time at once.
The same times apply to every source, so each must cover them.
Outputs are written in the first source's file format and are not linked; link them
with link_data_file().
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
Datasets to slice (metadata objects, ID strings, or file paths).
TYPE:
|
start_sec
|
Start, in seconds of stream time.
TYPE:
|
end_sec
|
End, in seconds of stream time.
TYPE:
|
output_dir
|
Directory where output files will be written. |
output_suffix
|
Appended to each input's base name after an underscore to name its output.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If sources is empty. |
car
car(dataset: FlexDataset, output_path: str | Path) -> DatasetMetadata
Apply Common Average Reference (CAR) re-referencing to a dataset.
Subtracts the mean signal across all channels from each channel.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to re-reference (metadata object, ID string, or file path).
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (re-referenced) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
clear_data_sources
copy_data_source_file
copy_data_source_file(
src_path: str | Path, dest_path: str | Path, *, force: bool = False
) -> None
Copy a server-side data source file to a new location.
| PARAMETER | DESCRIPTION |
|---|---|
src_path
|
Source file path on the server. |
dest_path
|
Destination file path on the server. Must have the same file type as the source. |
force
|
If
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a path's suffix does not match a known file type. |
deselect_channels
deselect_channels(dataset: FlexDataset, signals: FlexSignalSpec) -> DatasetMetadata
Remove signals from a dataset's selection, leaving the rest untouched.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to update (metadata object, ID string, or file path).
TYPE:
|
signals
|
Channels to deselect. Same forms as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Refreshed dataset metadata carrying the new selection. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If an index is not present in the dataset. |
RadiensError
|
On communication failure or server error. |
downsample
downsample(
dataset: FlexDataset, factor: int, output_path: str | Path
) -> DatasetMetadata
Downsample a dataset.
The signal is not low-pass filtered first; apply lowpass() beforehand to avoid
aliasing.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to downsample (metadata object, ID string, or file path).
TYPE:
|
factor
|
Downsampling factor (e.g., 2, 4, 10).
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (downsampled) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
export_data_source
export_data_source(
dsource: FlexDataset, dest_path: str | Path, force: bool = False
) -> None
Copy a data source to a new file in the same format.
The suffix of dest_path is ignored; the output keeps the source's file type.
| PARAMETER | DESCRIPTION |
|---|---|
dsource
|
The data source to export (metadata object, ID string, or file path).
TYPE:
|
dest_path
|
Destination file path. |
force
|
If
TYPE:
|
get_all_protocols
get_all_protocols() -> list[ProtocolSpec]
List all saved protocols on the server.
| RETURNS | DESCRIPTION |
|---|---|
list[ProtocolSpec]
|
Summary of every protocol currently registered. |
get_batch_spectral
get_batch_spectral(
items: Sequence[tuple[FlexDataset, SpectralQuery]],
) -> BatchSpectralResult
Compute spectral analyses for multiple independent requests in one call.
Faster than repeated get_spectral() calls, which cost one round trip each.
| PARAMETER | DESCRIPTION |
|---|---|
items
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
BatchSpectralResult
|
One |
| RAISES | DESCRIPTION |
|---|---|
RadiensError
|
On communication failure or server error. |
get_channel_metadata
get_channel_metadata(dataset: FlexDataset) -> ChannelMetadata
Get a dataset's current channel metadata.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ChannelMetadata
|
Channel configuration including selection state, probe geometry, and color group assignments. |
| RAISES | DESCRIPTION |
|---|---|
RadiensError
|
On communication failure or server error. |
get_detect_params
get_detect_params(
spike_sorter_id: str, channels: list[int] | None = None
) -> dict[int, SpikeDetectParams]
Fetch active detection configurations per channel.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
ID of a running spike sorter, or a dataset ID to read the dataset's own settings.
TYPE:
|
channels
|
Optional list of native channel indices. If |
| RETURNS | DESCRIPTION |
|---|---|
dict[int, SpikeDetectParams]
|
Map from native channel index to its |
get_dsp_group
get_dsp_group(dataset: FlexDataset) -> DSPGroup
Get DSP filter configuration for a dataset.
A recording opens with the stage-2 chain that was in force when recording started.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DSPGroup
|
The current hardware and software filter parameters. |
get_kpi_bundle_stats
get_kpi_bundle_stats(
dataset: FlexDataset,
stats: list[FlexBundleStatId],
window_dur_sec: float | None,
channel_indices: list[int] | None = None,
time_range: FlexTimeRange | None = None,
signal_type: FlexSignalType = AMP,
) -> KpiBundleStatsResult
Retrieve cross-channel KPI summaries over time for a linked dataset.
Each requested stat is a per-channel metric collapsed across the
selected channels — for example ("rms", "mean") is the average RMS
over the probe, and ("snr", "count") is the number of channels with
detected events (channel yield). The per-channel matrix is never returned;
use get_kpi_metrics_series() for that.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
stats
|
Bundle stats to compute. Accepts
TYPE:
|
window_dur_sec
|
Target bin width in seconds. Window boundaries snap to
the KPI packet duration, so read each window's bounds from the result
rather than assuming
TYPE:
|
channel_indices
|
Native channel indices forming the
channel population. |
time_range
|
Range to read; see
TYPE:
|
signal_type
|
Signal type to query. Accepts
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
KpiBundleStatsResult
|
Time-ordered windows, each holding one value per requested stat. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
TimeRangeError
|
If the range falls outside the dataset, or KPI has not yet been
computed over it; see |
SignalSelectionError
|
If a requested channel index is not in the dataset. |
ValueError
|
If time_range is a lookback. |
RadiensError
|
On communication failure or server error. |
get_kpi_metrics
get_kpi_metrics(
dataset: FlexDataset,
metrics: list[FlexKpiMetricId],
channel_indices: list[int] | None = None,
time_range: FlexTimeRange | None = None,
signal_type: FlexSignalType = AMP,
*,
service_mode: FlexKpiServiceMode = RANGE,
stream_lookback_sec: float | None = None,
) -> KpiMetricsResult
Retrieve computed KPI signal metrics for a linked dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
metrics
|
List of KPI metric identifiers. Accepts
TYPE:
|
channel_indices
|
Native channel indices to query.
|
time_range
|
Range to read; see
TYPE:
|
signal_type
|
Signal type to query. Accepts
TYPE:
|
service_mode
|
Which answering mode to use.
TYPE:
|
stream_lookback_sec
|
Moving-average window in seconds. Used only when
service_mode is
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
KpiMetricsResult
|
One value per channel and metric, labeled with the channel of each row and the
metric of each column; see |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
TimeRangeError
|
If the range falls outside the dataset, or KPI has not yet been
computed over it; see |
SignalSelectionError
|
If a requested channel index is not in the dataset. |
ValueError
|
If time_range is a lookback. |
RadiensError
|
On communication failure or server error. |
get_kpi_metrics_series
get_kpi_metrics_series(
dataset: FlexDataset,
metrics: list[FlexKpiMetricId],
window_dur_sec: float | None,
channel_indices: list[int] | None = None,
time_range: FlexTimeRange | None = None,
signal_type: FlexSignalType = AMP,
) -> KpiMetricsSeriesResult
Retrieve a per-channel KPI metric timeseries for a linked dataset.
Returns one (n_channels, n_metrics) snapshot per time window, each
aggregating exactly the KPI packets in that window. Use this instead of
repeated get_kpi_metrics() calls to track metrics over a recording.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
metrics
|
List of KPI metric identifiers. Accepts
TYPE:
|
window_dur_sec
|
Target bin width in seconds. Window boundaries snap to
the KPI packet duration, so read each window's bounds from the result
rather than assuming
TYPE:
|
channel_indices
|
Native channel indices to query.
|
time_range
|
Range to read; see
TYPE:
|
signal_type
|
Signal type to query. Accepts
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
KpiMetricsSeriesResult
|
Time-ordered windows sharing one channel/metric ordering. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
TimeRangeError
|
If the range falls outside the dataset, or KPI has not yet been
computed over it; see |
SignalSelectionError
|
If a requested channel index is not in the dataset. |
ValueError
|
If time_range is a lookback. |
RadiensError
|
On communication failure or server error. |
get_kpi_status
get_kpi_status(dataset: FlexDataset) -> KpiStatus
Get the current KPI computation status for a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
KpiStatus
|
The KPI computation status; see |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
RadiensError
|
On communication failure or server error. |
get_neurons
get_neurons(
dataset: FlexDataset,
channels: FlexSignalSpec | None = None,
time_range: FlexTimeRange | None = None,
*,
spikes_id: str | None = None,
) -> NeuronsResult
Retrieve neuron descriptors for a linked dataset.
Returns spike count, rate, SNR, waveform peak amplitude, and probe position per
site. A cell appears under every site that recorded it, and the unclustered
(0) and bad/delete bins are included; use get_units() for one entry
per cell.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
channels
|
Channels to include. Accepts a
TYPE:
|
time_range
|
Range to read; see
TYPE:
|
spikes_id
|
ID of the spikes fileset to read.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NeuronsResult
|
Neuron descriptors grouped by native channel index. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a channel index is not in the dataset, or time_range is a lookback. |
RadiensError
|
If spikes_id is not given and the dataset has no spikes fileset, or on communication failure or server error. |
get_protocol
get_protocol(protocol_id: str) -> ProtocolSpec
Retrieve a saved protocol by ID.
| PARAMETER | DESCRIPTION |
|---|---|
protocol_id
|
ID of the protocol to retrieve.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ProtocolSpec
|
Minimal summary of the protocol. |
get_provenance
get_provenance(dataset: FlexDataset) -> Provenance
Get the record of how a dataset came to be.
The record lists, in order, every operation that shaped the dataset's samples: filters,
decimations, channel and time slices, sensor remaps, and the detect, measure and sort
steps that produced a derived fileset. A sort operation carries its seed, which
SpikeSorterLaunchParams.seed accepts to reproduce the sort on a server that supports
seeded sorts.
The stage-2 chain in force when recording started is returned separately. It is a display setting and did not alter the recorded samples.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Provenance
|
The record and the stage-2 chain. A dataset written before records existed gets a record reconstructed from its older metadata and has no stage-2 chain. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server is too old to support this method. |
RadiensError
|
On communication failure or server error. |
get_signals
get_signals(
dataset: FlexDataset,
time_range: FlexTimeRange | None = None,
signals: FlexSignalSpec | None = None,
*,
apply_dsp: bool = False,
) -> SignalArrays
Retrieve signal data for a specific time range and channel selection.
Warning
With apply_dsp set, only selected channels can be read: asking for an
unselected one raises ServerCommunicationError, and so does
signals=None whenever any channel is deselected. Pass
{"amp": "selected"}, or select more channels first with
set_selected_channels().
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
time_range
|
Range to read; see
TYPE:
|
signals
|
Signal selection (e.g. list of amplifier channel indices), or
TYPE:
|
apply_dsp
|
Return the signal filtered by the dataset's current stage-2 DSP
group, which KPI metrics are computed through and a newly launched sort
detects on.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SignalArrays
|
The requested signal data as numpy arrays. Its |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a channel index is not in the dataset, or, with an older server, the range ends before the dataset starts. |
CapabilityError
|
If |
RadiensError
|
On communication failure or server error. |
get_spectral
get_spectral(dataset: FlexDataset, query: SpectralQuery) -> SpectralResult
Compute a spectral analysis (periodogram, Welch, or STFT) for a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
query
|
Channels, alignment windows, algorithm, and units to compute.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SpectralResult
|
Frequency (and, for |
| RAISES | DESCRIPTION |
|---|---|
RadiensError
|
On communication failure or server error. |
get_spectral_info
get_spectral_info(
*,
fs: float,
duration_sec: float,
num_channels: int,
query: SpectralQuery,
dataset: FlexDataset | None = None,
) -> SpectralInfoResult
Preview the spectral parameters a request would produce, without reading signal data.
| PARAMETER | DESCRIPTION |
|---|---|
fs
|
Sampling rate, in Hz.
TYPE:
|
duration_sec
|
Signal duration to preview against, in seconds.
TYPE:
|
num_channels
|
Number of channels to preview against.
TYPE:
|
query
|
Algorithm, window, and frequency-range settings to preview.
TYPE:
|
dataset
|
Dataset whose stage-2 chain fills
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SpectralInfoResult
|
Achieved frequency/time resolution, algorithm-specific parameters, output shape, and an estimated memory footprint. |
| RAISES | DESCRIPTION |
|---|---|
RadiensError
|
On communication failure or server error. |
get_spike_sorter_dashboard
get_spike_sorter_dashboard(
spike_sorter_id: str, elements: list[FlexDashElement] | None = None
) -> SpikeSorterDashboard
Get the spike sorter dashboard for monitoring sorting progress.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
Unique ID of the spike sorter to query.
TYPE:
|
elements
|
Optional list of dashboard elements to include. Each element
can be a
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SpikeSorterDashboard
|
Dashboard data for the requested elements. |
get_spike_sorter_ids
get_spike_sorter_ids(dataset: FlexDataset) -> list[str]
Get the IDs of the spikes filesets registered for a dataset.
Deprecated
Use get_spikes_ids() instead. This returns spikes fileset IDs, not spike
sorter IDs.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
get_spike_sorter_state
get_spike_sorter_state(spike_sorter_id: str) -> SpikeSorterState
Get the current state and progress of a spike sorter.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
Unique ID of the spike sorter to query.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SpikeSorterState
|
Current state including system status, progress, and messages. |
get_spikes_by_channel
get_spikes_by_channel(
dataset: FlexDataset,
channels: FlexSignalSpec | None = None,
time_range: FlexTimeRange | None = None,
include_waveforms: bool = False,
*,
spikes_id: str | None = None,
) -> dict[int, ChannelSpikeData]
Retrieve spike timestamps per recording channel.
Returns one ChannelSpikeData entry per channel that has spikes in the requested time range.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
channels
|
Channels to include. Accepts a
TYPE:
|
time_range
|
Range to read; see
TYPE:
|
include_waveforms
|
If
TYPE:
|
spikes_id
|
ID of the spikes fileset to read.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[int, ChannelSpikeData]
|
Map from native channel index to spike data. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a channel index is not in the dataset, or time_range is a lookback. |
RadiensError
|
If spikes_id is not given and the dataset has no spikes fileset, or on communication failure or server error. |
get_spikes_by_neuron
get_spikes_by_neuron(
dataset: FlexDataset,
channels: FlexSignalSpec | None = None,
time_range: FlexTimeRange | None = None,
include_waveforms: bool = False,
*,
spikes_id: str | None = None,
) -> dict[int, NeuronSpikeData]
Retrieve spike timestamps per sorted neuron.
Same data as get_spikes_by_channel() but regrouped by neuron identity rather than by channel.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
channels
|
Channels to include. Accepts a
TYPE:
|
time_range
|
Range to read; see
TYPE:
|
include_waveforms
|
If
TYPE:
|
spikes_id
|
ID of the spikes fileset to read.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[int, NeuronSpikeData]
|
Map from integer neuron label to spike data. Labels are unique within a probe, so on a multi-probe recording units sharing a label are merged. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If |
ValueError
|
If a channel index is not in the dataset, or time_range is a lookback. |
RadiensError
|
If spikes_id is not given and the dataset has no spikes fileset, or on communication failure or server error. |
get_spikes_ids
get_spikes_ids(dataset: FlexDataset) -> list[str]
Get the IDs of the spikes filesets registered for a dataset.
The same list as DatasetMetadata.associated_spikes_ids. A sort still
running is not listed.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[str]
|
List of spikes fileset IDs. |
get_spikes_spec
get_spikes_spec(dataset: FlexDataset, *, spikes_id: str | None = None) -> SpikesSpec
Retrieve the metadata of a dataset's spikes fileset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
spikes_id
|
ID of the spikes fileset to read.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SpikesSpec
|
The fileset's ID, neuron count, enabled channels, detection settings and the time range its spikes cover. |
| RAISES | DESCRIPTION |
|---|---|
RadiensError
|
If spikes_id is not given and the dataset has no spikes fileset, or on communication failure or server error. |
get_tailing_state
get_tailing_state(dataset: FlexDataset) -> TailingState
Report whether a dataset's recording is still growing, and how much of it exists.
The returned available_time_range is the recording's current extent;
DatasetMetadata.time_range keeps the extent from when the server first loaded it.
With a recent Radiens server, reads with an open range, such as get_signals(dsid),
follow the current extent.
KPI follows the growing file from the first call that sees it LIVE. If the
recording was linked before it started, call this again once it is live. Requires a
license that includes live monitoring.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
TailingState
|
The recording verdict and the extent available at call time. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server is too old to support this method. |
RadiensError
|
On communication failure or server error. |
get_units
get_units(
dataset: FlexDataset,
channels: FlexSignalSpec | None = None,
*,
spikes_id: str | None = None,
) -> list[Unit]
List the sorted cells in a fileset, merging each cell's per-site listings.
get_neurons() lists a cell once under every site that saw it. This merges
those listings: counts and rates sum, and the site, SNR and depth come from the
listing with the most spikes. Unclustered spikes (label 0) and the
bad/delete bins are left out.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to query (metadata object, ID string, or file path).
TYPE:
|
channels
|
Channels whose listings to include;
TYPE:
|
spikes_id
|
ID of the spikes fileset to read.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[Unit]
|
One entry per sorted cell, ascending by label. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a channel index is not in the dataset. |
RadiensError
|
If spikes_id is not given and the dataset has no spikes fileset, or on communication failure or server error. |
healthcheck
healthcheck(service: ServiceEndpoint = RADIENS_LIFECYCLE) -> None
Verify the server is responsive.
| PARAMETER | DESCRIPTION |
|---|---|
service
|
Service to probe:
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If service is not a radiensserver service. |
RadiensError
|
If the health check fails or the server is unresponsive. |
highpass
highpass(
dataset: FlexDataset,
frequency: float,
output_path: str | Path,
*,
order: int | None = None,
) -> DatasetMetadata
Apply a high-pass filter to a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to filter (metadata object, ID string, or file path).
TYPE:
|
frequency
|
Cutoff frequency in Hz.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
order
|
Filter order. If
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (filtered) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
kpi_calculate
kpi_calculate(dataset: FlexDataset) -> None
Compute KPI for a dataset and wait until it is ready.
Returns once KPI covers the dataset's current time range: the whole file, unless the recording is still being written.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to compute KPIs for (metadata object, ID string, or file path).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
RadiensError
|
On communication failure or server error. |
kpi_clear
kpi_clear(dataset: FlexDataset) -> None
Discard all computed KPI for a dataset, including results cached on disk.
Computation stops until kpi_calculate() is called or a KPI, detection or stage-2
setting changes, either of which restarts it. Those changes do not need a clear first;
the server recomputes on its own.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to clear KPI state for (metadata object, ID string, or file path).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
RadiensError
|
On communication failure or server error. |
link_data_file
link_data_file(
fpath: str | Path, file_type: RadiensFileType | None = None, *, live: bool = False
) -> DatasetMetadata
Link a recording file and return its metadata.
Also registers any .spikes file found alongside the recording, so it joins the
sorts already known for this recording in associated_spikes_ids and the spike
data methods on VidereClient can read it.
| PARAMETER | DESCRIPTION |
|---|---|
fpath
|
Path to the recording file (e.g. |
file_type
|
Recording file type.
TYPE:
|
live
|
Opt into live monitoring for a recording that is still being written, like "Open Live" in Videre. Required for KPI to follow a growing file; without it, KPI covers only the extent at link time. Has no effect on a finalized recording. Requires a license that includes live monitoring.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the linked dataset. For a recording still being written,
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If file_type is |
CapabilityError
|
If live is true and the connected server is too old to support it. |
RadiensError
|
On communication failure or server error. |
list_data_source_ids
list_data_sources
List linked data sources and their metadata.
Each entry costs an extra request, so pass dsource_ids when only a few are of interest.
| PARAMETER | DESCRIPTION |
|---|---|
dsource_ids
|
IDs to list, or a single ID. |
| RETURNS | DESCRIPTION |
|---|---|
dict[str, DatasetMetadata]
|
Map of data source ID to metadata. |
list_directory
List files in a remote server-side directory.
| PARAMETER | DESCRIPTION |
|---|---|
directory
|
Server-side directory path to list. |
| RETURNS | DESCRIPTION |
|---|---|
list[FileInfo]
|
Metadata for each file found in the directory. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server is too old to support this method. |
RadiensError
|
On communication failure or server error. |
lowpass
lowpass(
dataset: FlexDataset,
frequency: float,
output_path: str | Path,
*,
order: int | None = None,
) -> DatasetMetadata
Apply a low-pass filter to a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to filter (metadata object, ID string, or file path).
TYPE:
|
frequency
|
Cutoff frequency in Hz.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
order
|
Filter order. If
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (filtered) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
move_data_source_file
move_data_source_file(
src_path: str | Path, dest_path: str | Path, *, force: bool = False
) -> None
Move a server-side data source file to a new location.
| PARAMETER | DESCRIPTION |
|---|---|
src_path
|
Source file path on the server. |
dest_path
|
Destination file path on the server. Must have the same file type as the source. |
force
|
If
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a path's suffix does not match a known file type. |
notch
notch(
dataset: FlexDataset, frequency: float, bandwidth: float, output_path: str | Path
) -> DatasetMetadata
Apply a notch filter to a dataset.
The notch filter is always second-order, so it takes no order.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to filter (metadata object, ID string, or file path).
TYPE:
|
frequency
|
Center frequency to reject, in Hz (e.g., 60.0 for line noise).
TYPE:
|
bandwidth
|
Width of the rejection band in Hz. Must be positive.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (filtered) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format, or bandwidth is not positive. |
RadiensError
|
If the server rejects the transform. |
paired_ref
paired_ref(
dataset: FlexDataset, ref_channel: int, target_channel: int, output_path: str | Path
) -> DatasetMetadata
Apply paired re-referencing between two specific channels.
References one target channel against one reference channel.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to re-reference (metadata object, ID string, or file path).
TYPE:
|
ref_channel
|
Native channel index of the reference electrode.
TYPE:
|
target_channel
|
Native channel index of the channel to re-reference.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (re-referenced) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |
remove_data_source_file
Remove a server-side data source file.
A dataset linked from this file is unlinked first, including one open in the desktop apps.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
File path on the server to remove. |
force
|
Has no effect.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a path's suffix does not match a known file type. |
select_channels
select_channels(dataset: FlexDataset, signals: FlexSignalSpec) -> DatasetMetadata
Add signals to a dataset's selection, leaving the rest selected.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to update (metadata object, ID string, or file path).
TYPE:
|
signals
|
Channels to select. Same forms as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Refreshed dataset metadata carrying the new selection. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If an index is not present in the dataset. |
RadiensError
|
On communication failure or server error. |
set_channel_groups
set_channel_groups(
dataset: FlexDataset, groups: Sequence[FlexSignalSpec]
) -> DatasetMetadata
Make a dataset's color groups exactly groups, discarding existing ones.
Groups are indexed in the order given, but each signal type within a group gets
its own index and a group matching no channels gets none, so read the resulting
indices from color_group_idxs on the returned metadata rather than assuming
1..N.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to update (metadata object, ID string, or file path).
TYPE:
|
groups
|
Desired groups, in order. Each accepts the same forms as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Refreshed dataset metadata carrying the new groups. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a requested channel is not selected; only selected channels can be grouped. |
RadiensError
|
On communication failure or server error. |
set_detect_params
set_detect_params(
spike_sorter_id: str, params: SpikeDetectParams, channels: list[int]
) -> None
Update detection parameters on the given channels.
Deprecated
Use update_detect_params() instead.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
As for
TYPE:
|
params
|
As for
TYPE:
|
channels
|
As for |
set_dsp_group
set_dsp_group(
dataset: FlexDataset, *, stage: FlexFilterStage, params: list[FlexDSPParams]
) -> None
Replace a dataset's stage-2 filters.
Only stage 2 can be changed on a dataset; hardware and stage-1 filters are part of how
the recording was made. KPI for the dataset is recomputed through the new chain in
the background; call kpi_calculate() to wait for it.
Warning
params replaces the stage on every port, and a filter applies only to its
port's channels. List a filter once per port it applies to; a port missing
from the list loses its filters.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to update (metadata object, ID string, or file path).
TYPE:
|
stage
|
The filter stage to update. Must resolve to
TYPE:
|
params
|
Filter parameters for this stage. Each item can be a
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If a filter sets |
ServerCommunicationError
|
If stage is not stage 2, or the server cannot build a filter. |
CapabilityError
|
If a filter sets a non-Butterworth |
set_kpi_packet_dur
set_kpi_packet_dur(dataset: FlexDataset, packet_dur: float) -> None
Set the KPI packet duration for a dataset.
KPI for the dataset is recomputed in the background; call kpi_calculate() to
wait for it.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to configure (metadata object, ID string, or file path).
TYPE:
|
packet_dur
|
Duration of each KPI packet in seconds.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If the connected server predates the current KPI metric set. |
RadiensError
|
On communication failure or server error. |
set_protocol
set_protocol(
nodes: list[TransformNode],
edges: list[TransformEdge],
*,
protocol_id: str | None = None,
) -> ProtocolSpec
Register a custom protocol with the server.
Build a directed acyclic graph of transform nodes and register
it for later execution with apply_protocol(). The server
validates the graph and returns a summary.
Use TransformNode factory methods to construct nodes, and
TransformEdge to wire them together:
src = TransformNode.source(meta)
hp = TransformNode.highpass(300.0)
car = TransformNode.car()
snk = TransformNode.sink("result", "/output", RadiensFileType.XDAT)
edges = [
TransformEdge(source=src.id, target=hp.id),
TransformEdge(source=hp.id, target=car.id),
TransformEdge(source=car.id, target=snk.id),
]
spec = client.set_protocol([src, hp, car, snk], edges)
client.apply_protocol(spec.id)
| PARAMETER | DESCRIPTION |
|---|---|
nodes
|
Ordered list of transform nodes forming the graph.
TYPE:
|
edges
|
Directed edges connecting the nodes by ID.
TYPE:
|
protocol_id
|
Optional protocol ID. A UUID is generated if not provided.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ProtocolSpec
|
Summary of the validated (server-registered) protocol. |
| RAISES | DESCRIPTION |
|---|---|
RadiensError
|
If the server marks one or more nodes as invalid. |
set_selected_channels
set_selected_channels(dataset: FlexDataset, signals: FlexSignalSpec) -> DatasetMetadata
Make a dataset's channel selection exactly signals.
Only signal types named in signals are touched — passing a bare list of amp
indices leaves the GPIO selection alone. Clear one type with {"amp": []}.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to update (metadata object, ID string, or file path).
TYPE:
|
signals
|
Desired selection — list of amp indices,
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Refreshed dataset metadata carrying the new selection. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If an index is not present in the dataset. |
RadiensError
|
On communication failure or server error. |
slice_channels
slice_channels(
dataset: FlexDataset, channels: Sequence[int], output_path: str | Path
) -> DatasetMetadata
Select a subset of channels from a dataset.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to slice (metadata object, ID string, or file path).
TYPE:
|
channels
|
System channel indices ( |
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new dataset containing only the selected channels. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If a channel index is not in the dataset, or the server rejects the transform. |
slice_time
slice_time(
dataset: FlexDataset, start_sec: float, end_sec: float, output_path: str | Path
) -> DatasetMetadata
Slice a dataset in time.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to slice (metadata object, ID string, or file path).
TYPE:
|
start_sec
|
Start, in seconds of stream time.
TYPE:
|
end_sec
|
End, in seconds of stream time.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (sliced) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform, e.g. a range outside the dataset. |
spike_sort
spike_sort(params: SpikeSorterLaunchParams, *, stall_sec: float = 120.0) -> str
Sort an offline recording and return the id of the fileset it wrote, once readable.
Launches the sort with spike_sorter_launch(), then waits until the sort has
finished and its fileset can be read.
There is no overall time limit, since sort duration depends on the recording. The
call fails only if the sort stops making progress: neither phase nor
frac_complete changes for stall_sec. On failure the sort is turned off before
the error is raised.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
As for
TYPE:
|
stall_sec
|
How long the state may stay put before the sort is declared stuck.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
ServerCommunicationError
|
If the sorter reports an error, or it stopped and no fileset was registered within a short grace period. |
TimeoutError
|
If the sort stalled. |
RadiensError
|
On communication failure or server error. |
spike_sorter_cancel
spike_sorter_cancel(spike_sorter_id: str) -> None
Cancel a running spike sorter.
Equivalent to spike_sorter_command(id, SpikeSorterCommand.OFF). The sorter is
removed immediately, so later calls with the same ID raise
ServerCommunicationError.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
Unique ID of the spike sorter to cancel.
TYPE:
|
spike_sorter_command
spike_sorter_command(
spike_sorter_id: str,
cmd: FlexSpikeSorterCommand,
*,
sub_cmd: FlexSpikeSorterSubCommand = NULL,
neighbor_radius_um: float | None = None,
max_num_site_neighbors: int | None = None,
) -> None
Send a command to a running spike sorter.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
Unique ID of the spike sorter to control.
TYPE:
|
cmd
|
The command to execute. Accepts
TYPE:
|
sub_cmd
|
Optional sub-command modifier. Accepts
TYPE:
|
neighbor_radius_um
|
Optional per-site neighbor search radius, in
microns. Only applied when
TYPE:
|
max_num_site_neighbors
|
Optional cap on the number of neighbors kept
per site (closest first). Only applied when
TYPE:
|
Warning
"init" clears the sorter's spikes and resets its detection thresholds,
windows and shadow to defaults. On an offline sort it ends the sort and
discards its output, so pass the neighborhood to spike_sorter_launch
instead.
spike_sorter_delete
spike_sorter_delete(spike_sorter_id: str) -> None
Delete a spike sorter and release its resources.
An ID the server does not know is ignored.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
Unique ID of the spike sorter to delete.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If spike_sorter_id is empty. |
RadiensError
|
On communication failure or server error. |
spike_sorter_launch
spike_sorter_launch(params: SpikeSorterLaunchParams) -> SpikeSorterLaunchResult
Launch a new spike sorter on a dataset.
Returns as soon as the sort starts; use spike_sort() to wait for the result.
The new fileset appears in DatasetMetadata.associated_spikes_ids once the sort
completes, and never for a sort that is cancelled or fails.
Warning
Sorting starts during this call, so every setting must be in params.
spike_sorter_command(..., "init", ...) is too late: it ends an offline sort
and discards its output. On a recording still being written, relaunching
replaces the previous sort and its output.
The sort uses the dataset's stage-2 DSP and detection thresholds as they are at
launch; the stage-2 chain may be empty. Configure both first
(set_dsp_group(stage=FilterStage.STAGE2), update_detect_params() with the
dataset ID).
Each launch on an offline recording writes a new fileset alongside earlier ones.
| PARAMETER | DESCRIPTION |
|---|---|
params
|
Target dataset ID,
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SpikeSorterLaunchResult
|
The unique ID and type of the launched sorter. The sorter is removed shortly after it completes; its ID then names the output fileset. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If |
RadiensError
|
On communication failure or server error. |
update_detect_params
update_detect_params(
spike_sorter_id: str, params: SpikeDetectParams, channels: list[int]
) -> None
Update detection thresholds, shadow, window and spike width on the given channels.
Fields in params that are None will not be modified.
| PARAMETER | DESCRIPTION |
|---|---|
spike_sorter_id
|
ID of a running spike sorter, or a dataset ID to configure
the dataset before launching a sort. On a dataset, KPI is recomputed with
the new settings in the background; call
TYPE:
|
params
|
The detection parameters to apply.
TYPE:
|
channels
|
List of native channel indices to apply the parameters to. |
| RAISES | DESCRIPTION |
|---|---|
CapabilityError
|
If |
virtual_ref
virtual_ref(
dataset: FlexDataset, ref_channel: int, output_path: str | Path
) -> DatasetMetadata
Apply virtual reference re-referencing to a dataset.
References all channels against a single nominated electrode.
| PARAMETER | DESCRIPTION |
|---|---|
dataset
|
Dataset to re-reference (metadata object, ID string, or file path).
TYPE:
|
ref_channel
|
Native channel index of the reference electrode.
TYPE:
|
output_path
|
Output file. Its suffix sets the format (e.g. |
| RETURNS | DESCRIPTION |
|---|---|
DatasetMetadata
|
Metadata for the new (re-referenced) dataset. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_path's suffix names no supported format. |
RadiensError
|
If the server rejects the transform. |