Import SWC file from NeuroMorpho -> Export as HOC file

Anything that doesn't fit elsewhere.
Post Reply
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Import SWC file from NeuroMorpho -> Export as HOC file

Post by stephanmg »

Dear users,

I've stumbled about a question:

I'm exporting a NeuroMorpho DB file in SWC format via Import3D in the GUI of NEURON.
Two questions I could not figure out:

#1: Can I use Import3D via the oc> interpreter prompt? If yes, how? :)
#2: Can I export the imported SWC geometry to a HOC file geometry?

Best,
Stephan
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by ted »

stephanmg wrote:#1: Can I use Import3D via the oc> interpreter prompt?
If you mean "can morphometric data be converted to a NEURON model by simply executing hoc or Python commands?" the answer is yes, but I think it's not a good idea to do that because it is all too easy to miss or ignore problems that may afflict morphometric data. The Import3D tool's graphical user interface reports problems that it encounters and makes it easy to browse through the data for the purpose of diagnosing and fixing those problems.

"Oh, but aren't morphometric data pure and good and true, and worthy of our complete and absolute trust?"

Some are, many aren't. Discovering which is which is left to the potential user to discover.
#2: Can I export the imported SWC geometry to a HOC file geometry?
Yes. See the Import3D tutorials on the Documentation page http://www.neuron.yale.edu/neuron/docs
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by stephanmg »

Dear Sir,

thanks you very much, this helps much :)

Maybe a following up question:
If I see something like

Code: Select all

connect dendA(0), dendB(1)
can i somehow figure out which point dendA(0) and dendB(1) correspond to?

Note that I've inserted with pt3dadd() points into dendA and dendB previously.

Best,
Stephan
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by stephanmg »

Follow up question,
hopefully this is not in the wrong place... feel free to move it around.

Thank you so much,
Ted & the whole forum
regger
Posts: 21
Joined: Sun Apr 22, 2012 9:49 pm

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by regger »

Hi Stephan,

check out the part of the NEURON documentation about n3d(), x3d(i), y3D(i) and z3d(i)... sounds like that's what you're looking for. These functions return the x/y/z coordinate of the ith point along the currently accessed section - so x=0 would be i=0, and x=1 would be i=n3d()-1.

cheers,
Robert
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by stephanmg »

regger wrote:Hi Stephan,

check out the part of the NEURON documentation about n3d(), x3d(i), y3D(i) and z3d(i)... sounds like that's what you're looking for. These functions return the x/y/z coordinate of the ith point along the currently accessed section - so x=0 would be i=0, and x=1 would be i=n3d()-1.

cheers,
Robert

Sounds great. Thanks in advance.
Best,
Stephan
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by ted »

regger wrote:x3d(i), y3D(i) and z3d(i) . . . return the x/y/z coordinate of the ith point along the currently accessed section
Not quite. They are the coordinates of points along an unbranched neurite. The 3d data (including diam3d()) hold the x,y,z, and diameter values of the morphometric data that are used to define the shape of a section. For any given section, there is no necessary relationship between the number of 3d data points and the number of nodes at which NEURON solves the discretized cable equation; the latter is controlled by the section's nseg parameter, and in general
* n3d() is not equal to nseg
* no 3d point corresponds to the center of any segment (compartment)
* while it is true that x3d(0), y3d(0), z3d(0) and x3d(1), y3d(1), z3d(1) are the coordinates of the ends of a given unbranched neurite, the length of the corresponding section in a NEURON model will be >= the euclidean distance between those two points
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by stephanmg »

Thanks,

to understand it fully, this means, that, if I would add by pt3dadd() points to a section, i implicit define an order of the points along the section, right?

Best,
Stephan
regger
Posts: 21
Joined: Sun Apr 22, 2012 9:49 pm

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by regger »

stephanmg wrote:Thanks,

to understand it fully, this means, that, if I would add by pt3dadd() points to a section, i implicit define an order of the points along the section, right?

Best,
Stephan
Correct. The first point in a section added by pt3dadd() corresponds to x=0 of the branch (loosely speaking, also of the section, as Ted pointed out) and the last point added by pt3dadd corresponds to x=1 of the section (again, loosely speaking...)

From the neuron documentation:
Add the 3d location and diameter point at the end of the current pt3d list. Assume that successive additions increase the arc length monotonically.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Import SWC file from NeuroMorpho -> Export as HOC file

Post by ted »

The quickest way to confirm your understanding is to construct a toy model. You might try specifying a sequence of points that define a simple geometric form, then execute the code and look at the result in a shape plot. Voila--frankensections.
Post Reply