radiens_core.models.channels
Channel metadata, site position models, and channel-related enums.
| CLASS | DESCRIPTION |
|---|---|
AreaUnits |
Area measurement units for electrode sites. |
ChannelInfo |
Complete channel information for a specific channel. |
ChannelMetadata |
Channel metadata for a dataset. |
KeyIdxs |
Channel indices in all three key index spaces. |
SignalUnits |
Signal measurement units. |
SitePosition |
Electrode site position and geometry in probe and tissue coordinates. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
COLOR_GROUP_UNSET |
|
SITE_NUM_UNSET |
|
Attributes
COLOR_GROUP_UNSET
module-attribute
color_group_idx value for a channel belonging to no color group.
SITE_NUM_UNSET
module-attribute
site_num value for a channel with no probe connected.
Classes
AreaUnits
Bases: IntEnum
Area measurement units for electrode sites.
| ATTRIBUTE | DESCRIPTION |
|---|---|
SQUARE_MICROMETERS |
µm², the base unit.
|
ChannelInfo
Bases: BaseModel
Complete channel information for a specific channel.
Identity and index fields are always present. Position fields (probe_x,
probe_y, etc.) are None for non-amplifier channels; use
has_position to guard access. site_position provides a structured
SitePosition view built from the inline fields when position data is
available.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ntv_idx |
Native channel index, counted within the signal type. See
TYPE:
|
dset_idx |
Position in the backing dataset, counted within the signal type.
TYPE:
|
sys_idx |
System channel index, counted across all signal types.
TYPE:
|
signal_type |
Signal type of this channel.
TYPE:
|
name |
User-facing display name.
TYPE:
|
ntv_name |
Hardware-native channel name.
TYPE:
|
is_selected |
Whether this channel is currently selected.
TYPE:
|
probe_id |
Probe identifier for the sensor this channel belongs to.
TYPE:
|
headstage_id |
Headstage identifier for this channel.
TYPE:
|
sensor_id |
Sensor identifier for this channel.
TYPE:
|
probe_x |
X-coordinate in probe coordinate system (µm). None for non-AMP.
TYPE:
|
probe_y |
Y-coordinate in probe coordinate system (µm). None for non-AMP.
TYPE:
|
probe_z |
Z-coordinate in probe coordinate system (µm). None for non-AMP.
TYPE:
|
tissue_x |
X-coordinate in tissue coordinate system (µm). None for non-AMP.
TYPE:
|
tissue_y |
Y-coordinate in tissue coordinate system (µm). None for non-AMP.
TYPE:
|
tissue_z |
Z-coordinate in tissue coordinate system (µm). None for non-AMP.
TYPE:
|
site_num |
Probe site number label, unique within one probe on one port.
TYPE:
|
port |
Hardware port of the channel's probe.
TYPE:
|
probe_idx |
Position of the channel's probe among the probes on
TYPE:
|
color_group_idx |
Allego color group assignment index.
TYPE:
|
site_shape |
Geometric shape of the electrode site. Empty for non-AMP.
TYPE:
|
site_area_um2 |
Surface area in square micrometers. None for non-AMP.
TYPE:
|
site_lim_x_min |
Bounding box min X (µm). None for non-AMP.
TYPE:
|
site_lim_x_max |
Bounding box max X (µm). None for non-AMP.
TYPE:
|
site_lim_y_min |
Bounding box min Y (µm). None for non-AMP.
TYPE:
|
site_lim_y_max |
Bounding box max Y (µm). None for non-AMP.
TYPE:
|
site_lim_z_min |
Bounding box min Z (µm). None for non-AMP.
TYPE:
|
site_lim_z_max |
Bounding box max Z (µm). None for non-AMP.
TYPE:
|
scs_to_tcs_x |
X-offset for probe-to-tissue transform. None for non-AMP.
TYPE:
|
scs_to_tcs_y |
Y-offset for probe-to-tissue transform. None for non-AMP.
TYPE:
|
scs_to_tcs_z |
Z-offset for probe-to-tissue transform. None for non-AMP.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_area |
Get electrode site area in the requested units, or None for non-AMP channels. |
Attributes
bounding_box_center
property
Bounding box center in probe coordinate system (µm), or None for non-AMP.
bounding_box_size
property
Site bounding box size (width, height, depth) in µm, or None for non-AMP.
has_position
property
has_position: bool
True if site position data is available (AMP channels only).
site_position
property
site_position: SitePosition | None
Structured view of the inline position fields.
Returns a SitePosition built from this channel's inline fields, or
None for non-AMP channels.
Functions
get_area
ChannelMetadata
Bases: BaseModel
Channel metadata for a dataset.
Contains channel configuration, probe geometry, signal types, and indices for all channels.
| ATTRIBUTE | DESCRIPTION |
|---|---|
dataset_uid |
Identifier stored in the recording's own metadata; not the same as
TYPE:
|
fs |
Sampling frequency in Hertz.
TYPE:
|
source_label |
Label for the data source.
TYPE:
|
neighbor_max_radius_um |
Maximum radius for neighbor search in micrometers.
TYPE:
|
signal_units |
Mapping of signal types to their units.
TYPE:
|
has_discrete |
Whether the dataset contains discrete signals.
TYPE:
|
has_continuous_amp |
Whether the dataset contains continuous amplifier signals.
TYPE:
|
sig_map |
Mapping of signal types to their indices.
TYPE:
|
selected_sig_map |
Mapping of signal types to their selected indices.
TYPE:
|
num_channels |
Total number of channels per signal type.
TYPE:
|
selected_num_channels |
Number of selected channels per signal type.
TYPE:
|
site_positions |
Site positions for amplifier channels (parallel to sig_map[AMP].ntv).
TYPE:
|
chan_names |
Display names per channel, parallel to sig_map[st].ntv for each signal type.
TYPE:
|
ntv_chan_names |
Hardware-native names per channel, parallel to sig_map[st].ntv.
TYPE:
|
probe_ids |
Probe IDs per channel, parallel to sig_map[st].ntv.
TYPE:
|
headstage_ids |
Headstage IDs per channel, parallel to sig_map[st].ntv.
TYPE:
|
sensor_ids |
Sensor IDs per channel, parallel to sig_map[st].ntv.
TYPE:
|
site_nums |
Probe site number labels per channel, parallel to sig_map[st].ntv.
TYPE:
|
ports |
Probe port per channel, parallel to sig_map[st].ntv. See
TYPE:
|
probe_idxs |
Probe position on its port per channel, parallel to sig_map[st].ntv.
See
TYPE:
|
color_group_idxs |
Allego color group indices per channel, parallel to sig_map[st].ntv.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
all_amp_indices |
Get all amplifier channel native indices. |
get_channel_info |
Get complete channel information from native index. |
get_num_channels |
Get total number of channels for a signal type. |
index |
Get channel indices for a signal type. |
ntv_from_dset |
Convert dataset index to native index. |
ntv_from_sys |
Convert system index to native index. |
ntv_indices_for_sites |
Return the AMP native index of each site on one probe. |
selected_index |
Get selected channel indices for a signal type. |
sys_indices_for_color_groups |
Return sys_idx for all channels whose color_group_idx is in the given list. |
sys_indices_for_site_nums |
Return sys_idx for each channel whose site_num is in the given list. |
Attributes
total_selected_channels
property
total_selected_channels: int
Total number of selected channels across all signal types.
Functions
get_channel_info
get_channel_info(ntv_idx: int, sig_type: SignalType) -> ChannelInfo
Get complete channel information from native index.
| PARAMETER | DESCRIPTION |
|---|---|
ntv_idx
|
Native channel index.
TYPE:
|
sig_type
|
Signal type to look up.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ChannelInfo
|
Complete channel information including indices, names, hardware IDs, and site position (AMP channels only). |
| RAISES | DESCRIPTION |
|---|---|
DatasetError
|
If ntv_idx not found for the signal type. |
get_num_channels
get_num_channels(sig_type: SignalType) -> int
Get total number of channels for a signal type.
ntv_from_dset
ntv_from_dset(dset_idx: int, sig_type: SignalType) -> int
Convert dataset index to native index.
| PARAMETER | DESCRIPTION |
|---|---|
dset_idx
|
Dataset index.
TYPE:
|
sig_type
|
Signal type.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Native index for the channel. |
| RAISES | DESCRIPTION |
|---|---|
DatasetError
|
If dset_idx not found for the signal type. |
ntv_from_sys
ntv_from_sys(sys_idx: int, sig_type: SignalType) -> int
Convert system index to native index.
| PARAMETER | DESCRIPTION |
|---|---|
sys_idx
|
System index.
TYPE:
|
sig_type
|
Signal type.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
Native index for the channel. |
| RAISES | DESCRIPTION |
|---|---|
DatasetError
|
If sys_idx not found for the signal type. |
ntv_indices_for_sites
Return the AMP native index of each site on one probe.
A site number is unique only within one probe on one port, so the probe is part
of the lookup. Pass a result to SignalSpec.amp(), or to get_channel_info()
for the sys_idx that stimulation takes.
| PARAMETER | DESCRIPTION |
|---|---|
site_nums
|
Probe site number labels to look up. |
port
|
Port the probe is on.
TYPE:
|
probe_idx
|
Probe position on
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[int]
|
Native indices in the same order as |
| RAISES | DESCRIPTION |
|---|---|
DatasetError
|
If a site number is not on that probe. |
selected_index
selected_index(sig_type: SignalType) -> KeyIdxs
Get selected channel indices for a signal type.
sys_indices_for_color_groups
sys_indices_for_color_groups(
sig_type: SignalType, color_group_idxs: list[int]
) -> list[int]
Return sys_idx for all channels whose color_group_idx is in the given list.
| PARAMETER | DESCRIPTION |
|---|---|
sig_type
|
Signal type to search.
TYPE:
|
color_group_idxs
|
Color group indices to include. |
| RETURNS | DESCRIPTION |
|---|---|
list[int]
|
sys_idx values for all matching channels, in channel order. |
sys_indices_for_site_nums
sys_indices_for_site_nums(sig_type: SignalType, site_nums: list[int]) -> list[int]
Return sys_idx for each channel whose site_num is in the given list.
Deprecated
Use ntv_indices_for_sites(), which takes the port and probe that make a
site number unique.
| PARAMETER | DESCRIPTION |
|---|---|
sig_type
|
Signal type to search.
TYPE:
|
site_nums
|
Probe site number labels to look up. |
| RETURNS | DESCRIPTION |
|---|---|
list[int]
|
sys_idx values in the same order as |
| RAISES | DESCRIPTION |
|---|---|
DatasetError
|
If a site_num has no matching channel, or matches channels on more than one probe. |
KeyIdxs
Bases: BaseModel
Channel indices in all three key index spaces.
| ATTRIBUTE | DESCRIPTION |
|---|---|
ntv |
Native channel index — where the channel sits in the acquisition hardware,
counted within its signal type. Stable for the life of the recording, and the
index space every |
dset |
Position of the channel in this dataset, counted within its signal type. Renumbered from zero when a dataset is sliced, so it does not identify a channel across a slice. |
sys |
System channel index — the channel's position across all signal types at
once, so amplifier, analog, and digital channels share one numbering. This is
the space |
SignalUnits
SitePosition
Bases: BaseModel
Electrode site position and geometry in probe and tissue coordinates.
| ATTRIBUTE | DESCRIPTION |
|---|---|
probe_x |
X-coordinate in probe coordinate system (µm).
TYPE:
|
probe_y |
Y-coordinate in probe coordinate system (µm).
TYPE:
|
probe_z |
Z-coordinate in probe coordinate system (µm).
TYPE:
|
tissue_x |
X-coordinate in tissue coordinate system (µm).
TYPE:
|
tissue_y |
Y-coordinate in tissue coordinate system (µm).
TYPE:
|
tissue_z |
Z-coordinate in tissue coordinate system (µm).
TYPE:
|
site_shape |
Geometric shape of the electrode site.
TYPE:
|
site_area_um2 |
Surface area of the electrode site in square micrometers.
TYPE:
|
site_lim_x_min |
Minimum X-limit of the site bounding box (µm).
TYPE:
|
site_lim_x_max |
Maximum X-limit of the site bounding box (µm).
TYPE:
|
site_lim_y_min |
Minimum Y-limit of the site bounding box (µm).
TYPE:
|
site_lim_y_max |
Maximum Y-limit of the site bounding box (µm).
TYPE:
|
site_lim_z_min |
Minimum Z-limit of the site bounding box (µm).
TYPE:
|
site_lim_z_max |
Maximum Z-limit of the site bounding box (µm).
TYPE:
|
scs_to_tcs_x |
X-offset for probe to tissue coordinate transformation (µm).
TYPE:
|
scs_to_tcs_y |
Y-offset for probe to tissue coordinate transformation (µm).
TYPE:
|
scs_to_tcs_z |
Z-offset for probe to tissue coordinate transformation (µm).
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
get_area |
Get site area in the specified units. |
Attributes
bounding_box_center
property
Site bounding box center coordinates in probe coordinate system.
bounding_box_size
property
Site bounding box size (width, height, depth) in micrometers.