Hi Ted,
So I'm trying to plot a extracellular field movie space plot. I have done a space plot on e_extracellular vs. a bunch of points on my neuron, but I'm also trying to plot out the field vs. points on my neuron. It should be really easy since it is just the spatial derivative of extracellular voltage, but NEURON only allows me to plot the range variables, not arbitrary functions that are use the variables. Does it mean that I need to write a .mod to create an extracellular field range variable in order to plot it for a movie plot? Thank you!
Movie Space Plot on Derivatives

 Site Admin
 Posts: 5819
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Movie Space Plot on Derivatives
Range variables and mod files are the least of your concerns. Fundamental complications arise before the end of your second sentence.
Before this discussion gets lost in the weeds, two key points must be addressed.
1. A space plot only makes sense for a scalar. Potential is a scalar, but electrical field is notelectrical field has both magnitude and orientation.
2. What generates the field you're interested inthe membrane current of the cell itself, or current injected into the medium by one or more stimulating electrodes?
Stop right there. "'Just' the spatial derivative of extracellular voltage" is easy only if the model is 1 dimensional and extracellular current is constrained to flow along a 1 dimensional path, so that the orientation of the field vector is known. Otherwise it is necessary to calculate the gradient of electrical potential in a volume conductor, which requires knowledge of how potential varies with position in a volume conductor.pass1945 wrote:I'm also trying to plot out the field vs. points on my neuron. It should be really easy since it is just the spatial derivative of extracellular voltage
Before this discussion gets lost in the weeds, two key points must be addressed.
1. A space plot only makes sense for a scalar. Potential is a scalar, but electrical field is notelectrical field has both magnitude and orientation.
2. What generates the field you're interested inthe membrane current of the cell itself, or current injected into the medium by one or more stimulating electrodes?
Re: Movie Space Plot on Derivatives
Hi Ted,
You are right on the fact that electrical field is a vector (both value and directions). I guess both my PI and I just wanted to see the field on xy directions.
You are right on the fact that electrical field is a vector (both value and directions). I guess both my PI and I just wanted to see the field on xy directions.
I'm interested in the extracellular field due to the membrane current. Basically I inject a current into the CELL, not the medium, and then collect the membrane current from this cell in order to use it to stimulate another cell. This is called the ephaptic effect. So if I want to just concern about the electrical field on xy direction (2D, on the plane of the computer, since in my model I'm only concerned on 2D for now), how can I do that then? Then I guess my movie plot would have to be a 3D movie plot, x, y, and extracellular field on z. Or maybe I can do one of those color changing plots that when value is big, it goes to one color, and when the value is low it goes to another. Do you think this would work?ted wrote: 2. What generates the field you're interested inthe membrane current of the cell itself, or current injected into the medium by one or more stimulating electrodes?

 Site Admin
 Posts: 5819
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Movie Space Plot on Derivatives
A 2d field is still a vector field, characterized by orientation and magnitude. For each time of interest, you'll have to calculate the potential at each point in a 2 d array that covers the region of interest, then determine the gradient at each point, and finally render it in a way that is readily grasped. NEURON can give you the time course of membrane current density generated by each segment (available from the extracellular mechanism's i_membrane), the surface area of each segment (available from hoc), and the spatial location of each segment (various ways to get this depending on whether you just want segment centers or prefer the line source approach used by Koch's lab). From this you could use software like COMSOL to calculate the grid of potentials and I am sure there are standard ways to compute the field from such a grid, as well as software for rendering the vector field.