inject_currents_and_simulate_spike_trains#

inject_currents_and_simulate_spike_trains(
populations: Sequence[_Pool],
input_current__AnalogSignal: ]],
spike_detection_thresholds__mV: Quantity__mV | Sequence[Quantity__mV] = -10.0 * pq.mV,
) SPIKE_TRAIN__Block[source]#

Injects input currents into populations and returns recorded spike trains.

This is a complete pipeline function that sets up current injection, spike recording, runs the NEURON simulation, and returns the results as a properly formatted neo.Block.

Parameters:
  • populations (Sequence[_Pool]) – The populations of neurons to inject current into.

  • input_current__AnalogSignal (CURRENT__AnalogSignal) – The analog signal of input currents to inject into the population. Shape should be (time_points, n_pools) where n_pools matches len(populations).

  • spike_detection_thresholds__mV (float | Sequence[float], optional) – Thresholds for spike detection in millivolts, by default -10.0. If a sequence is provided, it must match the number of populations.

Returns:

Neo Block containing spike trains organized as segments (pools) with spiketrains (neurons). Each segment represents a motor unit pool, each spiketrain represents a neuron.

Return type:

SPIKE_TRAIN__Block

Raises:

ValueError – If the number of populations does not match the number of current channels.

Notes

This function performs the complete simulation pipeline: 1. Sets up current injection (same as inject_currents_into_populations) 2. Sets up spike recording for all neurons 3. Runs the NEURON simulation via h.run() 4. Converts recorded spikes to neo.Block format