wlkath wrote:What format should a swc soma have to convert properly to hoc using Import3D?
The question is, what formats can Import3d handle properly despite the best attempts of those who create morphometric data files to screw things up.
The chief problem with swc format is that it is not a completely specified file format. The most serious issue is lack of a uniform policy for how the soma should be digitized.
Dead wrong IMHO is to try to describe the soma as a pair of cylinders protruding in opposite directions from a center point, but that appears to be what is going on with THINSTAR.CNG.swc (or maybe it happened when the original morphometric data were cleaned up for NeuroMorpho.org). To see this for yourself, import that file, then in the Import3d tool do the following:
View type / Root sections
zoom in on the soma until it appears to be a filled black circle about 1 inch in diameter
enter 1 in the numerical field next to the Select id button and hit return
note that the red dot is right in the center of the black circle
use Select id's spinner to increase the point index to 2
note that the red dot is now at the top of the circle
increment the point index to 3
red dot is now at the bottom of the circle
Look at the output in NEURON's interpreter window and note these three lines:
Line 25: 1 1 -0.7 -0.16 0 6.145 -1
Line 26: 2 1 -0.7 5.97 0 6.145 1
Line 27: 3 1 -0.7 -6.31 0 6.145 1
The data format is
line_number datum_type x y z radius parent_index
As near as one can infer intent from the contents of an uncommented bunch of numbers, it appears that the user was trying to to describe the soma as two 6.145 um diameter cylinders pointing in opposite directions from the root point (specified by line 25).
What kind of soma specification results from importing this morphology? Exporting to a CellBuilder, saving that to a ses file, exiting NEURON, then restarting and loading that ses file and putting the CellBuilder in Continuous Create mode, here's what happened to the soma data:
oc>soma for i=0,n3d()-1 print i, x3d(i), y3d(i), z3d(i), diam3d(i)
0 -6.8449998 -0.16 0 12.29
1 -0.69999999 -0.16 0 12.29
2 5.4450002 -0.16 0 12.29
Note that the soma's x and y axes are swapped but the lengths and diameters are correct (the x and y axes of the rest of the cell are _not_ swapped). Also note that the origin of the model cell is the end of the soma that has the most negative x value. From this I expect that the soma would have converted without complaint if the digitizing wallah had only started at one end of the soma and proceeded in orderly fashion toward the other end along a path that did not reverse direction. That said, people will do what they will do, so it is good that NEURON's Import3d knows enough to do the right thing.
Whether it also does the right thing by the "single point soma example" depends on how one interprets the provided example. The second line of those data is for a point of "unknown" type. What the heck does that mean? Import3d takes it to specify the proximal end of a dendritic tree that is attached to the soma. IMO (not so humble this time), in the absence of any advice to the contrary from the person who generated that data file, the meaning of line 2 is whatever the user of the data decides to call it. Import3d prints a message to NEURON's interpreter window that says how it dealt with that line and concludes with this statement
"If this is an incorrect guess, then change the file."
All this is yet another reason to be cautious about morphometric data. None of it is perfect*, and the only question is: are the imperfections benign (tolerable for your intended use) or deleterious to the point that one is forced to either make a "best judgment intervention" (read "justified hack" to fix the problem) or abandon that file and look for a different one.
*--Disclaimer: I don't want anatomists to feel unfairly singled out for criticism. No biophysical data is perfect either. I'd better stop before I say anything about model source code or simulation results, and lose whatever friends I may have left in the neuroscience community.