Hi !!
I try to load in one electrode an amplitude which is written in a text file with NEURON.
How can i make it?
Load a value located in a text file
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
See this item which I have just added to the Hot tips area of this Forum:
How to read numerical values from a file
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=1265
How to read numerical values from a file
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=1265
I made one program, but it didn't work
It write only vector[3] or anything else but it didn't load the value
Code: Select all
//begin.hoc
load_file("nrngui.hoc")
load_file("window_value.ses")
//window_value.ses
proc load() {xopen("loading.ses")}
{
xpanel("Loaded Value", 0)
xbutton("Load","load()")
xpanel(500,600)
}
//loading.ses
objref minfvec, vvec
clipboard_retrieve("na_m.inf")
minfvec = hoc_obj_[0]
vvec = hoc_obj_[1]
print "first value ", minfvec
print "second value ", vvec
Hi!!
I load the value located in the file with success. But i can't affect this value to the electrode. There is a syntax error according the simulator.
This is a part of my program, if you want, i can send you my project.
I load the value located in the file with success. But i can't affect this value to the electrode. There is a syntax error according the simulator.
This is a part of my program, if you want, i can send you my project.
Code: Select all
//recuperation.ses
objref minfvec, vvec
amp_electrode = 0
minfvec = new Vector()
vvec = new Vector()
clipboard_retrieve("na_m.inf")
minfvec = hoc_obj_[0]
vvec = hoc_obj_[1]
minfvec.printf
vvec.printf
for i=0, minfvec.size - 1{ amp_electrode = minfvec.get(i)
print"l'amplitude vaut ", amp_electrode
xopen("process.ses")}
//process.ses
{load_file("nrngui.hoc")}
objectvar save_window_, rvp_
objectvar scene_vector_[6]
objectvar ocbox_, ocbox_list_, scene_, scene_list_
{ocbox_list_ = new List() scene_list_ = new List()}
{pwman_place(0,0,0)}
load_file("electrod.hoc")
ocbox_=new Electrode(0)
execute("can_locate=1 sec=\"node[0]\" xloc=0.15 locate(0)", ocbox_)
execute("vc.dur[0]=0 vc.amp[0] = amp_electrode", ocbox_)
execute("vc.dur[1]=0 vc.amp[1]=0", ocbox_)
execute("vc.dur[2]=0 vc.amp[2]=0", ocbox_)
execute("stim.del=0 stim.dur=0 stim.amp=0", ocbox_)
execute("vcsteps=0", ocbox_)
execute("samp=stim.amp store_vclamp() glyph()", ocbox_)
ocbox_ = ocbox_.v1
ocbox_.map("Electrode", 1086+20*i, 318, 210, 327)
objectvar scene_vector_[1]
{doNotify()}