Skip to content

Neuron SWC import3d

Nora Abi Akar edited this page Sep 30, 2020 · 16 revisions

Neuron behavior with SWC

The soma

1-point soma:

1 1 0 0 0 10  -1  

Generates a soma with length=20 and diam=20

2-point soma:

1 1 0 0 -10 10 -1
2 1 0 0   0 10  1

Generates a soma with length=10 and diam=20

2-point soma with non-constant radius:

1 1 0 0 -20  5 -1
2 1 0 0   0  8  1

Generates a soma with length=20 and diam=13

3-point soma joined serially (0-1-2):

1 1 0 0 -10 10 -1
2 1 0 0   0 10  1
3 1 0 0  10 10  2

Generates a soma with length=20 and diam=20

3-point soma joined serially (0-1-2) with non-constant radius:

1 1 0 0  -5 2 -1
2 1 0 0   0 5  1
3 1 0 0  10 4  2

Generates a soma with length=15 and diam=8.3333

3-point soma joined in the middle (1-0-2):

1 1 0 0   0 10 -1
2 1 0 0 -10 10  1
3 1 0 0  10 10  1

Generates a soma with length=20 and diam=20 - BUT the following warnings are generated:

One point section Import3d_Section[2] ending at line 3 has been removed
One point section Import3d_Section[1] ending at line 2 has been removed

3-point soma joined in the middle (1-0-2) - another example:

1 1 0 0   0  10 -1
2 1 0 0  -4   6  1
3 1 0 0   1 0.5  1

Generates a soma with length=20 and diam=20 - BUT the following warnings are generated:

One point section Import3d_Section[2] ending at line 3 has been removed
One point section Import3d_Section[1] ending at line 2 has been removed

4-point branching soma:

#       2
#      /
# 0 - 1
#      \
#       3
1 1 0  0   0 10  -1
2 1 0  0  10 10   1
3 1 0 -5  20 10   2
4 1 0  5  20 10   2

Generates a soma with length=10 and diam=20 - BUT the following warnings are generated:

One point section Import3d_Section[2] ending at line 4 has been removed
One point section Import3d_Section[1] ending at line 3 has been removed

6-point soma in a line:

1 1 0 0  -5 2 -1
2 1 0 0   0 5  1
3 1 0 0   2 6  2
4 1 0 0   6 1  3
5 1 0 0  10 7  4
6 1 0 0  15 2  5

Generates a soma with length=20 and diam=8.1 (((2+5)*5 + (5+6)*2 + (6+1)*4 + (1+7)*4 + (7+2)*5)/20 = 8.1)

Attaching single dendrites to the soma

1-point soma and 1-point dendrite:

1 1 0   0 0 10  -1  
2 3 0 200 0 10   1   

Generates a soma with length=20 and diam=20 BUT no dendrite - the following warning is printed:

One point section Import3d_Section[1] ending at line 2 has been removed

1-point soma and 2-point dendrite:

1 1 0   0 0 10  -1  
2 3 0   0 0  5   1   
3 3 0 200 0 10   2   

Generates a soma with length=20 and diam=20 ; and a dendrite with length=200 and diam=15

2-point soma and 1-point dendrite:

1 1 0 0 -10 10  -1  
2 1 0 0   0 10   1   
3 3 0 200 0 10   2   

Generates a soma with length=10 and diam=20 BUT no dendrite - the following warning is printed:

One point section Import3d_Section[1] ending at line 3 has been removed

2-point soma and 2-point dendrite:

1 1 0 0 -20 10  -1  
2 1 0 0   0 10   1   
3 3 0 0   0 10   2   
4 3 0 200 0 10   3   

Generates a soma with length=20 and diam=20 ; and a dendrite with length=200 and diam=20

This seems to indicate that the dendrite cannot get its proximal point from the soma.

2-point soma and two 1-point dendrites:

1 1 0 0 -20 10  -1  
2 1 0 0   0 10   1   
3 3 0 0  80 10   2   
4 3 0 0 -80 10   2   

Generates a soma with length=20 and diam=20 BUT no dendrite - the following warning are printed:.

One point section Import3d_Section[2] ending at line 4 has been removed
One point section Import3d_Section[1] ending at line 3 has been removed

2-point soma; 2-point dendrite; 1 point axon connected to the proximal end of the dendrite:

1 1 0 0 -20 10  -1  
2 1 0 0   0 10   1   
3 3 0 0   0 10   2   
4 3 0 0  80 10   3   
5 2 0 0 -80 10   3   

Generates a soma with length=20 and diam=20 ; and a dendrite with length=80 and diam=20; and an axon with length=80 and diam=20 - But the following warnings are generated

One point section Import3d_Section[1] ending at line 3 has been removed
    and child Import3d_Section[2] reattached
    and child Import3d_Section[3] reattached

Soma in the middle:

2-point dendrite and 1-point soma at the end:

1  3 0 0  0 1  -1
2  3 0 0 10 1   1
3  1 0 0 20 10  2

Generates a dendrite with length=10 and diam=2 and no soma - the following warning is generated

One point section Import3d_Section[1] ending at line 3 has been removed

2-point dendrite and 2-point soma at the end

1  3 0 0  0 1  -1
2  3 0 0 10 1   1
3  1 0 0 20 10  2
4  1 0 0 22 5   3

Generates a soma with length=2 and diam=15 and a dendrite with length=10 and diam=2

No soma:

1-point dend, no soma:

1 3 0 0  -5 2 -1

Generates nothing

2-point dend, no soma:

1 3 0 0  -5 2 -1
2 3 0 0   0 2  1

Generates a dendrite with length=5 and diam=4

2-point dend and 1-point axon, no soma:

1  3 0 0  0 1  -1
2  3 0 0 10 1   1
3  2 0 0 20 10  2

Generates an axon with length=10 and diam=2 - BUT the following warning is produced:

One point section Import3d_Section[1] ending at line 3 has been removed

2-point dend and 2-point axon, no soma:

1  3 0 0  0 1  -1
2  3 0 0 10 1   1
3  2 0 0 20 10  2
4  2 0 0 22 5   3

Generates an axon with length=10 and diam=2 and an axon with length=2 and diam=15

Inconsistent Behavior:

(Issue submitted to NEURON)

2-point dendrite, 2-point axon, no soma:

1  3 0 0 10 10 -1  # dend
2  3 0 0 20 10  1  # dend
3  2 0 0 21 10  2  # axon
4  2 0 0 30 10  3  # axon

Generates a dendrite with length = 10 and diam = 20; and an axon with length = 9 diam = 20

This suggests that the axon and dendrite are not connected at point (0,0,20)

2-point soma, 2-point dendrite, 2-point axon"

1  1 0 0  0 1  -1  # soma
2  1 0 0  9 1   1  # soma
3  3 0 0 10 10  2  # dend
4  3 0 0 20 10  3  # dend
5  2 0 0 21 10  4  # axon
6  2 0 0 30 10  5  # axon

Generates a soma with length = 9 and diam = 2; a dendrite with length = 10 and diam = 20; and an axon with length = 10 diam = 20

This suggests that the axon and dendrite are connected at point (0,0,20)

Arbor's rules for implementing a NEURON-compliant SWC parser:

  • A soma does not need to be defined.
  • If the soma is defined, then it need not be at the root.
    • Unless it is a single sample soma, in which case it must be at the root.
  • The soma is represented by an unbranched series of n≥1 contiguously numbered samples.
  • NEURON constructs a single section with diameter equal to the piecewise average diameter.
  • A single sample at the root with tag 1 will produce a cylinder with length=diameter.
  • If a sample has a different swc identifier (tag) to its parent, then do not create a segment between the two, and start a new segment.
  • All branches must be defined by at least two samples (to define at least one segmemt)
    • except for the special case of a single point soma.
  • Everything that attaches anywhere on the first segment, attaches to the middle of that segment