Square like soma: pt3dadd and diam_shape()
Posted: Fri Sep 09, 2011 5:23 am
Oops, I must have clicked on the "edit" button, not the "reply" button. Sorry!
Your original procedure wasand the problem you encountered was that soma still looked like a rectangle in a Shape plot.
I just tried your code with this toy programand the shape plot shows something that looks like an avocado tilted upside down, not a square or rectangle--i.e. your proc is working correctly. Are you sure your own program includes a
shape3d_1()
statement? A procedure that is defined, but not called, doesn't do anything.
(debugging and prettying up the print statements is left as an exercise to the reader). Then
soma report3d()
should reveal the details of soma's geometry specification.
Addendum: instead of diam_shape() the documentation should have referred to define_shape()
http://www.neuron.yale.edu/neuron/stati ... fine_shape
Your original procedure was
Code: Select all
proc shape3d_1() {
soma {
pt3dclear()
pt3dadd(3.99799, -13.8169, 0, 3.78114)
pt3dadd(3.6609, -12.5621, 0, 6.52282)
pt3dadd(3.32381, -11.3073, 0, 9.30135)
pt3dadd(2.98671, -10.0525, 0, 12.0853)
pt3dadd(2.64962, -8.79771, 0, 12.9379)
pt3dadd(2.31253, -7.54291, 0, 14.0505)
pt3dadd(1.97544, -6.28811, 0, 15.1578)
pt3dadd(1.63835, -5.0333, 0, 16.3184)
pt3dadd(1.30126, -3.7785, 0, 17.5492)
pt3dadd(0.964172, -2.5237, 0, 18.5816)
pt3dadd(0.627082, -1.26889, 0, 19.1535)
pt3dadd(0.289992, -0.014091, 0, 19.4979)
pt3dadd(-0.0470988, 1.24071, 0, 19.7899)
pt3dadd(-0.384189, 2.49552, 0, 19.8442)
pt3dadd(-0.72128, 3.75032, 0, 19.5565)
pt3dadd(-1.05837, 5.00512, 0, 18.7229)
pt3dadd(-1.39546, 6.25992, 0, 17.2568)
pt3dadd(-1.73255, 7.51473, 0, 14.7377)
pt3dadd(-2.06964, 8.76953, 0, 12.2293)
pt3dadd(-2.40673, 10.0243, 0, 9.13582)
pt3dadd(-2.74382, 11.2791, 0, 5.09144)
}
}
I just tried your code with this toy program
Code: Select all
load_file("nrngui.hoc")
create soma
proc shape3d_1() {
. . . etc. . . .
}
shape3d_1()
shape3d_1()
statement? A procedure that is defined, but not called, doesn't do anything.
psection() uses the stylized method for describing geometry. The L that it reports will be the total path length along the centroid of the section, and the diam will be the diameter of a cylinder with that length that has the same surface area as the section. If you want to retrieve a section's pt3d data, use x3d, y3d, z3d, diam3d, and n3d--something like this:If I use psection()
Code: Select all
// call in the context of a currently accessed section that has a 3d specification
proc report3d() { local i
printf("%s has %d 3d points\n", secname(), n3d())
print "point x3d y3d z3d diam3d"
for i=0,n3d()-1 print i, x3d(i), y3d(i), z3d(i), diam3d(i)
}
soma report3d()
should reveal the details of soma's geometry specification.
"diam_shape" looks like a mistake to me. There isn't anything with that name. There is a define_shape() procedure and a diam_changed flag. diam_changed is not a procedure, but a variable that is checked by the interpreter; should it ever become nonzero, the interpreter recalculates the coefficient matrix and resets diam_changed to 0--but as the Programmer's Reference indicates, it doesn't do anything useful in recent versions of NEURON.When I looked to the reference index of pt3dadd I found the following statement.
"Note: When L is changed, diam_shape() should be executed to adjust the 3-d info so that branches appear connected"
what does this sentence mean? I tried to execute diam_shape()
Addendum: instead of diam_shape() the documentation should have referred to define_shape()
http://www.neuron.yale.edu/neuron/stati ... fine_shape