Electrophysiology¶
- dendrotweaks.analysis.ephys_analysis.get_somatic_data(model)[source]¶
Get the somatic voltage, time, time step, and injected current.
- Parameters:
model (Model) – The neuron model.
- Returns:
A tuple containing the voltage, time, time step, and injected current.
- Return type:
tuple
- dendrotweaks.analysis.ephys_analysis.calculate_input_resistance(model)[source]¶
Calculate the input resistance of the neuron model.
- Parameters:
model (Model) – The neuron model.
- Returns:
A dictionary containing the onset and offset voltages, the input resistance, and the injected current.
- Return type:
dict
- dendrotweaks.analysis.ephys_analysis.calculate_time_constant(model)[source]¶
Calculate the membrane time constant of the neuron model.
- Parameters:
model (Model) – The neuron model.
- Returns:
A dictionary containing the time constant and the exponential fit.
- Return type:
dict
- dendrotweaks.analysis.ephys_analysis.calculate_passive_properties(model)[source]¶
Calculate the passive properties of the neuron model.
- Parameters:
model (Model) – The neuron model.
- Returns:
A dictionary containing the input resistance, time constant, and the exponential fit.
- Return type:
dict
- dendrotweaks.analysis.ephys_analysis.detect_somatic_spikes(model, **kwargs)[source]¶
Detect somatic spikes in the model and calculate spike amplitudes and widths.
- Returns:
A dictionary containing spike metrics.
- Return type:
dict
- dendrotweaks.analysis.ephys_analysis.plot_somatic_spikes(data, ax=None, show_metrics=False)[source]¶
Plot detected spikes on the provided axis or create a new figure.
- Parameters:
model – The neuron model
ax – Optional matplotlib axis for plotting
- Returns:
The plot axis
- Return type:
matplotlib.axes.Axes
- dendrotweaks.analysis.ephys_analysis.calculate_fI_curve(model, duration=1000, min_amp=0, max_amp=1, n=5, **kwargs)[source]¶
Calculate the frequency-current (f-I) curve of the neuron model.
- Parameters:
model (Model) – The neuron model.
duration (int) – Duration of the simulation in ms.
min_amp (float) – Minimum amplitude of the current injection in nA.
max_amp (float) – Maximum amplitude of the current injection in nA.
n (int) – Number of amplitudes to test.
- Returns:
A dictionary containing the current amplitudes, firing rates, and voltages.
- Return type:
dict
- dendrotweaks.analysis.ephys_analysis.calculate_voltage_attenuation(model)[source]¶
Calculate the voltage attenuation along the dendrites.
- Parameters:
model (Model) – The neuron model.
- Returns:
A dictionary containing the path distances, minimum voltages, and voltage attenuations
- Return type:
dict
- dendrotweaks.analysis.ephys_analysis.calculate_dendritic_nonlinearity(model, duration=1000, max_weight=None, n=None)[source]¶
Calculate the expected and observed voltage changes for a range of synaptic weights.
- Parameters:
model (Model) – The neuron model.
duration (int) – Duration of the simulation in ms.
max_weight (int) – Maximum synaptic weight to test.
- Returns:
A dictionary containing the expected and observed voltage changes.
- Return type:
dict