![]() |
|
Home | |
Manual
|
Part A.2 Using the Graphical User Interface (nrngui)This simulation starts with the soma that was created in the previous tutorial (Soma.hoc). Open this file and save it under a different name (SomaGUI.hoc) in the same directory. We will now be working with this new file. To ease the process of running simulations, has a standard run library of useful functions. There are many ways to load the standard run library. Probably the most convenient is to add the following to the beginning of your SomaGUI.hoc file: load_file("nrngui.hoc") - place this on the first line of the program. In the sample code it is on line 8 because line 8 is actually the first line of code. Line 1-7 are comments. Note: Strictly speaking, load_file("nrngui.hoc") isn't necessary for UNIX users who type nrngui myfile.hoc because
they will automatically get the GUI library and the Main Menu. However it is
needed for portability (MSWin users who click on hoc files
from Windows Explorer don't get this unless the file contains a load_file("nrngui.hoc") statement.
After adding the line above, please run this file (see section A.1 on how to run a .hoc file). After running the file you should end up with the display shown at the end of tutorial A.1, the terminal window, as well as another window called Main Menu. If this second window doesn't show up, it may be behind the terminal window that shows the results of running the program.
A.2.a. The Main MenuAs mentioned before, the load_file("nrngui.hoc") ensures that we have a " Main Menu" window on the screen: The Main Menu toolbar, can be used to pop up graphical tools for controlling, displaying, and analysing model parameters and simulation results. The window contains menus File, Edit, Build, Tools, Graph, Vector and Window. We will first explore the tool for Running a simulation and then look at the tool for graphing the values. A.2.b. GUI Run Control (Tools>>RunControl)Under the Tools menu select RunControl. This generates a window that allows you to view and control primary parameters for running the simulation. These parameters include tstop that is already part of our program (SomaGUI.hoc). Note that the tstop value in the RunControl window reflects the value set in our program i.e. 300 ms. The graphic below describes the various buttons found in the RunControl Window. ![]()
A.2.c. Running and changing parameters from either the GUI or the command lineThe command line window (terminal window) and the RunControl GUI window you just opened are linked. To prove this, in the command line window type the lines below and watch the values in the RunControl Window. Hit the enter/return key after each line. Be sure you can see both windows before proceeding. You should see the following (you need to type the maroon, italicized text): oc>print tstop You should see the following in the terminal window: In addition, the text in the RunControl>>Tstop (ms) variable text box should have changed to 100 and a red checkmark should appear in the check box between the button and the text box. Toggle back to the default Tstop time by unchecking the check box with the red check. Then click on the button to run the simulation again. The value in the t(ms) box should increment. Other then that nothing should change in either window.Now type oc> print tstop What happens? It should display 300, or whatever number follows "tstop =" in your code. A.2.d. Graphing changes in voltage over timeIn addition to controlling the simulation we will want to observe the voltage changes in the soma over the period of simulation (300ms in our current example). Currently all we can see is the final voltage in the soma by typing print soma.v at the terminal oc> prompt. To get a better view of what is happening to the voltage at specific timepoints it would make sense to graph the changes. Under the Graph menu of the main window, select Voltage axis. This generates another window that will display voltage on the y-axis and time on the x-axis. In the current example the soma is the default section, so the soma voltage will be plotted by default. When there is more than one section (e.g. when we have added dendrites - outlined in the next section) then we must specify which section to plot. You can open as many voltage or other graph windows as you like adjusting what section is graphed in each. Now, run the simulation by clicking on the Init & Run button in the RunControl window or by typing oc>run() in the terminal window. Observe the voltage being graphed. You should end up with a voltage graph similar to that illustrated to the below. A.2.e. Visualizing the result of changes to different mechanismsThe most obvious change would come from adjusting the amount of current that is passed through the electrode. In the Soma.hoc file the properties of the electrode point process were as follows: objectvar electrode In some versions of NEURON, the X in the top-right portion of the windows aren't functional. If this is the case, close the RunControl window by clicking on the Close text in the upper left portion of the window. Using the command line in the terminal window to make changes
|
AcknowledgementsLast modified on 10/29/04 by based on tutorial written by |