I have created a network of two cells and am attempting to create a Raster Plot to record the spiking of each but I am having trouble getting it to appear. An empty graph shows up when I run the program but that is all. I believe it may be because the list "cells" referenced in the Raster plotting files is not specified anywhere, so it does not know what to graph.
I'm assuming this is an easy fix, but I unsure of how to tell the program that this list, "cells", contains the the two network neurons.
Code: Select all
//// Prepare to record spike trains
objref netcon, vec, spikes, nil // nil is an alias for NULLobject
spikes = new List()
for i=0, cells.count()-1 { // iterate over all cells
vec = new Vector()
netcon = new NetCon(cells.object(i),nil)
netcon.record(vec) // vec will record the firing times
spikes.append(vec) // add vec to the list of vectors that record firing times
}
objref netcon, vec // these are not needed anymore
objref graster, spikey
graster = new Graph(0)
graster.size(0, tstop, 0, cells.count())
graster.view(0, 0, tstop, cells.count(), 300, 105, 300.48, 200.32)
proc showraster() {
graster.erase_all()
for i=0, cells.count()-1 { // iterate over all cells
// number of elements in spikey must equal number of spikes fired by cell i
// value of each element must equal i+1
spikey = spikes.object(i).c
spikey.fill(i+1)
spikey.mark(graster, spikes.object(i), "|", 6)
}
objref spikey // this is not needed anymore
}
proc init() {
finitialize(v_init)
fcurrent()
graster.erase_all
}
proc run() {
running_ = 1
stdinit()
continuerun(tstop)
showraster()
}
Sean Powell