Insert a spike train into a cell

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
bkaplan
Posts: 10
Joined: Thu Apr 22, 2010 4:34 am

Insert a spike train into a cell

Post by bkaplan » Tue Nov 09, 2010 5:46 am

Hello,
I want to insert a spike train into a cell via a synapse, e.g. ExpSyn.
How do I do that in Python?
I could not manage to translate my hoc code which does exactly that, so I wondered if there is maybe another way.
The hoc code which works makes use of the FInitializeHandler which then calls a function to insert the spike times into the cell's netconlist:

Code: Select all

    fih = new FInitializeHandler("initspikes()")

proc initspikes(){
...for (int i=0; i<stvec.size(); i+=1) {
   cell.netconlist.o(0).event(stvec.x[i]) //stvec contains the spiketimes
  }
}
// the cell template includes something like:
        soma syn = new ExpSyn(0.5)
        synlist.append(syn) //synlist[0]
        nc = new NetCon(nullobject, syn, threshold, delay, weight)
        netconlist.append(nc) //netconlist[0]
I tried translating that to Python, but the error message was that the initspikes function was not found:

Code: Select all

        initspikes()
      finitialize(-65)
    init()
  stdinit()
NEURON: initspikes undefined function
Even though I would prefer to have an implementation where I have control of the input spike train, I also tried to use a NetStim object, but this simply did not deliver any events.
Would be great if someone could post some python code, which does the job.
Many thanks in advance!

Post Reply