Vectors in MOD files

Anything that doesn't fit elsewhere.
Post Reply
viniciuslima
Posts: 7
Joined: Wed Mar 29, 2017 9:01 pm

Vectors in MOD files

Post by viniciuslima » Sat Jan 13, 2018 6:43 am

Hello,

I'm working with a .MOD file that implements Izhikevich (2007) model, and i want to store the spiking times, to do so i need to create a vector to store the variable 't', everytime the neuron cross the threshold.
How can i create this kind of variable in a .MOD file?

Thanks.

ted
Site Admin
Posts: 5335
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Vectors in MOD files

Post by ted » Mon Jan 15, 2018 12:25 am

It is best to use the NetCon class's record method to capture the spike times to a Vector. Presumably your MOD file implements a point process that is actually an artificial spiking cell, which means that it generates an event every time it "spikes." If you're working in hoc and foo is an objref that points to an instance of the cell class, then

Code: Select all

objref nc, nil, stvec
nc = new NetCon(foo, nil)
stvec = new Vector()
nc.record(stvec)
will capture foo's spike times to stvec.

If instead you are working in Python, and Bar is the name of the point process class, then

Code: Select all

foo = h.Bar() # foo is a Python object that references an instance of the artificial spiking cell class
nc = h.NetCon(foo, None) # nc detects spikes generated by the artificial spiking cell referenced by foo
stvec = h.Vector() # stvec references a hoc Vector
nc.record(stvec)
will capture foo's spike times to stvec.

Be sure to read the relevant documentation in the Programmer's Reference.

ted
Site Admin
Posts: 5335
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Vectors in MOD files

Post by ted » Tue Jan 16, 2018 12:10 pm

Note that some recent versions of NEURON may have a bug that affects recorded event times--see this thread in the Forum:
viewtopic.php?f=8&t=3808
For example, I see the bug in v. 7.5 master (cb6fc3e) 2017-10-30

So be sure to test whatever you have installed to make sure that it is not affected.

The fix for this bug was announced yesterday, and source code containing the fix is available at
https://github.com/nrnhines/nrn/commit/ ... 7ae3132c20

Post Reply