I'm working on converting some NML files created in Webknossos into a format that I can import into NEURON. I did not find any ready-made solutions that seemed to give me what I need
Have you considered
https://github.com/nathantspencer/webknossos_toolkit ? Hard to know the quality and actual utility of any of these things, but this particular repo includes nml2swc and some "swc_tools" that may be useful e.g. swc2hoc. I don't know the author or anything about his programs.
NEURON's Import3d GUI tool works well, and when it generates real comments/warnings/error messages, those are generally informative and helpful. Too bad it's generating a popup window that warns even if there are no errors.
I'm not a big fan of "automated conversion" of morphometric data to Python or hoc code. A lot of the people who do that seem to come from the physical sciences or math, simply don't know what they don't know about cellular neuroanatomy or quantitative morphometry, and aren't collaborating with anyone who has expertise in these areas. Ditto for too many of those who will review and/or read whatever papers come out of their work. You have to wonder about big interdisciplinary computational studies on topics that really matter, like . . .
I've been first experimenting with some simple dummy data to make sure I understand how import works
Excellent.
most of the time, I get the error window below . . . even if import seems to work (though there's no output to the terminal). I downloaded a SWC file from Neuromorpho.org and got the same error
You are right to be concerned. Every tool has a learning curve. Never use a new tool for serious work unless you know how to use it.
Here I must ask what version of NEURON you're using, and what SWC file you downloaded and from where.
Regarding the "simple dummy data" in your post--
First, did you develop this de novo, or is it an excerpt from a morphometric data file you picked up somewhere (and where would that be, but I repeat myself)?
Go ahead and use Import3d to read that file. True, the terminal shows no error messages. But does that mean all is well? Here are a couple of simple tests.
Click on Export / CellBuilder
In the CellBuilder click on the Continuous Create button.
Now at the oc> prompt enter the command
topology()
You should see something like this
Code: Select all
oc>topology()
|-| soma(0-1)
`| dend[0](0-1)
`| dend[2](0-1)
`| dend[1](0-1)
i.e. the root section is soma, and it looks like the 0 ends of dend[0] and [1] are attached to soma's 1 end, and the 0 end of dend[2] is attached to dend[0]'s 1 end. Is that what you expected?
Next execute
forall psection()
Note that psection() reports that dend[0] and [1] are actually attached to soma's middle (0.5)--and if you look at the Import3d tool's canvas, you'll see the "nodes" (locations at which the morphometric data file specifies xyzdiam data), where the solid blue square corresponds to the root node (coords in the first line of swc data) and the hollow blue squares are the other nodes, and sure enough, the proximal end of
Also check the L and diam values. Are they what you expected?
WRT the gap in your shape plot--my guess is that you got this data from NeuroMorpho, and the nice people at NeuroMorpho have spiffed it up in a way that accounts for the strange appearance. Let me know if that's the case, and we can discuss this particular aspect further.
BTW, you can use the Import3d tool to walk through the morphometric data file (and highlight the corresponding node in the Import3d's canvas with a red dot) by clicking on the up or down arrow next to the "Select id" button.
whether it's better to "over-specify" the morphology or stick to a simpler representation
You're trying to decide whether to use the "stylized specification" (of L and diam) or the "3d specification" (using pt3dadd statements).[/quote]Depends on what you plan to do. If this raises proprietary issues, or requires a long discussion, it might be best to continue via email.
(does/can NEURON interpolate between nodes?)
Not sure what you mean by this question.
I'm making these skeletons myself, so I have flexibility over how coarse or fine they can be.
Good. You won't have to embed confusion-inducing things like one-point somas into your morphometric specification.
Do you need anatomical verisimilitude, or do you need to control the physical appearance of your model? Won't affect its intrinsic electrical behavior, probably would affect its utility in studies of extracellular stimulation, or "networks whose connections are based on proximity between pre- and postsynaptic branches."
It's also a little unclear to me how or whether I should be specifying the soma as a single point or a string of centroids with varying diameters
In most cases, the soma has negligible electrotonic extent (can be treated as isopotential). If you want to represent it as a cylinder, fine, use L and diam or pt3d syntax as you choose (latter is better for making pretty pictures when it comes time to publish). If shape is important (maybe you're interested in intracellular chemical signaling), then use pt3d syntax, which can accommodate a wide variety of shapes (best when radius of centroid curvature is bigger than centroid length, not ideal for surfaces with concavity or saddles).