Computational Surgery (Lytton et al. 2011)

 Download zip file   Auto-launch 
Help downloading and running models
Accession:140881
Figure 2 in Neocortical simulation for epilepsy surgery guidance: Localization and intervention, by William W. Lytton, Samuel A. Neymotin, Jason C. Wester, and Diego Contreras in Computational Surgery and Dual Training, Springer, 2011
Reference:
1 . Lytton WW, Neymotin SA, Wester JC, Contreras D (2011) Neocortical simulation for epilepsy surgery guidance: Localization and intervention Computational Surgery and Dual Training
Model Information (Click on a link to find other models with that property)
Model Type: Realistic Network;
Brain Region(s)/Organism: Neocortex;
Cell Type(s): Neocortex fast spiking (FS) interneuron; Neocortex spiking regular (RS) neuron; Neocortex spiking low threshold (LTS) neuron;
Channel(s):
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: NEURON;
Model Concept(s): Epilepsy;
Implementer(s): Lytton, William [billl at neurosim.downstate.edu];
/
b11aug17
data
readme.txt
intf6_.mod *
misc.mod *
nstim.mod *
stats.mod *
vecst.mod *
col.hoc
declist.hoc *
decnqs.hoc *
decvec.hoc *
default.hoc *
drline.hoc *
gload.hoc
grvec.hoc
init.hoc
labels.hoc
local.hoc *
misc.h *
mosinit.hoc
network.hoc
nqs.hoc
nqs_utils.hoc *
nqsnet.hoc *
nrnoc.hoc *
params.hoc
run.hoc
setup.hoc *
simctrl.hoc *
spkts.hoc *
stats.hoc
stdgui.hoc *
syncode.hoc
                            
// $Id: drline.hoc,v 1.41 2011/02/15 14:05:02 billl Exp $

// load_file("drline.hoc")

// click and drag left button to draw lines on top of a figure interactively
// select graph to draw on with setdrl(Graph[])
// set color with clr, line width with lne
// select 'Draw curve' for continuous drawing
// select 'Arrow' to place an arrow pointing according to direction of drag

drlflush=1 //whether to flush line drawings each drline call

//* drline(x0,y0,x1,y1,OPT graph or color) 
proc drline () { local color,line
  if (numarg()==0) { print "drline(x0,y0,x1,y1[,g,col,line])"
    return }
  if (numarg()>4) { 
    if (argtype(5)==0) { color=$5 
                         if (numarg()>5) line=$6
    } else {             graphItem = $o5 
                         if (numarg()>5) color=$6
                         if (numarg()>6) line=$7      }}
  graphItem.beginline(color,line)
  graphItem.line($1,$2)
  graphItem.line($3,$4)
  if(drlflush) graphItem.flush()
}

//* set to drawlines on top of fig
proc setdrl () {
  g=$o1 // select this graph for further drawing
  xpanel("")
  $o1.menu_tool("Draw line","drl")
  $o1.menu_tool("Draw curve","drc")
  $o1.menu_tool("Label","drw")
  $o1.menu_tool("Arrow","dra")
  $o1.menu_tool("Circle","drci")
  $o1.menu_tool("Rectangle","drr")
  xvalue("Color","clr",1,"",1)
  xvalue("Line","lne",1,"",1)
  xbutton("Erase","g.erase_all()")
  xpanel()
  $o1.exec_menu("Draw line")
}

//* draw line interactively on top of fig
// interesting that this should work at all since x0,y0 local but still preserving their
// values across multiple calls
proc drl ()  { local x0,y0,type,x,y,keystate
  type=$1 x=$2 y=$3 keystate=$4
  if (type==2) {x0=x y0=y}
  if (type==3) drline(x0,y0,x,y,clr,lne)
}

//* draw circle interactively on top of fig
// drci(2,0,0,0) drci(3,1,0,0)
proc drci ()  { local a,x0,y0,type,x,y,keystate,ii,rad localobj xv,yv
  type=$1 x=$2 y=$3 keystate=$4
  if (type==2) {x0=x y0=y}
  if (type==3) { rad=sqrt((x-x0)^2+(y-y0)^2) 
    a=allocvecs(xv,yv) vrsz(360,xv,yv)
    print "Circle: ",x0,y0,rad
    yv.circ(xv,x0,y0,rad)
    yv.line(g,xv,clr,lne)
    dealloc(a)
  }
}

//* draw retangle interactively on top of fig
proc drr ()  { local x0,y0,type,x,y,keystate
  type=$1 x=$2 y=$3 keystate=$4
  if (type==2) {x0=x y0=y}
  if (type==3) { drline(x0,y0,x0,y,clr,lne)
    drline(x,y0,x,y,clr,lne) drline(x,y,x0,y,clr,lne) drline(x,y0,x0,y0,clr,lne) }
}

//* draw arrow interactively on top of fig
proc dra ()  { local xsz,ysz,type,x,y,keystate,rot
  type=$1 x=$2 y=$3 keystate=$4
  xsz=0.1*(g.size(2)-g.size(1)) // 10% of size
  ysz=0.1*(g.size(4)-g.size(3))
  if (type==2) {x0=x y0=y}
  if (type==3) {
    if (y==y0) {
      if (x>x0) rot=-90 else rot=90
    } else {
      rot=-atan((x-x0)/(y-y0))/2/PI*360
      if ((y-y0)<=0) rot+=180
    }
    g.glyph(arrow(),x,y,xsz,ysz,rot)
  }
}

//* draw curve interactively on top of fig
proc drc ()  { local x0,y0,type,x,y,keystate
  type=$1 x=$2 y=$3 keystate=$4
  if (type==2) { x0=x y0=y
  } else if (type==1) {
    drline(x0,y0,x,y,clr,lne)
    x0=x y0=y
  } else if (type==3) drline(x0,y0,x,y,clr,lne)
}

//* write label
proc drw ()  { local x0,y0,type,x,y,keystate
  type=$1 x=$2 y=$3 keystate=$4
  if (type==2) { 
   string_dialog("Label: ",tstr) 
   g.label(x,y,tstr,1,1,0.5,0.5,clr)
  }
}

obfunc arrow () { localobj o
  o=new Glyph()
  o.m(0,0)  o.l(0,2) o.s(1,4) // draw vertical line
  o.m(0,0)  o.l(0,-2) o.s(1,4) // draw vertical line
  o.m(0,-2) o.l(-2,0) o.s(1,4)
  o.m(0,-2) o.l(2,0) o.s(1,4)
  return o
}

//* hist(g,vec,min,max,bins)
{clr=1 hflg=1 ers=1 sym=1 pflg=0 lin=4 hbup=0} 
declared("hfunc")
// clr:color, hflg=1 draw lines; 2 draw boxes; 3 fill in; ers=erase; 
// pflg=1 normalize hist by size of $o2, so will be probability instead of count
// pflg=2 turn hist upside down
// pflg=3 operate on values with hfunc()
// style determined by hflg
// hflg==0 lines with dots
// hflg==0.x offset lines with dots
// hflg==1 outlines but not down to zero
// hflg==2 outlines with lines down to zero
// hflg==3 just dots
// hflg==3.x lines between dots
// hbup=1 // move baseline up by this amount
func hist () { local a,b,c,min,max,wid,bins,ii,jj,offset,x,y
  if (numarg()==0) { printf("hist(g,vec,min,max,bins)\n") return 0}
  if ($o2.size<2)  { printf("hist: $o2 too small\n",$o2) return -1}
  if ($o2.min==$o2.max)  { printf("hist: %s all one value: %g\n",$o2,$o2.min) return -1}
  if (numarg()==5) {min=$3 max=$4 bins=$5 
  } else if (numarg()==4) { min=0 max=$3 bins=$4 
  } else if (numarg()<=3) { 
    if ((min=0.95*$o2.min)<0) min=1.05*$o2.min
    if ((max=1.05*$o2.max)<0) max=0.95*$o2.max
    bins=100
    if (min>0) min*=0.9 else min*=1.1
    if (max>0) max*=1.1 else max*=0.9
    if (numarg()==3) bins=$3
  }
  wid=(max-min)/bins
  // print min,max,max-wid,wid
  a=b=c=allocvecs(3) b+=1 c+=2
  offset=0 x=-1
  if (ers) $o1.erase_all()
  mso[c].hist($o2,min,bins,wid) // c has values
  if(pflg==1) mso[c].div(mso[c].sum) // normalize to sum to 1
  if(pflg==2) mso[c].mul(-1)
  if(pflg==3) hfunc(mso[c])
  mso[a].resize(2*mso[c].size())
  mso[a].indgen(0.5) 
  mso[a].apply("int") 
  mso[b].index(mso[c], mso[a]) 
  mso[a].mul(wid) mso[a].add(min)
  mso[b].rotate(1)
  mso[b].x[0] = 0 
  mso[b].append(mso[b].x[mso[b].size-1],0)
  mso[b].add(hbup)
  mso[a].append(max,max)
  if (hflg==1 || hflg==2) { 
    mso[b].line($o1, mso[a],clr,lin)
    if (hflg==2) for vtr(&x,mso[a]) drline(x,0,x,mso[b].x[i1],$o1,clr,lin)
  } else if (int(hflg)==0 || hflg>=3) { 
    if (hflg%1!=0) offset=hflg*wid // use eg -0.5+ii/8 to move back to integer
    mso[a].indgen(min,max-wid,wid)
    mso[a].add(wid/2+offset)
    // print mso[a].min,mso[a].max
    // mso[c].mark($o1,mso[a],"O",6,clr,2) // this will place points where 0 count
    for jj=0,mso[a].size-1 if (mso[c].x[jj]!=0) {
      if (hflg!=3 && hflg%1!=0) drline(mso[a].x[jj],0,mso[a].x[jj],mso[c].x[jj],$o1,clr,lin)
      if (hflg==4) {
        if (x!=-1) drline(x,y,mso[a].x[jj],mso[c].x[jj],$o1,clr,lin)
        x=mso[a].x[jj] y=mso[c].x[jj]
      }
      $o1.mark(mso[a].x[jj],mso[c].x[jj],sg(sym).t,10,clr,2) // don't place points with 0 count
    }
  }
  $o1.flush()
  $o1.size(min,max,0,mso[b].max)
  dealloc(a)
  return 1
}

// barplot(g,yvec,xvec[,bar_width]) 
// barplot(g,yvec,xvec[,bar_width,color_vec]) -- for multicolored bars -- each point has a color
// barplot(g,yvec,xvec[,bar_width,color_vec,error_vec]) -- error_vec plots the error
scribble=0
func barplot () { local a,sz,wid,ii,jj,x,y,mulcol localobj go,vx,vy,v1,vcol
  if (numarg()==0) {
    printf("barplot(g,yvec,xvec[,bar_width]), scribble=1 to 'fill in'\n") 
    printf("set scribble=1 to fill in with single color (based on clr)\n")
    printf("barplot(g,yvec,xvec[,bar_width,color_vec]):multicolored bars-each point has a color\n")
    printf("barplot(g,yvec,xvec[,bar_width,color_vec,error_vec]):add +/- error to each bar\n")
    return 0}
  if ((sz=$o2.size)!=$o3.size)  { printf("barplot: x,y vectors differ in size\n") return -1}
  go=$o1 $o3.sort
  if (argtype(4)==0)  wid=$4 else wid=1
  if (argtype(5)==1)  {vcol=$o5 mulcol=-1
    if (sz!=vcol.size) { printf("barplot: color vec wrong size: %d %d\n",sz,vcol.size) return -1}  
  } else if (argtype(5)==0) mulcol=$5 else mulcol=0
  wid/=2
  // print min,max,max-wid,wid
  a=allocvecs(vx,vy,v1)
  if (ers) go.erase_all()
  for vtr2(&x,&y,$o3,$o2,&ii)  { 
    vx.append(x-wid,x-wid,x+wid,x+wid)
    vy.append(0,y,y,0)
  }
  if (mulcol) {
    for vtr2(&x,&y,$o3,$o2,&jj)  { 
      if (mulcol==-1) clr=vcol.x[jj] else clr=mulcol
      vrsz(0,vx,vy)
      vx.append(x-wid,x-wid)
      vy.append(0,y)
      for (ii=0;ii<2*wid;ii+=(wid/100)) { 
        vx.add(wid/100) 
        vy.line(go, vx, clr, 4)
      }
    }
    vy.line(go, vx, clr, 4)
  } else if (scribble) {
    vrsz(0,vx,vy)
    for vtr2(&x,&y,$o3,$o2,&ii)  { 
      vx.append(x-wid,x-wid,x-wid)
      vy.append(0,y,0)
    }
    for (ii=0;ii<2*wid;ii+=(wid/100)) { 
      vx.add(wid/100) 
      vy.line(go, vx, clr, 4)
    }
    vy.line(go, vx, clr, 4)
  } else vy.line(go, vx, clr, lne)
  if(numarg()>5) $o2.ploterr(go, $o3, $o6, 15, 1, 3)
  go.flush()
  go.size(vx.min-wid,vx.max+wid,0,vy.max)
  dealloc(a)
  return 1
}

proc smgs () { local a,b,c,min,max,wid,bins,ii,jj,offset,x,y localobj v1
  if ($o2.size<2)  { printf("smgs: $o2 too small\n",$o2) return -1}
  if ($o2.min==$o2.max)  { printf("smgs: %s all one value: %g\n",$o2,$o2.min) return -1}
  if (numarg()==5) {min=$3 max=$4 bins=$5 
  } else if (numarg()==4) { min=0 max=$3 bins=$4 
  } else if (numarg()<=3) { 
    if ((min=0.95*$o2.min)<0) min=1.05*$o2.min
    if ((max=1.05*$o2.max)<0) max=0.95*$o2.max
    bins=100
    if (min>0) min*=0.9 else min*=1.1
    if (max>0) min*=1.1 else max*=0.9
    if (numarg()==3) bins=$3
  }
  wid=(max-min)/bins
  // print min,max,max-wid,wid
  a=b=c=allocvecs(3,1e4) b+=1 c+=2
  offset=0 x=-1
  if (ers) $o1.erase_all()
  mso[a].indgen(min,max,wid)
  if (0) {
    mso[c].smgs($o2,min,max,wid,wid*wid/4) // c has values
    mso[c].line($o1, mso[a],clr,4)
  } else {
    v1=$o2.sumgauss(min,max,wid,wid/2) // c has values
    v1.line($o1, mso[a],clr,4)
  }
}

//* a few drawing utilities from sam (not too spectacular)
 
//** drawhticks(ticksz,minx,maxx,linewidth,$5-$numarg() == y position of horizontal ticks)
// draw horizontal ticks of a view box along left/right of box
proc drawhticks () { local ticksz,minx,maxx,lw,i
  ticksz=$1 minx=$2 maxx=$3 lw=$4
  for i=5,numarg() {
    drline(minx,$i,minx+ticksz,$i,g,1,lw)    drline(maxx,$i,maxx-ticksz,$i,g,1,lw)
  }
}

//** drawvticks(ticksz,miny,maxy,linewidth,$5-$numarg() == x position of vertical ticks)
// draw vertical ticks of a view box along top/bottom of box
proc drawvticks () { local ticksz,miny,maxy,lw,i
  ticksz=$1 miny=$2 maxy=$3 lw=$4
  for i=5,numarg() {
    drline($i,miny,$i,miny+ticksz,g,1,lw)    drline($i,maxy,$i,maxy-ticksz,g,1,lw)
  }
}

//** drawbox(minx,maxx,miny,maxy[,line,graph]) - draw box
proc drawbox () { local minx,maxx,miny,maxy,ln localobj myg
  minx=$1 maxx=$2 miny=$3 maxy=$4
  if(numarg()>4)ln=$5 else ln=3
  if(numarg()>5)myg=$o6 else myg=g
  drline(minx,miny,minx,maxy,myg,1,ln) //bottom
  drline(minx,miny,maxx,miny,myg,1,ln) //left
  drline(minx,maxy,maxx,maxy,myg,1,ln) //top
  drline(maxx,miny,maxx,maxy,myg,1,ln) //right
}

Lytton WW, Neymotin SA, Wester JC, Contreras D (2011) Neocortical simulation for epilepsy surgery guidance: Localization and intervention Computational Surgery and Dual Training

References and models cited by this paper

References and models that cite this paper

Babloyantz A, Destexhe A (1986) Low-dimensional chaos in an instance of epilepsy. Proc Natl Acad Sci U S A 83:3513-7 [PubMed]

Benifla M, Otsubo H, Ochi A, Snead OC, Rutka JT (2006) Multiple subpial transections in pediatric epilepsy: indications and outcomes. Childs Nerv Syst 22:992-8 [PubMed]

Brown SP, Hestrin S (2009) Intracortical circuits of pyramidal neurons reflect their long-range axonal targets. Nature 457:1133-6 [PubMed]

Buonomano DV (2009) Harnessing chaos in recurrent neural networks. Neuron 63:423-5 [PubMed]

Carnevale NT, Hines ML (2006) The NEURON Book

Clusmann H, Kral T, Gleissner U, Sassen R, Urbach H, Blumcke I, Bogucki J, Schramm J (2004) Analysis of different types of resection for pediatric patients with temporal lobe epilepsy. Neurosurgery 54:847-59; discussion 859-60 [PubMed]

Cohen-Gadol AA, Stoffman MR, Spencer DD (2003) Emerging surgical and radiotherapeutic techniques for treating epilepsy. Curr Opin Neurol 16:213-9 [PubMed]

Crampin EJ, Halstead M, Hunter P, Nielsen P, Noble D, Smith N, Tawhai M (2004) Computational physiology and the Physiome Project. Exp Physiol 89:1-26 [PubMed]

Duarte NC, Becker SA, Jamshidi N, Thiele I, Mo ML, Vo TD, Srivas R, Palsson BØ (2007) Global reconstruction of the human metabolic network based on genomic and bibliomic data. Proc Natl Acad Sci U S A 104:1777-82 [PubMed]

Dubitzky W (2006) Understanding the computational methodologies of systems biology. Brief Bioinform 7:315-7 [PubMed]

Groh A, Meyer HS, Schmidt EF, Heintz N, Sakmann B, Krieger P (2010) Cell-type specific properties of pyramidal neurons in neocortex underlying a layout that is modifiable depending on the cortical area. Cereb Cortex 20:826-36 [PubMed]

   [48 reconstructed morphologies on NeuroMorpho.Org]

Hines ML, Carnevale NT (2001) NEURON: a tool for neuroscientists. Neuroscientist 7:123-35 [Journal] [PubMed]

   Spatial gridding and temporal accuracy in NEURON (Hines and Carnevale 2001) [Model]

Jahr CE, Stevens CF (1990) A quantitative description of NMDA receptor-channel kinetic behavior. J Neurosci 10:1830-7 [PubMed]

Jahr CE, Stevens CF (1990) Voltage dependence of NMDA-activated macroscopic conductances predicted by single-channel kinetics. J Neurosci 10:3178-82 [PubMed]

Kossoff EH, Ritzl EK, Politsky JM, Murro AM, Smith JR, Duckrow RB, Spencer DD, Bergey GK (2004) Effect of an external responsive neurostimulator on seizures and electrographic discharges during subdural electrode monitoring. Epilepsia 45:1560-7 [PubMed]

Lesser RP, Crone NE, Webber WR (2010) Subdural electrodes. Clin Neurophysiol 121:1376-92

Lesser RP, Crone NE, Webber WR (2011) Using subdural electrodes to assess the safety of resections. Epilepsy Behav 20:223-9 [PubMed]

Lesser RP, Kim SH, Beyderman L, Miglioretti DL, Webber WR, Bare M, Cysyk B, Krauss G, Gordon (1999) Brief bursts of pulse stimulation terminate afterdischarges caused by cortical stimulation. Neurology 53:2073-81 [PubMed]

Lytton W, Hellman K, Sutula T (1996) Computer network model of mossy fiber sprouting in dentate gyrus Epilepsia-aes Proceedings 37 S 5:117

Lytton WW, Hellman KM, Sutula TP (1998) Computer models of hippocampal circuit changes of the kindling model of epilepsy. Artif Intell Med 13:81-97 [PubMed]

Lytton WW, Neymotin SA, Hines ML (2008) The virtual slice setup. J Neurosci Methods 171:309-15 [Journal] [PubMed]

   The virtual slice setup (Lytton et al. 2008) [Model]

Lytton WW, Omurtag A (2007) Tonic-clonic transitions in computer simulation. J Clin Neurophysiol 24:175-81 [PubMed]

   Tonic-clonic transitions in a seizure simulation (Lytton and Omurtag 2007) [Model]

Lytton WW, Stewart M (2005) A rule-based firing model for neural networks Int J Bioelectromagn 7:47-50

Lytton WW, Stewart M (2006) Rule-based firing for network simulations. Neurocomputing 69:1160-1164

Milton JG (2010) Epilepsy as a dynamic disease: a tutorial of the past with an eye to the future. Epilepsy Behav 18:33-44 [PubMed]

Morrell F, Whisler WW, Bleck TP (1989) Multiple subpial transection: a new approach to the surgical treatment of focal epilepsy. J Neurosurg 70:231-9 [PubMed]

Motamedi GK, Salazar P, Smith EL, Lesser RP, Webber WR, Ortinski PI, Vicini S, Rogawski MA (2006) Termination of epileptiform activity by cooling in rat hippocampal slice epilepsy models. Epilepsy Res 70:200-10 [PubMed]

Neymotin SA, Lee H, Park E, Fenton AA, Lytton WW (2011) Emergence of physiological oscillation frequencies in a computer model of neocortex. Front Comput Neurosci 5:19-75 [Journal] [PubMed]

   Emergence of physiological oscillation frequencies in neocortex simulations (Neymotin et al. 2011) [Model]

Osorio I, Frei MG, Manly BF, Sunderam S, Bhavaraju NC, Wilkinson SB (2001) An introduction to contingent (closed-loop) brain electrical stimulation for seizure blockage, to ultra-short-term clinical trials, and to multidimensional statistical analysis of therapeutic efficacy. J Clin Neurophysiol 18:533-44 [PubMed]

Polsky A, Mel BW, Schiller J (2004) Computational subunits in thin dendrites of pyramidal cells. Nat Neurosci 7:621-7 [Journal] [PubMed]

   CA1 pyramidal neuron: as a 2-layer NN and subthreshold synaptic summation (Poirazi et al 2003) [Model]

Richardson KA, Schiff SJ, Gluckman BJ (2005) Control of traveling waves in the Mammalian cortex. Phys Rev Lett 94:028103-92

Rutecki P (1990) Anatomical, physiological, and theoretical basis for the antiepileptic effect of vagus nerve stimulation. Epilepsia 31 Suppl 2:S1-6

Schramm J, Aliashkevich AF, Grunwald T (2002) Multiple subpial transections: outcome and complications in 20 patients who did not undergo resection. J Neurosurg 97:39-47 [PubMed]

Schulz R, Hoppe M, Boesebeck F, Gyimesi C, Pannek HW, Woermann FG, May T, Ebner A (2011) Analysis of reoperation in mesial temporal lobe epilepsy with hippocampal sclerosis. Neurosurgery 68:89-97; discussion 97 [PubMed]

Spencer SS, Schramm J, Wyler A, O'Connor M, Orbach D, Krauss G, Sperling M, Devinsky O, Elger (2002) Multiple subpial transection for intractable partial epilepsy: an international meta-analysis. Epilepsia 43:141-5 [PubMed]

Steriade M (2004) Neocortical cell classes are flexible entities. Nat Rev Neurosci 5:121-34 [PubMed]

Tonnesen J, Sorensen AT, Deisseroth K, Lundberg C, Kokaia M (2009) Optogenetic control of epileptiform activity. Proc Natl Acad Sci U S A 106:12162-7

Ty L, Yorke J (1975) Period three implies chaos Amer Math Monthly 82:985-992

Wyler AR (1997) Recent advances in epilepsy surgery: temporal lobectomy and multiple subpial transections. Neurosurgery 41:1294-301; discussion 1301-2 [PubMed]

Wyler AR, Hermann BP, Somes G (1995) Extent of medial temporal resection on outcome from anterior temporal lobectomy: a randomized prospective study. Neurosurgery 37:982-90; discussion 990-1 [PubMed]

Yogarajah M, Focke NK, Bonelli SB, Thompson P, Vollmar C, McEvoy AW, Alexander DC, Symms MR, (2010) The structural plasticity of white matter networks following anterior temporal lobe resection. Brain 133:2348-64 [PubMed]

(41 refs)