Page 1 of 1

NEURON changes dendrite diameter to default value

Posted: Tue Mar 02, 2021 11:54 am
by schmidla
Hi all,

a student of mine is introducing herself to NEURON (I am usally not using the software myself) and she observed something strange and I was also able to reproduce the issue.
She took a .swc file from neuromorpho and used the CellBuilder tool to create an anatomically detailed neuron model. She stored the result in a .hoc file.

Scenario 1:
I use the GUI and use File -> load hoc -> select file 'geom_test.hoc'
I type 'forall psection()' to the neuron command window to see the sizes of each section.
Result: The dendrites alle have different diameters in the range of 1 to 10 um. -> that looks good

Scenario 2:
I type 'load_file("geom_test.hoc") into the command field.
I type 'forall psection()' to the neuron command window to see the sizes of each section.
Result: All dendrites have a diameter of 500um.

My question is: Why do Scenario 1 and 2 not produce the same result? What is lost when using the load_file command?

Thanks for your help!
Laura

PS.: I would post the geom_test.hoc file but it is very long.

Re: NEURON changes dendrite diameter to default value

Posted: Tue Mar 02, 2021 12:51 pm
by ted
Can't begin to guess what's going on. Would have to reproduce this in order to discover what's happening. Zip up the hoc file and email it to
ted dot carnevale at yale dot edu
and I'll tell you what I find out.

Re: NEURON changes dendrite diameter to default value

Posted: Wed Mar 03, 2021 11:32 am
by ted
That's an ugly bug.

No matter what I do, I'm not seeing what you did. I tried

nrngui geom_test.hoc
nrngui followed by execution of load_file("geom_test.hoc") at the oc> prompt
nrngui followed by use of GUI (NEURON Main Menu / File / load hoc, then clicking on geom_test.hoc)

and each produced identical results. Diameters are never 500. Largest morphometric diameter is 120 (big cell! spinal motoneuron maybe?), smallest is 0.26 um (nice reconstruction). Largest reported diam (with nseg==1) is 120, smallest is 0.58.

This is with NEURON v. 8.0.dev-194-g8570e8e+ master (8570e8e+) 2020-10-14. What version are you using?

Re: NEURON changes dendrite diameter to default value

Posted: Thu Mar 04, 2021 4:20 pm
by ramcdougal
Thank you for bringing this to our attention. This has now been fixed in the development version: https://github.com/neuronsimulator/nrn/ ... 2b12d87e53

The underlying issue was that 3D diameters are internally stored separately from the diameters reported at the center of a segment, and a call to psection was not checking to make sure the center-of-segment diameters were up to date.

It's very easy to miss this because if NEURON is running interactively, there are lots of other things happening that do automatically trigger the center of segment diam updates, but for a Python example of this glitch and a work-around by calling h.finitialize(-65) before doing the psection, see:
https://colab.research.google.com/drive ... sp=sharing

Incidentally, invoking the psection method on a section in Python (e.g. print(dend.psection())) did not have this issue.

Re: NEURON changes dendrite diameter to default value

Posted: Fri Mar 05, 2021 3:22 am
by schmidla
Thank you both for your help!
Both the finitialize command and running it in Python solved the issue for me.

For anyone reading this post in the future:
This issue came up with NEURON 7.8.

And yes, it is a spinal motoneuron ;)