Page 1 of 1

Using my own generated spike trains as input

Posted: Wed Nov 16, 2005 7:50 pm
by steve
Hi,

I am very new to NEURON and wanted to know how I would go about to do the following:

I generated a set of spike trains in matlab. I want to "input" those spike trains to the dendrites of an L5 pyramidal model I found on modeldb. I found the following FAQ page section: http://www.neuron.yale.edu/neuron/faq#playevents. Would the best way to procede be to write the +/- 5000 spike trains I generated in matlab out to a file and then read them into NEURON vectors and procede as the FAQ shows?

Thanks a lot

Posted: Thu Nov 17, 2005 7:47 am
by Raj
Unless there is someone out there who created a more elegant solution already, my guess would be yes, but admittedly I haven't tried the VecStim code .

The event delivery system is described in the folllowing documents at which you might want to have glance before starting out:
http://www.neuron.yale.edu/neuron/paper ... poster.pdf
http://www.neuron.yale.edu/ftp/ted/book/chap10.pdf

The vector class has its own facilities for reading directly from a ascii file
http://www.neuron.yale.edu/neuron/stati ... html#scanf
http://www.neuron.yale.edu/neuron/stati ... ml#scantil

Because the vector class has the ability to read ascii files built in, I guess that with a few hours of coding you should be able to get a working solution.

The alternatives probably require more coding and might even involve learning to write mod-files.

Elsewhere in this forum you can find a post on reading neuron binary data into matlab, so if you want to use a binary format you might start there.

Re: Using my own generated spike trains as input

Posted: Thu Nov 17, 2005 11:25 am
by ted
steve wrote:I generated a set of spike trains in matlab. I want to "input" those spike trains to the dendrites of an L5 pyramidal model I found on modeldb. I found the following FAQ page section: http://www.neuron.yale.edu/neuron/faq#playevents.
The answer to that particular faq was out of date--sorrry about that! I have now fixed it.

In brief, the NetCon class has an event() method which, in conjunction with the
FInitializeHandler class, can be used to do exactly what you want very easily.
Also straightforward to extend to multiple synapses and spike event streams.
Would the best way to procede be to write the +/- 5000 spike trains I generated in matlab out to a file and then read them into NEURON vectors and procede as the FAQ shows?
Write them as plain ASCII. Quickest way to read them from a file into a Vector is with
the Vector class's scanf() method. Then use the Vector as per the faq.