Load a value located in a text file

Anything that doesn't fit elsewhere.

Load a value located in a text file

Postby freddy09 » Thu May 29, 2008 8:38 am

Hi !!
I try to load in one electrode an amplitude which is written in a text file with NEURON.
How can i make it?
freddy09
 
Posts: 17
Joined: Tue Mar 18, 2008 6:06 am
Location: LIRMM

Postby ted » Thu May 29, 2008 11:14 am

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
ted
Site Admin
 
Posts: 3588
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Postby freddy09 » Tue Jun 03, 2008 4:00 am

I made one program, but it didn't work
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


It write only vector[3] or anything else but it didn't load the value
freddy09
 
Posts: 17
Joined: Tue Mar 18, 2008 6:06 am
Location: LIRMM

Postby ted » Tue Jun 03, 2008 10:23 am

To figure out how to print the contents of a Vector, see the Programmer's Reference
documentation about the Vector class's methods.
ted
Site Admin
 
Posts: 3588
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Postby freddy09 » Wed Jun 04, 2008 8:15 am

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.

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()}

freddy09
 
Posts: 17
Joined: Tue Mar 18, 2008 6:06 am
Location: LIRMM


Return to Other questions

Who is online

Users browsing this forum: No registered users and 0 guests