how to display 3d coordinates of a segment

 Posts: 8
 Joined: Sun Jun 12, 2005 10:41 am
 Location: University of North Florida
how to display 3d coordinates of a segment
I would like to display the threedimensional coordinates of a position x in a section of a neuron model defined by a pt3d list. The particular model I'm using right now is the layer 2/3 pyramid from Mainen and Sejnowski's patdemo.zip, but I'd like to know how to do it in general. Can x3d, y3d, and z3d be made to do this?
Any help would be appreciated.
Thanks
John Anderson
Any help would be appreciated.
Thanks
John Anderson

 Site Admin
 Posts: 5619
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: how to display 3d coordinates of a segment
Code: Select all
secname for i=0,n3d()1 print i, x3d(i), y3d(i), z3d(i), diam3d(i)

 Posts: 8
 Joined: Sun Jun 12, 2005 10:41 am
 Location: University of North Florida
Re: how to display 3d coordinates of a segment
Thanks for the prompt response. I want to know the xyz coordinates of segment centers.
ja
ja

 Site Admin
 Posts: 5619
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: how to display 3d coordinates of a segment
The meaning of this concept is somewhat ambiguous. A simple operational definition that might be adequate for some applications starts by treating a section as a series of straight line segments whose endpoints are specified by the 3d points. Calculate the "range" (normalized distance from the 0 end) of each of these points. Then the xyz coordinates that correspond to any r in [0,1] can be found by this algorithm:the xyz coordinates of segment centers
Code: Select all
if r corresponds to the range of any 3d point, return the coordinates of that point
otherwise find the pair of 3d points whose line segment contains r, then apply linear interpolation to determine the xyz coordinates of r
http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip
The file interpxyz.hoc contains a procedure that finds the coordinates of internal nodes.

 Posts: 8
 Joined: Sun Jun 12, 2005 10:41 am
 Location: University of North Florida
Re: how to display 3d coordinates of a segment
What are the "nodes" referred to in interpxyz.hoc?

 Site Admin
 Posts: 5619
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: how to display 3d coordinates of a segment
Points in space at which the system equations are solved. The macroscopic physical world appears to be continuous in both space and time, and is described by partial differential equations. In order to compute an approximate solution to these equations, they are first discretized in space to produce a set of ordinary differential equations. Each ODE governs the time course of a state variable at a particular location (node) in space. The approximate solution is then computed by numerical integration of the ODEs over a sequence of discrete instants in time.
Each section has its own discretization parameter nseg, which is a whole number that specifies how many internal nodes will be used to represent it (imagine chopping the section into nseg pieces or "segments" of equal length, and placing a node at the midpoint of each segment). For more information about nseg please see
http://www.neuron.yale.edu/neuron/stati ... .html#nseg
or read Chapters 4 and 5 of The NEURON Book, or
Hines, M.L. and Carnevale, N.T. The NEURON simulation environment. Neural Computation 9:11791209, 1997
which you can download from a link at http://www.neuron.yale.edu/neuron/bib/nrnpubs.html
So far we have been discussing only the internal nodes, at which numerical integration is performed. In addition there are nodes at the 0 and 1 ends; membrane potential at those locations is calculated by simple algebra from the potentials at adjacent internal nodes and the corresponding axial resistances.
Each section has its own discretization parameter nseg, which is a whole number that specifies how many internal nodes will be used to represent it (imagine chopping the section into nseg pieces or "segments" of equal length, and placing a node at the midpoint of each segment). For more information about nseg please see
http://www.neuron.yale.edu/neuron/stati ... .html#nseg
or read Chapters 4 and 5 of The NEURON Book, or
Hines, M.L. and Carnevale, N.T. The NEURON simulation environment. Neural Computation 9:11791209, 1997
which you can download from a link at http://www.neuron.yale.edu/neuron/bib/nrnpubs.html
So far we have been discussing only the internal nodes, at which numerical integration is performed. In addition there are nodes at the 0 and 1 ends; membrane potential at those locations is calculated by simple algebra from the potentials at adjacent internal nodes and the corresponding axial resistances.

 Posts: 8
 Joined: Sun Jun 12, 2005 10:41 am
 Location: University of North Florida
Re: how to display 3d coordinates of a segment
Ah. So the coordinates of the nodes would be the coordinates of the midpoints of the segments, which is what I want.
Thanks very much for your help. I will try to implement that algorithm in my model.
ja
Thanks very much for your help. I will try to implement that algorithm in my model.
ja
Re: how to display 3d coordinates of a segment
In case anybody is interested, I figured out how you can do this in Python:
The output is:
Code: Select all
from neuron import h
dend1 = h.Section()
dend2 = h.Section()
dend3 = h.Section()
h.pt3dadd(0,0,0,1,sec=dend1)
h.pt3dadd(1,0,0,1,sec=dend1)
h.pt3dadd(0,0,0,1,sec=dend3)
h.pt3dadd(0,1,0,1,sec=dend3)
for s in dend1,dend2,dend3:
print ''
print 'Printing coordinates for '+ h.secname(sec=s)
print ''
n3d = int(h.n3d(sec=s))
if n3d == 0:
print ' * No coordinates found * '
continue
for i in range(0,n3d):
print ' i: ' + str(i) + ' '
print 'x: ' + str(h.x3d(i,sec=s))
print 'y: ' + str(h.y3d(i,sec=s))
print 'z: ' + str(h.z3d(i,sec=s))
Code: Select all

Printing coordinates for PySec_0x21aa120

 i: 0 
x: 0.0
y: 0.0
z: 0.0
 i: 1 
x: 1.0
y: 0.0
z: 0.0

Printing coordinates for PySec_0x21aa390

* No coordinates found *

Printing coordinates for PySec_0x21aa3f0

 i: 0 
x: 0.0
y: 0.0
z: 0.0
 i: 1 
x: 0.0
y: 1.0
z: 0.0