def __init__(self, type='Adaptation', cellid=-1): self.type = type self.sec = h.Section(name='izhi2003' + type + str(cellid)) self.sec.L, self.sec.diam = 6.3, 5 # empirically tuned self.izh = h.Izhi2003b(0.5, sec=self.sec) self.izh.Vr, self.izh.b = type2017[type] self.izh.Iin = 509.7
def __init__ (self, type='tonic spiking', host=None, cellid=-1): self.type=type if host is None: # need to set up a sec for this self.sec=h.Section(name='izhi2003'+type+str(cellid)) self.sec.L, self.sec.diam = 6.3, 5 # empirically tuned self.izh = h.Izhi2003b(0.5, sec=self.sec) else: self.sec = dummy self.izh = h.Izhi2003a(0.5, sec=self.sec) # Create a new u,V 2007 neuron at location 0.5 (doesn't matter where) self.izh.a,self.izh.b,self.izh.c,self.izh.d = type2003[type] self.izh.Iin = 509.7
('rebound burst' , (0.03 , 0.25 , -52.0 , 0.0 , -64.0 , 200.0)) , ('accomodation' , (0.02 , 1.0 , -55.0 , 4.0 , -65.0 , 400.0)) , ('tonic bursting' , (0.02 , 0.2 , -50.0 , 2.0 , -70.0 , 220.0)) , ('Class 1' , (0.02 , -0.1 , -55.0 , 6.0 , -60.0 , 300.0)) , ('resonator' , (0.1 , 0.26 , -60.0 , -1.0 , -62.0 , 400.0)) , ('threshold variability' , (0.03 , 0.25 , -60.0 , 4.0 , -64.0 , 100.0)) , ('inhibition-induced spiking' , (-0.02 , -1.0 , -60.0 , 8.0 , -63.8 , 350.0)) , ('phasic bursting' , (0.02 , 0.25 , -55.0 , 0.05 , -64.0 , 200.0)) , ('Class 2' , (0.2 , 0.26 , -65.0 , 0.0 , -64.0 , 300.0)) , ('integrator' , (0.02 , -0.1 , -55.0 , 6.0 , -60.0 , 100.0)) , ('bistability' , (0.1 , 0.26 , -60.0 , 0.0 , -61.0 , 300.0)) , ('inhibition-induced bursting' , (-0.026 , -1.0 , -45.0 , -2.0 , -63.8 , 350.0))]) choices = collections.OrderedDict([ ('2003 PP model' , (lambda: h.Izhi2003a(0.5,sec=cell03), lambda: izh._ref_V, type2003)), ('2003 Sec model', (lambda: h.Izhi2003b(0.5,sec=cell03), lambda: cell03(0.5)._ref_v, type2003)), ('2004 PP model' , (lambda: h.Izhi2003a(0.5,sec=cell03), lambda: izh._ref_V, type2004)), ('2004 Sec model', (lambda: h.Izhi2003b(0.5,sec=cell03), lambda: cell03(0.5)._ref_v, type2004)), ('2007 PP model' , (lambda: izh07.IzhiCell(host=izh07.dummy), lambda: izh._ref_V, izh07.type2007)), ('2007 Sec model' , (lambda: izh07.IzhiCell(), lambda: cell07.sec(0.5)._ref_v, izh07.type2007))]) ch=choices.keys() def newmodel (ty=None) : "2003,2004 was the orig model; 2007 is the redesign; look at global izhtype if no " return izhtype.find('2007') > -1 if ty is None else ty.find('2007') > -1 #* setup the cell izhtype='2004 PP model' def cellset (): global cell07, cell03, izh, vref, uvvset, fih, izhtype if newmodel():
import numpy as np import izhi2007Wrapper as izh07 import pylab as plt import pprint as pp plt.ion() fih = [] dummy = h.Section() # make a 2003a STATE {u,vv} cell (used for 2003, 2004) iz03a = h.Izhi2003a(0.5, sec=dummy) iz03a.Iin = 4 # make a 2003b (Section v) cell sec03b = h.Section() # this section will actually be used sec03b.L, sec03b.diam = 5, 6.3 # empirically tuned iz03b = h.Izhi2003b(0.5, sec=sec03b) iz03b.Iin = 4 def iz03b_init(): sec03b(0.5).v, iz03b.u = -65, -65 * iz03b.b fih.append(h.FInitializeHandler(iz03b_init)) # make a 2007a (NMODL) cell iz07a = h.Izhi2007a(0.5, sec=dummy) iz07a.Iin = 70 # make a 2007b (section) cell sec07b = h.Section()
('tonic bursting', (0.02, 0.2, -50.0, 2.0, -70.0, 220.0)), ('Class 1', (0.02, -0.1, -55.0, 6.0, -60.0, 300.0)), ('resonator', (0.1, 0.26, -60.0, -1.0, -62.0, 400.0)), ('threshold variability', (0.03, 0.25, -60.0, 4.0, -64.0, 100.0)), ('inhibition-induced spiking', (-0.02, -1.0, -60.0, 8.0, -63.8, 350.0)), ('phasic bursting', (0.02, 0.25, -55.0, 0.05, -64.0, 200.0)), ('Class 2', (0.2, 0.26, -65.0, 0.0, -64.0, 300.0)), ('integrator', (0.02, -0.1, -55.0, 6.0, -60.0, 100.0)), ('bistability', (0.1, 0.26, -60.0, 0.0, -61.0, 300.0)), ('inhibition-induced bursting', (-0.026, -1.0, -45.0, -2.0, -63.8, 350.0)) ]) choices = collections.OrderedDict([ ('2003 PP model', (lambda: h.Izhi2003a(0.5, sec=cell03), lambda: izh._ref_V, type2003)), ('2003 Sec model', (lambda: h.Izhi2003b(0.5, sec=cell03), lambda: cell03(0.5)._ref_v, type2003)), ('2004 PP model', (lambda: h.Izhi2003a(0.5, sec=cell03), lambda: izh._ref_V, type2004)), ('2004 Sec model', (lambda: h.Izhi2003b(0.5, sec=cell03), lambda: cell03(0.5)._ref_v, type2004)), ('2007 PP model', (lambda: izh07.IzhiCell(host=izh07.dummy), lambda: izh._ref_V, izh07.type2007)), ('2007 Sec model', (lambda: izh07.IzhiCell(), lambda: cell07.sec(0.5)._ref_v, izh07.type2007)) ]) ch = choices.keys() def newmodel(ty=None):