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.
Vectors in MOD files
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Vectors in MOD files
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, thenwill capture foo's spike times to stvec.
If instead you are working in Python, and Bar is the name of the point process class, thenwill capture foo's spike times to stvec.
Be sure to read the relevant documentation in the Programmer's Reference.
Code: Select all
objref nc, nil, stvec
nc = new NetCon(foo, nil)
stvec = new Vector()
nc.record(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)
Be sure to read the relevant documentation in the Programmer's Reference.
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Vectors in MOD files
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
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