// HOC file for loading the Mauthner cell morphology.
// Morphology obtained using semi-manual fitting: 
// Neuron_Morpho and ImageJ used.
//
// Tuomo Maki-Marttunen, 2013-2017 (CC-BY 4.0)
// 


load_file("stdrun.hoc")

ndend = 30
naxon = 3
create soma, dend[ndend], axonhillock, axon[naxon]
  
connect dend[19](1), soma(0.5)
connect dend[20](0), soma(0.5)
connect dend[21](0), soma(0.5)
connect dend[17](1), dend[19](0)
connect dend[18](0), dend[17](1)
connect dend[0](0), dend[17](0)
connect dend[1](0), dend[0](1)
connect dend[2](0), dend[1](1)
connect dend[3](0), dend[1](1)
connect dend[4](0), dend[0](1)
connect dend[5](0), dend[4](1)
connect dend[6](0), dend[5](1)
connect dend[7](0), dend[5](1)
connect dend[8](0), dend[4](1)
connect dend[9](0), dend[8](1)
connect dend[10](0), dend[8](1)
connect dend[11](0), dend[10](1)
connect dend[12](0), dend[11](1)
connect dend[13](0), dend[11](1)
connect dend[14](0), dend[13](1)
connect dend[15](0), dend[13](1)
connect dend[16](0), dend[10](1)
connect dend[22](0), dend[21](1)
connect dend[23](0), dend[22](1)
connect dend[24](0), dend[22](1)
connect dend[25](0), dend[21](1)
connect dend[26](0), dend[25](1)
connect dend[27](0), dend[25](1)
connect dend[28](0), dend[27](1)
connect dend[29](0), dend[27](1)
  
dend[0] {
   pt3dadd(320.126,382.536,175,46.22)
   pt3dadd(310.5,  386.572,160,44.1)
   pt3dadd(275.724,400.234,145,43.28)
}
dend[1] {
   pt3dadd(275.724,400.234,145,43.28)
   pt3dadd(288.144,395.577,170,8)
   pt3dadd(277.898,395.888,180,9.48)
   pt3dadd(266.409,400.234,190,9.22)
   pt3dadd(262.372,401.476,195,12.08)
}
dend[2] {
   pt3dadd(262.372,401.476,195,12.08)
   pt3dadd(263.304,405.202,200,4.12)
   pt3dadd(262.994,415.449,200,3)
   pt3dadd(262.994,421.038,205,5)
}
dend[3] {
   pt3dadd(262.372,401.476,195,12.08)
   pt3dadd(251.505,400.856,205,9.22)
   pt3dadd(242.811,398.992,215,11.7)
   pt3dadd(233.806,395.577,225,10.64)
   pt3dadd(221.697,390.298,245,9)
   pt3dadd(208.035,390.298,255,9.22)
   pt3dadd(192.2,  394.024,255,5.1)
   pt3dadd(179.469,394.956,265,4)
   pt3dadd(173.88, 396.198,270,4)
   pt3dadd(167.98, 396.198,275,5)
   pt3dadd(161.77, 392.162,280,3.16)
   pt3dadd(156.802,389.678,285,3.16)
   pt3dadd(150.282,389.678,290,3)
}
dend[4] {
   pt3dadd(275.724,400.234,145,43.28)
   pt3dadd(263.304,407.686,135,33.24)
}
dend[5] {
   pt3dadd(263.304,407.686,135,33.24)
   pt3dadd(266.409,412.344,140,6)
   pt3dadd(257.715,423.522,150,5.66)
   pt3dadd(250.884,429.111,155,5.66)
   pt3dadd(242.811,436.874,165,5)
}
dend[6] {
   pt3dadd(242.811,436.874,165,5)
   pt3dadd(240.327,436.252,165,5.38)
   pt3dadd(237.222,432.837,175,4)
   pt3dadd(237.532,426.006,175,3)
}
dend[7] {
   pt3dadd(242.811,436.874,165,5)
   pt3dadd(237.222,443.704,175,5)
   pt3dadd(233.496,447.43, 185,4.12)
   pt3dadd(227.286,453.64, 195,5)
}
dend[8] {
   pt3dadd(263.304,407.686,135,33.24)
   pt3dadd(254.3,  417.312,130,32.02)
}
dend[9] {
   pt3dadd(254.3,  417.312,130,32.02)
   pt3dadd(247.158,412.034,130,6.4)
   pt3dadd(242.19, 411.412,140,5)
   pt3dadd(231.012,413.586,150,4)
   pt3dadd(219.524,414.518,160,5.1)
   pt3dadd(211.761,416.38, 175,5.38)
   pt3dadd(207.724,419.486,185,4.24)
   pt3dadd(201.204,420.417,190,2)
}
dend[10] {
   pt3dadd(254.3,  417.312,130,32.02)
   pt3dadd(249.332,424.764,120,34.88)
}
dend[11] {
   pt3dadd(249.332,424.764,120,34.88)
   pt3dadd(239.085,420.417,120,8.24)
   pt3dadd(227.907,424.143,125,4.48)
   pt3dadd(221.076,425.385,135,6)
}
dend[12] {
   pt3dadd(221.076,425.385,135,6)
   pt3dadd(221.076,424.143,135,4.48)
   pt3dadd(218.592,418.554,135,4)
   pt3dadd(217.35, 409.86, 135,4)
}
dend[13] {
   pt3dadd(221.076,425.385,135,6)
   pt3dadd(206.482,428.49, 145,8.06)
   pt3dadd(195.615,430.664,150,7.28)
}
dend[14] {
   pt3dadd(195.615,430.664,150,7.28)
   pt3dadd(195.615,426.938,150,5)
   pt3dadd(186.61, 421.97, 150,3.16)
   pt3dadd(172.017,419.796,150,4)
}
dend[15] {
   pt3dadd(195.615,430.664,150,7.28)
   pt3dadd(183.195,433.768,155,5.38)
   pt3dadd(169.533,438.736,165,3.6)
   pt3dadd(157.113,444.015,175,2.82)
}
dend[16] {
   pt3dadd(249.332,424.764,120,34.88)
   pt3dadd(238.154,435.321,110,36.12)
   pt3dadd(223.87, 448.672,100,38.28)
   pt3dadd(203.688,465.75, 95, 31.24)
   pt3dadd(183.195,481.275,85, 31.12)
   pt3dadd(169.222,496.49, 80, 29.84)
   pt3dadd(159.597,511.704,70, 28.84)
   pt3dadd(152.145,529.402,60, 31.32)
   pt3dadd(134.136,547.722,50, 30.46)
   pt3dadd(119.542,550.827,40, 31.76)
   pt3dadd(111.47, 538.407,30, 35.22)
   pt3dadd(113.332,520.398,30, 37)
   pt3dadd(118.611,503.942,35, 22.2)
   pt3dadd(117.058,486.554,35, 20.24)
   pt3dadd(108.054,469.476,40, 12.64)
   pt3dadd(97.808, 472.581,40, 13.46)
   pt3dadd(93.771, 485.622,45, 10)
   pt3dadd(102.465,506.115,45, 8.24)
   pt3dadd(114.264,519.466,45, 13.9)
   pt3dadd(120.164,534.06, 50, 9.84)
}
dend[17] {
   pt3dadd(320.126,382.536,175,46.22)
   pt3dadd(331.924,375.705,180,45.18)
   pt3dadd(340.929,368.564,190,44.78)
}
dend[18] {
   pt3dadd(340.929,368.564,190,44.78)
   pt3dadd(327.888,359.559,190,10)
   pt3dadd(322.61, 360.801,205,8.54)
   pt3dadd(309.258,359.559,210,4)
   pt3dadd(292.491,360.18, 215,4.48)
   pt3dadd(281.934,359.248,220,5)
   pt3dadd(264.856,357.075,215,5)
   pt3dadd(258.336,354.28, 205,5)
}
dend[19] {
   pt3dadd(340.929,368.564,190,44.78)
   pt3dadd(354.591,361.112,200,40.46)
}
dend[20] {
   pt3dadd(354.591,361.112,200,40.46)
   pt3dadd(362.354,375.084,190,13.6)
   pt3dadd(368.253,377.568,180,13.42)
   pt3dadd(376.326,380.052,185,8.94)
}
axonhillock {
   pt3dadd(376.326,380.052,185,8.94)
   pt3dadd(380.673,374.463,190,7.22)
   pt3dadd(383.468,368.564,195,7.08)
}
dend[21] {
   pt3dadd(354.591,361.112,200,40.46)
   pt3dadd(364.527,353.97, 205,35.6)
   pt3dadd(371.048,347.76, 210,34.66)
   pt3dadd(379.431,335.961,215,32.24)
   pt3dadd(388.746,326.025,230,28.84)
   pt3dadd(394.335,317.952,240,30.46)
   pt3dadd(397.13, 311.742,250,28.16)
   pt3dadd(397.75, 306.153,260,31.06)
   pt3dadd(396.819,294.044,280,34.02)
}
dend[22] {
   pt3dadd(396.819,294.044,280,34.02)
   pt3dadd(385.641,294.975,280,12)
   pt3dadd(378.189,293.422,290,9)
   pt3dadd(363.285,292.18, 295,5)
   pt3dadd(348.381,292.18, 300,11)
   pt3dadd(331.614,294.975,305,10)
   pt3dadd(316.71, 297.459,305,10.78)
}
dend[23] {
   pt3dadd(316.71, 297.459,305,10.78)
   pt3dadd(315.157,292.491,305,5.38)
   pt3dadd(306.464,289.696,305,3.16)
   pt3dadd(299.322,283.486,305,4.12)
}
dend[24] {
   pt3dadd(316.71, 297.459,305,10.78)
   pt3dadd(299.943,302.738,310,11.7)
   pt3dadd(279.76, 310.5,  305,5)
   pt3dadd(262.062,316.089,305,2)
   pt3dadd(246.537,314.536,305,3)
}
dend[25] {
   pt3dadd(396.819,294.044,280,34.02)
   pt3dadd(398.992,284.108,295,27.9)
   pt3dadd(402.098,271.377,315,21)
   pt3dadd(393.714,256.784,335,23.34)
   pt3dadd(383.468,249.021,355,23.34)
   pt3dadd(373.221,238.154,370,22.2)
   pt3dadd(362.043,221.697,400,24.16)
}
dend[26] {
   pt3dadd(362.043,221.697,400,24.16)
   pt3dadd(354.28, 226.665,400,9.44)
   pt3dadd(342.792,232.564,405,6.4)
   pt3dadd(330.372,236.601,410,6)
   pt3dadd(320.126,234.738,420,5)
   pt3dadd(309.568,229.77, 430,5)
   pt3dadd(300.874,226.665,440,6.08)
   pt3dadd(286.281,222.939,450,4)
   pt3dadd(274.482,223.25, 460,3)
}
dend[27] {
   pt3dadd(362.043,221.697,400,24.16)
   pt3dadd(357.075,208.656,415,21.54)
   pt3dadd(351.486,199.962,430,23.32)
   pt3dadd(345.897,188.474,450,19.42)
   pt3dadd(338.756,174.812,470,17.5)
   pt3dadd(327.888,163.944,490,14.42)
   pt3dadd(316.71, 155.25, 500,11.32)
   pt3dadd(304.911,147.798,515,10)
   pt3dadd(291.249,141.588,530,11.32)
}
dend[28] {
   pt3dadd(291.249,141.588,530,11.32)
   pt3dadd(295.906,139.725,530,7.28)
   pt3dadd(299.943,133.204,535,6.7)
   pt3dadd(302.427,126.684,545,6)
   pt3dadd(302.427,121.095,555,6.32)
   pt3dadd(299.632,112.401,565,3.6)
   pt3dadd(297.459,105.26, 575,2.24)
}
dend[29] {
   pt3dadd(291.249,141.588,530,11.32)
   pt3dadd(276.345,137.241,530,8.24)
   pt3dadd(267.962,133.826,535,5.84)
   pt3dadd(253.368,130.72, 540,5)
   pt3dadd(223.56, 128.858,545,5)
   pt3dadd(204.309,126.684,545,4)
   pt3dadd(187.542,129.789,545,2)
}


soma {nseg = 3 Ra = 200 diam = 50 L = 50 cm = 1 V = -62.5 insert pas}
for i = 0, ndend-1 {
	dend[i].Ra = 200
	dend[i].cm = 1
	dend[i] insert pas
}

axonhillock {
  nseg = 20
  Ra = 200
  cm = 1
  insert pas
  insert I1
  insert I2
}
axon[0] {Ra = 200 diam = 54 L = 333 cm = 1 insert pas}
axon[1] {Ra = 200 diam = 54 L = 333 cm = 1 insert pas}
axon[2] {Ra = 200 diam = 54 L = 333 cm = 1 insert pas}
connect axonhillock(0), dend[20](1)
connect axon[0](0), axonhillock(1)
connect axon[1](0), axon[0](1)
connect axon[2](0), axon[1](1)