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
Posts: 3
Joined: Fri May 04, 2018 4:26 pm

saving recordings automatically

Post by guloncu »

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?


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

Re: saving recordings automatically

Post by ted »

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 (by using NEURON Main Menu / File / save session).

Code: Select all

from neuron import h,gui

# 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):

Post Reply