myogen.simulator.IntramuscularElectrodeArray.set_linear_trajectory#

IntramuscularElectrodeArray.set_linear_trajectory(distance__mm, n_nodes=None)[source]#

Configure linear trajectory movement for the electrode array.

This method sets up a linear movement path for the electrode array, simulating needle insertion or withdrawal. The trajectory is discretized into nodes for temporal interpolation during EMG simulation.

Trajectory Properties: - Direction: Along the array’s longitudinal axis (z-direction in local coordinates) - Movement: Linear progression from start to end position - Discretization: Evenly spaced nodes for smooth interpolation - Default step size: 0.5mm if n_nodes not specified

Parameters:
  • distance__mm (float) – Total trajectory distance in mm. Positive values move in the positive z-direction of the array’s local coordinate system.

  • n_nodes (int, optional) – Number of discrete trajectory nodes. If None, automatically calculated as max(ceil(distance/0.5), 1) for 0.5mm steps.

Return type:

None

Notes

The trajectory is applied after position and orientation transformations. All trajectory transforms are calculated in the array’s oriented coordinate system.

Examples

>>> # Set up 10mm insertion with default step size (~0.5mm)
>>> array.set_linear_trajectory(distance__mm=10.0)
>>> # Set up 5mm trajectory with specific number of nodes
>>> array.set_linear_trajectory(distance__mm=5.0, n_nodes=20)

See also

calc_observation_points

Calculate electrode positions along trajectory

traj_mixing_mat

Generate mixing matrices for trajectory interpolation