SpatialNeuron class

(Shortest import: from brian2 import SpatialNeuron)

class brian2.spatialneuron.spatialneuron.SpatialNeuron(morphology=None, model=None, threshold=None, refractory=False, reset=None, threshold_location=None, dt=None, clock=None, order=0, Cm=0.009 * metre ** -4 * kilogram ** -1 * second ** 4 * amp ** 2, Ri=1.5 * metre ** 3 * kilogram * second ** -3 * amp ** -2, name='spatialneuron*', dtype=None, namespace=None, method=('linear', 'exponential_euler', 'rk2', 'milstein'))[source]

Bases: brian2.groups.neurongroup.NeuronGroup

A single neuron with a morphology and possibly many compartments.


morphology : Morphology

The morphology of the neuron.

model : (str, Equations)

The equations defining the group.

method : (str, function), optional

The numerical integration method. Either a string with the name of a registered method (e.g. “euler”) or a function that receives an Equations object and returns the corresponding abstract code. If no method is specified, a suitable method will be chosen automatically.

threshold : str, optional

The condition which produces spikes. Should be a single line boolean expression.

threshold_location : (int, Morphology), optional

Compartment where the threshold condition applies, specified as an integer (compartment index) or a Morphology object corresponding to the compartment (e.g. morpho.axon[10*um]). If unspecified, the threshold condition applies at all compartments.

Cm : Quantity, optional

Specific capacitance in uF/cm**2 (default 0.9). It can be accessed and modified later as a state variable. In particular, its value can differ in different compartments.

Ri : Quantity, optional

Intracellular resistivity in (default 150). It can be accessed as a shared state variable, but modified only before the first run. It is uniform across the neuron.

reset : str, optional

The (possibly multi-line) string with the code to execute on reset.

refractory : {str, Quantity}, optional

Either the length of the refractory period (e.g. 2*ms), a string expression that evaluates to the length of the refractory period after each spike (e.g. '(1 + rand())*ms'), or a string expression evaluating to a boolean value, given the condition under which the neuron stays refractory after a spike (e.g. 'v > -20*mV')

namespace : dict, optional

A dictionary mapping variable/function names to the respective objects. If no namespace is given, the “implicit” namespace, consisting of the local and global namespace surrounding the creation of the class, is used.

dtype : (dtype, dict), optional

The numpy.dtype that will be used to store the values, or a dictionary specifying the type for variable names. If a value is not provided for a variable (or no value is provided at all), the preference setting core.default_float_dtype is used.

dt : Quantity, optional

The time step to be used for the simulation. Cannot be combined with the clock argument.

clock : Clock, optional

The update clock to be used. If neither a clock, nor the dt argument is specified, the defaultclock will be used.

order : int, optional

The priority of of this group for operations occurring at the same time step and in the same scheduling slot. Defaults to 0.

name : str, optional

A unique name for the group, otherwise use spatialneuron_0, etc.


spatialneuron_attribute(neuron, x) Selects a subtree from SpatialNeuron neuron and returns a SpatialSubgroup.
spatialneuron_segment(neuron, x) Selects a segment from SpatialNeuron neuron, where x is a slice of either compartment indexes or distances.


static spatialneuron_attribute(neuron, x)[source]

Selects a subtree from SpatialNeuron neuron and returns a SpatialSubgroup. If it does not exist, returns the Group attribute.

static spatialneuron_segment(neuron, x)[source]

Selects a segment from SpatialNeuron neuron, where x is a slice of either compartment indexes or distances. Note a: segment is not a SpatialNeuron, only a Group.