saving recordings automatically

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc.
Post Reply
guloncu
Posts: 3
Joined: Fri May 04, 2018 4:26 pm

saving recordings automatically

Post by guloncu » Wed Oct 23, 2019 5:36 am

Hi,
I have created a cell on GUI and I am applying IClamp, SinClamp and INoise from soma. I am recording the voltage from a segment and saving that as .dat file from "print" dropdown menu. But, I have to do this process for hundreds of time. Is there a way I can automatize this process?

Thanks

ted
Site Admin
Posts: 5620
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: saving recordings automatically

Post by ted » Mon Oct 28, 2019 1:09 pm

It's called programming. If you've never done it before, it's time to start learning, hire somebody to do it for you, or develop a collaboration with somebody who knows how. We strongly suggest Python for all new programming projects. Fortunately, it's easy to use GUI-built models with Python. Here's a stub to help get you (or your collaborator) going. It assumes that you have saved your GUI-built model to a session file called mymodel.ses (by using NEURON Main Menu / File / save session).

Code: Select all

from neuron import h,gui
h.load_file('mymodel.ses')

# here insert statements that set up recording of t (time) 
# and v from the segment of interest
# to a pair of instances of the Vector class

# here define a procedure called save_data()
# that expects an integer numerical argument
# and writes the contents of the time and voltage vectors to an output file
# called result_i.dat
# where i is the value of the argument

NUMRUNS = 3 # for testing; change to whatever value you like

for i in range(NUMRUNS):
  h.run()
  save_data(i)

Post Reply