MotorNeuronPool#
- class MotorNeuronPool(
- recruitment_thresholds,
- diameter_soma_min__mm=77.5,
- diameter_soma_max__mm=82.5,
- y_min__mm=18.0,
- y_max__mm=36.0,
- diameter_dend_min__mm=41.5,
- diameter_dend_max__mm=62.5,
- x_min__mm=-5500,
- x_max__mm=-6789,
- vt_min__mV=12.35,
- vt_max__mV=20.9,
- kf_cond_min__S_per_cm2=4,
- kf_cond_max__S_per_cm2=0.5,
- coefficient_of_variation=0.01,
Bases:
object
Motor neuron pool with specified parameters for EMG simulation.
This class creates and manages a pool of motor neurons with physiologically realistic parameters. It supports spike train generation through NEURON backend integration and provides both current injection and cortical input stimulation modes.
- Parameters:
recruitment_thresholds (
numpy.ndarray
) – Array of recruitment thresholds for the motor neurons (normalized 0-1)diameter_soma_min__mm (
float
, default77.5
) – Minimum diameter of the soma in millimetersdiameter_soma_max__mm (
float
, default82.5
) – Maximum diameter of the soma in millimetersy_min__mm (
float
, default18.0
) – Minimum y coordinate of the soma in millimetersy_max__mm (
float
, default36.0
) – Maximum y coordinate of the soma in millimetersdiameter_dend_min__mm (
float
, default41.5
) – Minimum diameter of the dendrite in millimetersdiameter_dend_max__mm (
float
, default62.5
) – Maximum diameter of the dendrite in millimetersx_min__mm (
float
, default-5500
) – Minimum x coordinate of the dendrite in millimetersx_max__mm (
float
, default-6789
) – Maximum x coordinate of the dendrite in millimetersvt_min__mV (
float
, default12.35
) – Minimum voltage threshold of the neuron in millivoltsvt_max__mV (
float
, default20.9
) – Maximum voltage threshold of the neuron in millivoltskf_cond_min__S_per_cm2 (
float
, default4
) – Minimum conductance density of the potassium fast channel in S/cm²kf_cond_max__S_per_cm2 (
float
, default0.5
) – Maximum conductance density of the potassium fast channel in S/cm²coefficient_of_variation (
float
, default0.01
) – Coefficient of variation for parameter noise (0-1)
- spike_trains#
Matrix of spike trains - available after generate_spike_trains()
- Type:
- active_neuron_indices#
Indices of active neurons per pool - available after generate_spike_trains()
- Type:
- data#
Neo segments with recorded data - available after generate_spike_trains()
- Type:
list[neo.Segment]
- mvc_current_threshold#
Minimum current for maximum voluntary contraction - computed on access
- Type:
Examples
>>> pool = MotorNeuronPool(recruitment_thresholds=np.linspace(0, 1, 100)) >>> current_matrix = np.random.randn(5, 1000) * 50 >>> spike_trains, indices, data = pool.generate_spike_trains(current_matrix) >>> print(f"Generated spike trains shape: {pool.spike_trains.shape}")
Methods
Computes the minimum current threshold for maximum voluntary contraction using binary search optimization.
Generate the spike trains for as many neuron pools as input currents there are
Attributes
List of arrays containing indices of active neurons in each pool.
List of neo segments containing recorded data from simulation.
Property that returns the minimum current threshold for maximum voluntary contraction.
Matrix of spike trains for each pool and neuron.
- generate_spike_trains(
- input_current__matrix=None,
- cortical_input__matrix=None,
- timestep__ms=0.05,
- noise_mean__nA=30,
- noise_stdev__nA=30,
- CST_number=400,
- connection_prob=0.3,
- what_to_record=[{'variables': ['v'], 'locations': ['dendrite', 'soma']}],
Generate the spike trains for as many neuron pools as input currents there are
Each motor neuron pools have each “neurons_per_pool” neurons. The input currents are injected into each pool, and the spike trains are recorded.
- Parameters:
input_current__matrix (
INPUT_CURRENT__MATRIX
, optional) – Matrix of shape (n_pools, t_points) containing current values Each row represents the current for one poolcortical_input__matrix (
CORTICAL_INPUT__MATRIX
, optional) – Matrix of shape (n_pools, t_points) containing cortical input values Each row represents the cortical input for one pooltimestep__ms (
float
) – Simulation timestep__ms in msnoise_mean__nA (
float
) – Mean of the noise current in nAnoise_stdev__nA (
float
) – Standard deviation of the noise current in nACST_number (
int
) – Number of neurons in the cortical input population. Only used if cortical_input__matrix is provided. Default is 400.connection_prob (
float
) – Probability of a connection between a cortical input neuron and a motor neuron. Only used if cortical_input__matrix is provided. Default is 0.3.what_to_record (
list
[dict
['variables'
,'to_file'
,'sampling_interval'
,'locations'
],Any
]) –List of dictionaries specifying what to record.
- Each dictionary contains the following keys:
variables: list of strings specifying the variables to record
to_file: bool specifying whether to save the recorded data to a file
sampling_interval: int specifying the sampling interval in ms
locations: list of strings specifying the locations to record from
See pyNN documentation for more details: https://pynn.readthedocs.io/en/stable/recording.html.
Spike trains are recorded by default.
- Returns:
spike_trains (
SPIKE_TRAIN__MATRIX
) – Matrix of shape (n_pools, neurons_per_pool, t_points) containing spike trains Each row represents the spike train for one pool Each column represents the spike train for one neuron Each element represents whether the neuron spiked at that time pointactive_neuron_indices (
list
[numpy.ndarray
]) – List of arrays of indices of the active neurons in each pooldata (
list
[neo.core.segment.Segment
]) – List of neo segments containing the recorded data
- Return type:
tuple[Annotated[ndarray[tuple[int, …], dtype[bool]], beartype.vale.Is[lambda x: x.ndim == 3]], list[ndarray], list[Segment]]
- property spike_trains: ndim == 3]]#
Matrix of spike trains for each pool and neuron.
- Returns:
Matrix of shape (n_pools, neurons_per_pool, t_points) containing spike trains
- Return type:
- Raises:
AttributeError – If spike trains have not been computed. Run generate_spike_trains() first.
- property active_neuron_indices: list[ndarray]#
List of arrays containing indices of active neurons in each pool.
- Returns:
List of arrays of indices of the active neurons in each pool
- Return type:
- Raises:
AttributeError – If active neuron indices have not been computed. Run generate_spike_trains() first.
- property data: list[Segment]#
List of neo segments containing recorded data from simulation.
- Returns:
List of neo segments containing the recorded data
- Return type:
- Raises:
AttributeError – If data has not been computed. Run generate_spike_trains() first.