I want to make sure I understand why interpxyz.hoc is necessary in your extracellular_stim_and_rec code (found here: http://www.neuron.yale.edu/phpBB/viewto ... f=28&t=168). In particular, it seems to my naive eyes that define_shape() already calculates the interpolated 3D coordinates at each node of each segment, rendering interpxyz.hoc superfluous. In your April 4 post in this thread:
viewtopic.php?f=8&t=3627&p=15469&hilit= ... ape#p15469
you state that "The number of 3d points that you use to define the geometry of any section has nothing to do with that section's spatial discretization parameter nseg." And yet I have written a toy model that defines 3D points using the stylized geometry in conjunction with define_shape(), and after calling define_shape() the interpolated centers of the nodes have already been defined. Here is my code:
Code: Select all
from neuron import h, gui
soma=h.Section(name='soma')
dend=h.Section(name='dend')
soma.diam = soma.L = 20 #microns
soma.nseg = 3
dend.diam = 2 #microns
dend.L=200 #microns
#insert extracellulra and xtra mechanisms
soma.insert('extracellular')
soma.insert('xtra')
dend.insert('extracellular')
dend.insert('xtra')
#define connectivity between sections
dend.connect(soma,0,0) #connect 0 end of Bdend to 0 end of soma
h.define_shape()
for sec in h.allsec():
print "section=",sec.name() #or use print h.secname()
for i in xrange(int(h.n3d())): print i, h.x3d(i), h.y3d(i), h.z3d(i), h.diam3d(i)
section= soma
0 0.0 0.0 0.0 20.0
1 3.33333325386 0.0 0.0 20.0
2 10.0 0.0 0.0 20.0
3 16.6666660309 0.0 0.0 20.0
4 20.0 0.0 0.0 20.0
section= dend
0 0.0 0.0 0.0 2.0
1 -100.0 8.74227771419e-06 0.0 2.0
2 -200.0 1.74845554284e-05 0.0 2.0
So define_shape() has already calculated the interpolated centers of each segment of the 'soma' section (in addition to the coordinates at both ends). What is the point of doing this entire calculation all over again in interpxyz.hoc? I do see that the end of interpxyz.hoc defines the x, y, and z range variables of the 'xtra' mechanism, but why not simply copy the information we already have from calling define_shape(), rather than re-doing the entire calculation?
I just want to make sure I am not missing something regarding the purpose of interpxyz.hoc. Thanks.