Qroid_montreal wrote:Is it right that values from x3d(), y3d() and z3d() are relative to the root section?
Not necessarily. The advent of "logical connections" as a way to improve the cosmetics of some detailed morphometric reconstructions (see
http://www.neuron.yale.edu/neuron/stati ... #pt3dstyle) has complicated things a bit. To understand this, use the CellBuilder to make a toy model that consists of a 10x10 um soma to which a 1um diameter, 100um long dendrite is attached, export a template from it, then exit neuron. Now restart NEURON, xopen the template's hoc file, and execute
objref foo
foo = new TestCell() // I called the cell class "TestCell"
Then at the oc> prompt execute
forall {print secname() for i=0,n3d()-1 print x3d(i), y3d(i), z3d(i)}
The result I got was
TestCell[0].soma
0 0 0
10 0 0
TestCell[0].dend
15 0 0
115 0 0
I'm not surprised that soma and dend are horizontal; that's how I drew them. Also it's good to see that their lengths are 10 and 100 um, respectively. What does surprise me is that dend's 0 end does not have the same x coordinate as soma's 1 end, to which it is connected electrically.
Next I executed
foo.position(-1,-2,-3)
then executed
forall {print secname() for i=0,n3d()-1 print x3d(i), y3d(i), z3d(i)}
and the new result was
TestCell[0].soma
-1 -2 -3
9 -2 -3
TestCell[0].dend
15 0 0
115 0 0
so TestCell's position method affected only soma's coordinates, not dend's.
Finally, I executed
define_shape()
and now
forall {print secname() for i=0,n3d()-1 print x3d(i), y3d(i), z3d(i)}
generated
TestCell[0].soma
-1
9
TestCell[0].dend
9
109
What this means:
1. pt3d specification of one section's geometry will affect that section, but does not necessarily affect the 3d data associated with any other section.
2. define_shape() adjusts the 3d data associated with a child section so that (a) the first 3d point of the child section is at the same location as the parent, and (b) the other 3d points that belong to the child section are translated so that the child section's shape and orientation are preserved.
Now I changed the soma's position again
Code: Select all
oc>foo.position(0,0,0)
0
oc>forall {print secname() for i=0,n3d()-1 print x3d(i), y3d(i), z3d(i)}
TestCell[0].soma
0 0 0
10 0 0
TestCell[0].dend
9 -2 -3
109 -2 -3
The soma moved, but not dend! No surprise really, and neither is this:
Code: Select all
oc>define_shape()
1
oc>forall {print secname() for i=0,n3d()-1 print x3d(i), y3d(i), z3d(i)}
TestCell[0].soma
0 0 0
10 0 0
TestCell[0].dend
10 0 0
110 0 0
"Does this mean define_shape() should be executed after executing a model specification that uses pt3d, or after using pt3dchange to change the location of a section?"
Only if it is important that that all of the sections in your model are in their correct spatial locations relative to each other, e.g. if you are simulating extracellular stimulation or recording.
I should mention that the mere existence of a Shape or PlotShape obviates the need to call define_shape(). Continuing with the same example as above,
Code: Select all
oc>objref sh
oc>sh = new Shape() // creates a Shape plot
oc>foo.position(-1,-2,-3)
At this point, if there were no shape plot, I'd expect that dend's coordinates would still be
10 0 0
110 0 0
but the existence of a shape plot means that "moving" the soma will also update the pt3d data associated with all sections
Code: Select all
oc>forall {print secname() for i=0,n3d()-1 print x3d(i), y3d(i), z3d(i)}
TestCell[0].soma
-1 -2 -3
9 -2 -3
TestCell[0].dend
9 -2 -3
109 -2 -3
The bottom line: if it is important that all pt3d-specified sections have the "correct" pt3d data, either call
define_shape()
after executing any statement that affects the 3d specification, or just make sure that a Shape or PlotShape exists.