Skip to content

Neuron SWC import3d

Nora Abi Akar edited this page Oct 5, 2020 · 16 revisions

Neuron behavior with SWC

The soma

1-point soma: (Good)

1 1 0 0 0 10  -1  

Generates a soma with length=20 and diam=20

2-point soma: (Good)

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: (Good)

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): (Good)

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: (Good)

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): (Bad)

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: (Bad)

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: (Bad)

#       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: (Good)

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: (Bad)

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: (Good)

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: (Bad)

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: (Good)

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: (Bad)

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: (Good)

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: (Bad)

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: (Bad)

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

3-point soma in the middle of two 2-point dendrites: (Bad)

1  3 0 1 2  1 -1
2  3 0 9 2  1  1
3  1 0 0 0 10  2
4  1 0 0 2 10  3
5  1 0 0 4 10  4
6  3 0 1 2  1  5
7  3 0 8 2  1  6

Generates the following, unexpected behavior:

sec   :  Cell.soma[0]
length:  4.0
parent:  Cell.dend[0](0.5)

sec   :  Cell.dend[0]
length:  8.0
parent:  None

sec   :  Cell.dend[1]
length:  9.23606797749979
parent:  Cell.soma[0](1)

No soma:

1-point dend, no soma: (Bad)

1 3 0 0  -5 2 -1

Generates nothing

2-point dend, no soma: (Bad)

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: (Bad)

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: (Bad)

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:

(Issues submitted to NEURON here and here)

2-point dendrite, 2-point axon, no soma: (Bad)

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: (Good)

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 needs to be defined and it needs to be at the root.
  • A soma is represented by a series of n≥1 unbranched, serially listed samples.
  • A soma is a single cylinder with diameter equal to the piecewise average diameter.
  • A single-sample soma (tag 1) at the root will produce a cylinder with length=diameter.
  • If a non-soma sample (tag > 1) is to have a soma sample (tag 1) as its parent, it must have the most distal sample of the soma segment as the parent. (This is subject to change depending on the outcome of the NEURON issues.)
  • Every non-soma sample (tag > 1) that has a soma sample (tag 1) as its parent, attaches to the created soma cylinder at its midpoint (via a zero-resistance wire).
  • If a non-soma sample (tag > 1) has a soma sample (tag 1) as its parent, no segment is created between the sample and its parent, instead that sample is the proximal point of a new segment.
  • To create a segment with a certain tag, that is to be attached to the soma, we need at least 2 samples with that tag.
Clone this wiki locally