SurfaceElectrodeArray#

class SurfaceElectrodeArray(
num_rows: int,
num_cols: int,
inter_electrode_distances__mm: Quantity__mm,
electrode_radius__mm: Quantity__mm,
center_point__mm_deg: tuple[Quantity__mm, Quantity__deg] = (0.0 * pq.mm, 0.0 * pq.deg),
bending_radius__mm: Quantity__mm = 0.0 * pq.mm,
rotation_angle__deg: Quantity__deg = 0.0 * pq.deg,
differentiation_mode: Literal['monopolar', 'bipolar_longitudinal', 'bipolar_transversal', 'laplacian'] = 'monopolar',
)[source]#

Bases: object

Surface electrode array for EMG recording.

Represents a grid of surface electrodes with configurable spacing, size, and differentiation modes.

Parameters:
  • num_rows (int) – Number of rows in the electrode array

  • num_cols (int) – Number of columns in the electrode array

  • inter_electrode_distances__mm (float) – Inter-electrode distances in mm.

  • electrode_radius__mm (float, optional) – Radius of the electrodes in mm

  • center_point__mm_deg (tuple[float, float]) – Position along z in mm and rotation around the muscle theta in degrees.

  • bending_radius__mm (float, optional) – Bending radius around which the electrode grid is bent. Usually this is equal to the radius of the muscle.

  • rotation_angle__deg (float, optional) – Rotation angle of the electrodes in degrees. This is the angle between the electrode grid and the muscle surface.

  • differentiation_mode ({"monopolar", "bipolar_longitudinal", "bipolar_transversal", "laplacian"}) – Differentiation mode. Default is monopolar.

pos_z#

Longitudinal electrode positions in mm, shape (num_rows, num_cols). Available after class initialization via _create_electrode_grid().

Type:

np.ndarray

pos_theta#

Angular electrode positions in radians, shape (num_rows, num_cols). Available after class initialization via _create_electrode_grid().

Type:

np.ndarray

electrode_positions#

Complete electrode position arrays (pos_z, pos_theta). Available after class initialization via _create_electrode_grid().

Type:

tuple[np.ndarray, np.ndarray]

num_electrodes#

Total number of electrodes (num_rows * num_cols).

Type:

int

num_channels#

Number of recording channels based on differentiation mode.

Type:

int

Methods

__init__

get_H_sf

Get the spatial filter for the electrode array.

Attributes

electrode_positions

Complete electrode position arrays (z, theta) in physical coordinates.

pos_theta

Angular positions of electrodes in radians.

pos_z

Longitudinal positions of electrodes in mm.

property pos_z: Quantity__mm#

Longitudinal positions of electrodes in mm.

Returns:

Array of shape (num_rows, num_cols) containing z-coordinates of each electrode position in mm.

Return type:

Quantity__mm

Raises:

AttributeError – If electrode grid has not been created. Run constructor first.

property pos_theta: Quantity__rad#

Angular positions of electrodes in radians.

Returns:

Array of shape (num_rows, num_cols) containing angular coordinates of each electrode position in radians.

Return type:

Quantity__rad

Raises:

AttributeError – If electrode grid has not been created. Run constructor first.

property electrode_positions: tuple[Quantity__mm, Quantity__rad]#

Complete electrode position arrays (z, theta) in physical coordinates.

Returns:

Tuple containing: - pos_z: Longitudinal positions in mm, shape (num_rows, num_cols) - pos_theta: Angular positions in radians, shape (num_rows, num_cols)

Return type:

tuple[Quantity__mm, Quantity__rad]

Raises:

AttributeError – If electrode grid has not been created. Run constructor first.

get_H_sf(
ktheta_mesh_kzktheta: ndarray,
kz_mesh_kzktheta: ndarray,
) ndarray | float[source]#

Get the spatial filter for the electrode array.

Parameters:
  • ktheta_mesh_kzktheta (np.ndarray) – Angular spatial frequency mesh

  • kz_mesh_kzktheta (np.ndarray) – Longitudinal spatial frequency mesh

Returns:

H_sf – Spatial filter for the specified differentiation mode

Return type:

np.ndarray or float