Advertisement
Guest User

Off-by-one NeuroML bug HOC

a guest
Mar 21st, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.17 KB | None | 0 0
  1. //execute1("celltypes.element(\"TestCell\")")
  2.  
  3. begintemplate TestCell
  4. public init, topol, basic_shape, subsets, geom, biophys, geom_nseg, biophys_inhomo
  5. public synlist, x, y, z, position, connect2target
  6.  
  7. public soma, dend
  8. public all
  9.  
  10. objref synlist
  11.  
  12. proc init() {
  13.   topol()
  14.   subsets()
  15.   geom()
  16.   biophys()
  17.   geom_nseg()
  18.   synlist = new List()
  19.   synapses()
  20.   x = y = z = 0 // only change via position
  21. }
  22.  
  23. create soma, dend[12]
  24.  
  25. proc topol() { local i
  26.   connect dend(0), soma(0)
  27.   for i = 1, 11 connect dend[i](0), dend[i-1](1)
  28.   basic_shape()
  29. }
  30. proc basic_shape() {
  31.   soma {pt3dclear() pt3dadd(-59, 90, 0, 1) pt3dadd(-44, 120, 0, 1)}
  32.   dend {pt3dclear() pt3dadd(-59, 90, 0, 1) pt3dadd(-104, 90, 0, 1)}
  33.   dend[1] {pt3dclear() pt3dadd(-104, 90, 0, 1) pt3dadd(-149, 165, 0, 1)}
  34.   dend[2] {pt3dclear() pt3dadd(-149, 165, 0, 1) pt3dadd(-104, 210, 0, 1)}
  35.   dend[3] {pt3dclear() pt3dadd(-104, 210, 0, 1) pt3dadd(-59, 210, 0, 1)}
  36.   dend[4] {pt3dclear() pt3dadd(-59, 210, 0, 1) pt3dadd(15, 195, 0, 1)}
  37.   dend[5] {pt3dclear() pt3dadd(15, 195, 0, 1) pt3dadd(30, 150, 0, 1)}
  38.   dend[6] {pt3dclear() pt3dadd(30, 150, 0, 1) pt3dadd(60, 75, 0, 1)}
  39.   dend[7] {pt3dclear() pt3dadd(60, 75, 0, 1) pt3dadd(60, 0, 0, 1)}
  40.   dend[8] {pt3dclear() pt3dadd(60, 0, 0, 1) pt3dadd(-14, -29, 0, 1)}
  41.   dend[9] {pt3dclear() pt3dadd(-14, -29, 0, 1) pt3dadd(-89, -29, 0, 1)}
  42.   dend[10] {pt3dclear() pt3dadd(-89, -29, 0, 1) pt3dadd(-164, 15, 0, 1)}
  43.   dend[11] {pt3dclear() pt3dadd(-164, 15, 0, 1) pt3dadd(-194, 60, 0, 1)}
  44. }
  45.  
  46. objref all
  47. proc subsets() { local i
  48.   objref all
  49.   all = new SectionList()
  50.     soma all.append()
  51.     for i=0, 11 dend[i] all.append()
  52.  
  53. }
  54. proc geom() {
  55. }
  56. external lambda_f
  57. proc geom_nseg() {
  58. }
  59. proc biophys() {
  60. }
  61. proc biophys_inhomo(){}
  62. proc position() { local i
  63.   soma for i = 0, n3d()-1 {
  64.     pt3dchange(i, $1-x+x3d(i), $2-y+y3d(i), $3-z+z3d(i), diam3d(i))
  65.   }
  66.   x = $1  y = $2  z = $3
  67. }
  68. obfunc connect2target() { localobj nc //$o1 target point process, optional $o2 returned NetCon
  69.   soma nc = new NetCon(&v(1), $o1)
  70.   nc.threshold = 10
  71.   if (numarg() == 2) { $o2 = nc } // for backward compatibility
  72.   return nc
  73. }
  74. proc synapses() {}
  75. endtemplate TestCell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement