Dear all,
I am using VecStim regularly to stimulate NEURON models with a (or multiple) train of presynaptic activity. This could be, without python wrapping, a tedious process
Code: Select all
import numpy as np
from neuron import h
"""There should be some code here to create a neuron model with a soma"""
#To create a numpy array containing the stimulation time
tstim = np.array([10,20])
#To convert this array into a NEURON vector
tstim_n = h.Vector(tstim)
#Then create a VecStim object and play the NEURON vector
vplay = h.VectStim()
vplay.play(tstim_n)
#This is the pointprocess object
syn = h.ExpSyn(soma(0.5))
#To connect the pointprocess and play vector using a netcon
netcon = h.NetCon(vplay, syn)
netcon.weight[0] = 0.001
"""There should be some code here to launch a NEURON simulation"""
Wouldn't it better to have instead a single line of code to define the where, when, and what?
Code: Select all
tstims = np.array([10,20])
stimulation = connect(soma(0.5), tstims, {"ExpSyn", 0.001})
I have a git repository storing a code performing this action without too much steam (
https://github.com/rcaze/PlosCB2013). To do that I wrap things into python objects. But I am sure that the code could be cleaner, and I am curious to know how hard it would be to modify the underlying hoc, in order to get rid of the VecStim object (and the NetCon if possible). You are more than welcome to contribute and modify the code I posted on git, and to tell me if I am making my life too complicated.
Best,
Romain