Dear All,
I am trying to make the xtra mechanism work using NEURON+Python in order to perform extracellular stimulation of a bundle of axons.
I got the xtra.mod from
http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip.
Code: Select all
import neuron
from neuron import h
# create a section (cable)
axon = h.Section()
axon.L = 3000
axon.nseg = 100
axon.diam = 3
axon.cm = 1
axon.Ra = 200
axon.insert('hh')
axon.el_hh = -54.3
axon.gkbar_hh = 0.036
axon.insert('extracellular')
axon.insert('xtra')
In order, to be able to use xtra, I understand that I have to set the pointers im_xtra and ex_xtra. I tried to do it the two following ways, which were mentioned in this thread but I get the following error for the two
TypeError: setpointer(_ref_hocvar, 'POINTER_name', point_process or nrn.Mechanism))
Code: Select all
for sec_id in h.allsec():
sec_id.push()
for seg in sec_id:
h.setpointer(seg._ref_i_membrane, 'im_xtra', seg.xtra)
h.setpointer(seg._ref_e_extracellular, 'ex_xtra', seg.xtra)
h.pop_section()
Code: Select all
h.setpointer(axon(0.5)._ref_i_membrane, 'im_xtra', axon(0.5).xtra)
h.setpointer(axon(0.5)._ref_e_extracellular, 'ex_xtra', axon(0.5).xtra)
Could anyone explain me why I get this error ?
I also have a second problem, if I tried to insert the mechanism directly the code of my whole model and so that I might still get after this problem, so might as well also ask for this one here. For example, I would like to drive is_xtra
Code: Select all
h.tstop = 10
h.dt = 0.0025
f = 0.1 # 100 Hz
t = np.linspace(0, h.tstop, (h.tstop+2*h.dt)/h.dt, endpoint=True)
signal = np.sin(2*math.pi*freq*t)
svec = h.Vector(self.signal)
svec.play(axon(0.5).is_xtra,t)
for this I get
AttributeError: 'nrn.Segment' object has no attribute 'is_xtra'
and if I change the last line by
Code: Select all
svec.play(axon(0.5)._ref_is_xtra,t)
I get
NameError: _ref_is_xtra was not made to point to anything at __nrnsec_0x32d86a0(0.5)
So, I am not really sure how to address the global variable is_xtra, neither if I can drive it using the function play in Python. I have seen in the documentation of xtra that it is possible to do it using hoc and I read the example in the zip folder. I also currently use the function play this way in Python but using an IClamp and it works properly.
Could you indicate me the appropriate way to use the play function in Python in order to drive the is_xtra global variable ?
Thank you, Yann