Recording¶
JNeuron supports recording both intracellularly (to measure the internal voltage of a neuron) and also extracellularly, to measure the extracellular potential that is generated by one or a group of neurons.
Intracellular¶
Intracellular electrodes can be used to capture the membrane voltage of a neuron throughout the course of a simulation. These are defined by 1) the neuron of interest and 2) the node that voltage will be measured from.
neuronnumber=1
nodenumber=40
myintra=Intracellular(neuronnumber,nodenumber)
Alternatively, you can specific a physical location in 3D and JNeuron will find the closest intracellular node in a given neuron.
neuronnumber=1
myposition=[400.0,50.0,50.0]
myintra=Intracellular(neuronnumber,myposition)
Extracellular¶
Theory¶
Extracellular electrodes measure the voltage at a given location in your network. If we assume quasistatics, we can find voltage by the superposition of voltages created by each piece of membrane current. Our neuron structure makes the natural “pieces” of membrane current to the current that is calculated for each node. We then can consider approximations to how the current is distributed over each node. The following are taken from Linden et al 2014.
Point Source¶
The simplest model of each node would be a point source:
where \(\phi\) is a potential at position \(\textbf{r}\) generated by pieces of membrane with current \(I_n(t)\) at positions \(\textbf{r}_n\) with extracellular conductivity \(\sigma\) in between.
Line Source¶
Instead of a point, we could consider the current distributed over a line with length equal to the length of each nodal segment:
Where \(\Delta s_n\) is the length of the segment, \(h_n\) is the longitudinal distance from the end of the segment to the electrode location, \(\rho\) is the perpendicular distance from the segment to the electrode, and \(l_n\) is the longitudinal distance from the beginning of the segment to the electrode location. This is the default method in JNeuron.
Mixed Method¶
You can also combine the above to model the soma as a point source and the remaining segments from dendrites and axons as lines:
Finite Electrode Size¶
To be added...
Implementation¶
In JNeuron, you can place as many extracellular electrodes as you want, and after a simulation is run, they will store the voltage over time that is calculated given your network of neurons. Extracellular electrodes are defined by 1) their position in 3D space, and 2) collection of coefficients relating the voltage seen at this electrode to the membrane currents along the nodes of a particular neuron.
From above, the coefficients are calculated by all of the terms in the above equation that get multiplied by membrane current to get voltage. So if your network includes a neuron with 50 nodes, a neuron with 75 nodes, and a neuron with 60 nodes, your extracellular electrode will contain 3 collections of coefficients, the first with 50 coefficients, second with 75 and third with 60. The coefficients are calculated behind the scenes based on the method of voltage calculation being used; the user only needs to specify the position of the electrode:
position=[500.0, 300.0, 100.0]
myelectrode=Extracellular(position)
The electrode can be easily added to a network:
add_electrode!(mynetwork,myelectrode)