Square like soma: pt3dadd and diam_shape()

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
tine
Posts: 10
Joined: Thu Jan 13, 2011 2:18 pm

Square like soma: pt3dadd and diam_shape()

Post by tine »

Oops, I must have clicked on the "edit" button, not the "reply" button. Sorry!

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)
  }
}
and the problem you encountered was that soma still looked like a rectangle in a Shape plot.

I just tried your code with this toy program

Code: Select all

load_file("nrngui.hoc")
create soma
proc shape3d_1() {
 . . . etc. . . .
}

shape3d_1()
and 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.
If I use psection()
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:

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)
}
(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.
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()
"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.

Addendum: instead of diam_shape() the documentation should have referred to define_shape()
http://www.neuron.yale.edu/neuron/stati ... fine_shape
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Square like soma: pt3dadd and diam_shape()

Post by ted »

This reply has two purposes: first, to apologize again for wiping out your original post, and second, to trick the Forum into notifying you of activity in this thread.
Bill Connelly
Posts: 86
Joined: Thu May 22, 2008 11:54 pm
Location: Australian National University

Re: Square like soma: pt3dadd and diam_shape()

Post by Bill Connelly »

I believe I'm having a very similar problem. I'm trying to borrow the geometry of Bill Lyton's model here

When I bring up a shape plot, it appears as if there is no soma, however, if I rotate the model, I can see the soma is there. i.e. it appears to be 2d.

I checked that the soma appears to have the right specifications with n3d() and diam3d() and they all seem correct, and soma.diam and psection() give back reasonable numbers. Looking at how electrical signals propagate, the soma doesn't behave electrically like it is 2D (i.e. it has a finite, and reasonable resistance). Any thoughts on what is going on here?

It looks like this when rotated
Image

The important bit of the code is:

Code: Select all

create soma, dend[ndend]
access soma

//connecting up soma and dendrites removed

soma {
  pt3dadd(27, -6.5, 0.000, 0.001)
  pt3dadd(27, -6.5, 6.750, 14.197)
  pt3dadd(27, -6.5, 14.250, 17.042)
  pt3dadd(27, -6.5, 19.500, 17.924)
  pt3dadd(27, -6.5, 21.750, 17.813)
  pt3dadd(27, -6.5, 29.250, 12.720)
  pt3dadd(27, -6.5, 36.000, 0.001)
}
and most of it is here

Code: Select all

/* $Id: rlgntc5-10-95.hoc,v 1.2 2003/10/08 15:10:52 billl Exp $ */
ndend = 195
create soma, dend[ndend]
access soma
  
connect dend[0](0), soma(0.5)
connect dend[1](0), dend[0](1)
connect dend[2](0), dend[0](1)
connect dend[3](0), soma(0.5)
connect dend[4](0), dend[3](1)
connect dend[5](0), dend[3](1)
connect dend[6](0), dend[5](1)
connect dend[7](0), dend[5](1)
connect dend[8](0), soma(0.5)
connect dend[9](0), dend[8](1)
connect dend[10](0), dend[9](1)
connect dend[11](0), dend[10](1)
connect dend[12](0), dend[11](1)
connect dend[13](0), dend[11](1)
connect dend[14](0), dend[10](1)
connect dend[15](0), dend[9](1)
connect dend[16](0), dend[8](1)
connect dend[17](0), dend[16](1)
connect dend[18](0), dend[17](1)
connect dend[19](0), dend[17](1)
connect dend[20](0), dend[16](1)
connect dend[21](0), dend[20](1)
connect dend[22](0), dend[20](1)
connect dend[23](0), dend[8](1)
connect dend[24](0), dend[23](1)
connect dend[25](0), dend[24](1)
connect dend[26](0), dend[24](1)
connect dend[27](0), dend[26](1)
connect dend[28](0), dend[27](1)
connect dend[29](0), dend[27](1)
connect dend[30](0), dend[26](1)
connect dend[31](0), dend[23](1)
connect dend[32](0), soma(0.5)
connect dend[33](0), dend[32](1)
connect dend[34](0), dend[33](1)
connect dend[35](0), dend[34](1)
connect dend[36](0), dend[34](1)
connect dend[37](0), dend[33](1)
connect dend[38](0), dend[37](1)
connect dend[39](0), dend[37](1)
connect dend[40](0), dend[39](1)
connect dend[41](0), dend[40](1)
connect dend[42](0), dend[40](1)
connect dend[43](0), dend[39](1)
connect dend[44](0), dend[43](1)
connect dend[45](0), dend[43](1)
connect dend[46](0), dend[32](1)
connect dend[47](0), dend[46](1)
connect dend[48](0), dend[47](1)
connect dend[49](0), dend[48](1)
connect dend[50](0), dend[48](1)
connect dend[51](0), dend[47](1)
connect dend[52](0), dend[46](1)
connect dend[53](0), dend[46](1)
connect dend[54](0), dend[53](1)
connect dend[55](0), dend[53](1)
connect dend[56](0), dend[55](1)
connect dend[57](0), dend[55](1)
connect dend[58](0), dend[57](1)
connect dend[59](0), dend[57](1)
connect dend[60](0), dend[59](1)
connect dend[61](0), dend[59](1)
connect dend[62](0), soma(0.5)
connect dend[63](0), dend[62](1)
connect dend[64](0), dend[63](1)
connect dend[65](0), dend[64](1)
connect dend[66](0), dend[65](1)
connect dend[67](0), dend[66](1)
connect dend[68](0), dend[66](1)
connect dend[69](0), dend[65](1)
connect dend[70](0), dend[64](1)
connect dend[71](0), dend[70](1)
connect dend[72](0), dend[71](1)
connect dend[73](0), dend[71](1)
connect dend[74](0), dend[70](1)
connect dend[75](0), dend[63](1)
connect dend[76](0), dend[75](1)
connect dend[77](0), dend[76](1)
connect dend[78](0), dend[77](1)
connect dend[79](0), dend[77](1)
connect dend[80](0), dend[76](1)
connect dend[81](0), dend[75](1)
connect dend[82](0), dend[81](1)
connect dend[83](0), dend[82](1)
connect dend[84](0), dend[82](1)
connect dend[85](0), dend[84](1)
connect dend[86](0), dend[84](1)
connect dend[87](0), dend[86](1)
connect dend[88](0), dend[86](1)
connect dend[89](0), dend[88](1)
connect dend[90](0), dend[88](1)
connect dend[91](0), dend[90](1)
connect dend[92](0), dend[90](1)
connect dend[93](0), dend[90](1)
connect dend[94](0), dend[81](1)
connect dend[95](0), dend[62](1)
connect dend[96](0), soma(0.5)
connect dend[97](0), dend[96](1)
connect dend[98](0), dend[97](1)
connect dend[99](0), dend[98](1)
connect dend[100](0), dend[99](1)
connect dend[101](0), dend[99](1)
connect dend[102](0), dend[98](1)
connect dend[103](0), dend[102](1)
connect dend[104](0), dend[102](1)
connect dend[105](0), dend[97](1)
connect dend[106](0), dend[105](1)
connect dend[107](0), dend[105](1)
connect dend[108](0), dend[96](1)
connect dend[109](0), dend[108](1)
connect dend[110](0), dend[109](1)
connect dend[111](0), dend[109](1)
connect dend[112](0), dend[111](1)
connect dend[113](0), dend[112](1)
connect dend[114](0), dend[112](1)
connect dend[115](0), dend[114](1)
connect dend[116](0), dend[114](1)
connect dend[117](0), dend[111](1)
connect dend[118](0), dend[111](1)
connect dend[119](0), dend[108](1)
connect dend[120](0), dend[119](1)
connect dend[121](0), dend[119](1)
connect dend[122](0), dend[121](1)
connect dend[123](0), dend[121](1)
connect dend[124](0), dend[119](1)
connect dend[125](0), soma(0.5)
connect dend[126](0), dend[125](1)
connect dend[127](0), dend[125](1)
connect dend[128](0), dend[127](1)
connect dend[129](0), dend[128](1)
connect dend[130](0), dend[129](1)
connect dend[131](0), dend[130](1)
connect dend[132](0), dend[131](1)
connect dend[133](0), dend[131](1)
connect dend[134](0), dend[133](1)
connect dend[135](0), dend[133](1)
connect dend[136](0), dend[130](1)
connect dend[137](0), dend[136](1)
connect dend[138](0), dend[136](1)
connect dend[139](0), dend[138](1)
connect dend[140](0), dend[139](1)
connect dend[141](0), dend[139](1)
connect dend[142](0), dend[139](1)
connect dend[143](0), dend[138](1)
connect dend[144](0), dend[129](1)
connect dend[145](0), dend[144](1)
connect dend[146](0), dend[145](1)
connect dend[147](0), dend[145](1)
connect dend[148](0), dend[144](1)
connect dend[149](0), dend[128](1)
connect dend[150](0), dend[149](1)
connect dend[151](0), dend[150](1)
connect dend[152](0), dend[150](1)
connect dend[153](0), dend[152](1)
connect dend[154](0), dend[152](1)
connect dend[155](0), dend[149](1)
connect dend[156](0), dend[149](1)
connect dend[157](0), dend[156](1)
connect dend[158](0), dend[156](1)
connect dend[159](0), dend[158](1)
connect dend[160](0), dend[158](1)
connect dend[161](0), dend[127](1)
connect dend[162](0), soma(0.5)
connect dend[163](0), dend[162](1)
connect dend[164](0), dend[163](1)
connect dend[165](0), dend[163](1)
connect dend[166](0), dend[165](1)
connect dend[167](0), dend[166](1)
connect dend[168](0), dend[167](1)
connect dend[169](0), dend[168](1)
connect dend[170](0), dend[169](1)
connect dend[171](0), dend[170](1)
connect dend[172](0), dend[170](1)
connect dend[173](0), dend[169](1)
connect dend[174](0), dend[168](1)
connect dend[175](0), dend[167](1)
connect dend[176](0), dend[166](1)
connect dend[177](0), dend[176](1)
connect dend[178](0), dend[176](1)
connect dend[179](0), dend[165](1)
connect dend[180](0), dend[179](1)
connect dend[181](0), dend[179](1)
connect dend[182](0), dend[179](1)
connect dend[183](0), dend[182](1)
connect dend[184](0), dend[182](1)
connect dend[185](0), dend[182](1)
connect dend[186](0), dend[162](1)
connect dend[187](0), dend[186](1)
connect dend[188](0), dend[187](1)
connect dend[189](0), dend[188](1)
connect dend[190](0), dend[188](1)
connect dend[191](0), dend[187](1)
connect dend[192](0), dend[186](1)
connect dend[193](0), dend[192](1)
connect dend[194](0), dend[192](1)
  
soma {
  pt3dadd(27, -6.5, 0.000, 0.001)
  pt3dadd(27, -6.5, 6.750, 14.197)
  pt3dadd(27, -6.5, 14.250, 17.042)
  pt3dadd(27, -6.5, 19.500, 17.924)
  pt3dadd(27, -6.5, 21.750, 17.813)
  pt3dadd(27, -6.5, 29.250, 12.720)
  pt3dadd(27, -6.5, 36.000, 0.001)
}
dend[0] {
   pt3dadd(32.386, -0.068, 30.458, 1.110)
   pt3dadd(34.216, 1.284, 30.458, 1.110)
   pt3dadd(33.932, 2.750, 30.458, 1.110)
   pt3dadd(32.989, 4.602, 30.458, 1.110)
   pt3dadd(32.523, 5.420, 30.458, 0.930)
   pt3dadd(33.080, 6.920, 30.458, 0.930)
   pt3dadd(34.523, 7.625, 30.458, 0.930)
   pt3dadd(36.170, 8.341, 30.458, 0.740)
   pt3dadd(36.761, 9.215, 30.458, 0.560)
   pt3dadd(36.102, 9.602, 30.458, 0.560)
   pt3dadd(35.216, 10.614, 30.458, 0.740)
   pt3dadd(34.114, 11.398, 30.458, 0.740)
   pt3dadd(33.250, 11.989, 30.458, 0.560)
   pt3dadd(32.784, 12.807, 30.458, 0.370)
   pt3dadd(32.716, 14.068, 30.458, 0.370)
   pt3dadd(31.807, 15.500, 30.458, 0.560)
   pt3dadd(31.330, 16.523, 30.458, 0.740)
   pt3dadd(30.443, 17.318, 30.458, 0.740)
   pt3dadd(29.545, 18.533, 30.458, 0.740)
   pt3dadd(29.250, 20.000, 30.458, 0.560)
   pt3dadd(29.000, 20.830, 30.458, 0.740)
   pt3dadd(29.352, 22.114, 30.458, 0.740)
   pt3dadd(29.318, 22.955, 30.458, 0.740)
   pt3dadd(29.886, 24.034, 30.458, 1.300)
   pt3dadd(29.648, 24.659, 30.458, 1.480)
   pt3dadd(29.602, 25.500, 30.458, 1.480)
}
dend[1] {
   pt3dadd(29.602, 25.500, 30.458, 1.480)
   pt3dadd(28.932, 26.307, 30.458, 1.300)
   pt3dadd(28.273, 26.898, 30.458, 0.930)
   pt3dadd(27.784, 28.148, 30.458, 0.740)
   pt3dadd(28.170, 28.795, 30.458, 0.560)
   pt3dadd(28.739, 30.091, 30.458, 0.560)
   pt3dadd(28.489, 30.920, 30.458, 0.560)
   pt3dadd(26.920, 32.739, 30.458, 0.560)
   pt3dadd(26.000, 34.159, 32.188, 0.740)
   pt3dadd(25.955, 35.216, 32.188, 0.740)
   pt3dadd(26.500, 36.716, 32.188, 0.740)
   pt3dadd(26.205, 38.386, 32.188, 0.740)
   pt3dadd(25.625, 41.523, 32.188, 0.740)
   pt3dadd(24.705, 43.159, 32.188, 0.560)
   pt3dadd(24.432, 44.409, 32.188, 0.740)
   pt3dadd(24.341, 46.091, 32.188, 0.930)
   pt3dadd(24.477, 47.568, 32.188, 0.740)
   pt3dadd(24.830, 48.852, 32.188, 0.740)
   pt3dadd(24.102, 50.716, 32.188, 0.740)
   pt3dadd(23.375, 52.568, 32.188, 0.560)
   pt3dadd(23.125, 53.398, 32.188, 0.740)
   pt3dadd(24.318, 54.727, 32.188, 0.740)
   pt3dadd(25.534, 55.636, 32.188, 0.560)
   pt3dadd(26.102, 56.920, 32.188, 0.740)
   pt3dadd(26.239, 58.409, 32.188, 0.560)
   pt3dadd(24.898, 60.023, 32.188, 0.560)
   pt3dadd(25.227, 61.727, 32.188, 0.560)
   pt3dadd(25.807, 62.807, 32.188, 0.930)
   pt3dadd(27.182, 64.773, 32.188, 0.930)
   pt3dadd(27.534, 66.057, 34.708, 0.560)
   pt3dadd(26.841, 67.284, 34.708, 0.560)
   pt3dadd(26.750, 68.966, 34.708, 0.560)
   pt3dadd(26.670, 70.648, 34.708, 0.740)
   pt3dadd(27.443, 71.955, 34.708, 0.740)
   pt3dadd(28.489, 72.216, 34.708, 0.560)
   pt3dadd(29.523, 72.477, 34.708, 0.560)
   pt3dadd(31.216, 72.352, 34.708, 0.560)
   pt3dadd(32.909, 72.227, 34.708, 0.560)
   pt3dadd(35.795, 73.432, 34.708, 0.560)
   pt3dadd(37.250, 73.739, 32.917, 0.740)
   pt3dadd(38.511, 73.739, 32.917, 0.740)
   pt3dadd(40.193, 74.159, 32.917, 0.740)
   pt3dadd(41.670, 74.784, 32.917, 0.740)
   pt3dadd(42.511, 76.045, 32.917, 0.740)
   pt3dadd(43.773, 77.102, 32.917, 0.560)
   pt3dadd(44.398, 77.727, 42.917, 0.370)
   pt3dadd(44.614, 78.159, 42.917, 0.370)
   pt3dadd(43.977, 79.420, 42.917, 0.370)
   pt3dadd(44.193, 79.625, 42.917, 1.110)
   pt3dadd(42.932, 79.625, 42.917, 1.110)
   pt3dadd(43.352, 80.466, 42.333, 1.110)
   pt3dadd(42.932, 82.148, 42.333, 1.110)
}
dend[2] {
   pt3dadd(29.602, 25.500, 30.458, 1.480)
// too much code just like this...
  
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Square like soma: pt3dadd and diam_shape()

Post by ted »

Bill Connelly wrote:I believe I'm having a very similar problem.
Probably not, but this suggests a bug in InterViews's rendering code. Look at the xyz coordinates for the soma's pt3dadd statements in that cell you're trying to use--those would be the first 3 arguments to pt3dadd. Note that only the z values (3rd argument) and diameters (5th argument) change. A new Shape plot renders the cell projected onto the xy plane, i.e. you're looking right down the z axis. In that orientation, for some reason or other, InterViews isn't shading in the xy projections of the somatic surface.
Bill Connelly
Posts: 86
Joined: Thu May 22, 2008 11:54 pm
Location: Australian National University

Re: Square like soma: pt3dadd and diam_shape()

Post by Bill Connelly »

Yes, I wondered about that...

Okay, so a more general question, how does NEURON take the x,y,z,diam and decide which axis to throw the diam out in? i.e. it's easy to think about when, like in this example, only the z axis is changing, so you get a straight line, with a series of truncated cones... Or is that how it does it.. between any two 3d points there is a straight line, and the cone is formed around that?
hines
Site Admin
Posts: 1692
Joined: Wed May 18, 2005 3:32 pm

Re: Square like soma: pt3dadd and diam_shape()

Post by hines »

For drawing speed, the 3-d centroid is projected onto the canvas and the diameter is drawn continuously normal to that line. Sadly, there is no attempt to draw the circular
cross section when
the projection centroid becomes very short. You don't normally notice this because most soma's are designed with an x direction centroid so they look good in the default
xy projection plain. They also look good in the xz projectiion plane but disappear in the yz projection plane.
Post Reply