![]() |
|||
Home | |||
Manual
|
C.1 Creating multiple sC.1.a Defining a template to create many "typical s"In " B.2.Creating realistic morphology" we created a single subthalamic . However, the subthalamic nucleus is really made up of a network of interconnected s. Therefore, in our goal to create a realistic model of the subthalamic nucleus we will create 4 more s through the creation of a template. The template method will allow us in the future to create as many s by simply changing 1 line of code. In the subsequent tutorial we will link those 4 s together. As in previous tutorial we will use our previous code, Thalamic3.hoc, as a bases for the new and improved version. Therefore you should copy the Thalamic3.txt code into another file. Call this new file SubThalNucl1.hoc. Alternatively, you could open Thalamic3.txt in a text editor and use the save as feature to save it as SubThalNucl1.txt. You can find a copy of Thalamic3.hoc in the files directory of this site. Also, remember that to run the file you will need to change the extension from .txt to .hoc. A template is an object definition--it defines a prototype of an object from which we can create multiple copies. After defining the template, an object variable must be declared.. Then, we can create a new instance of the object from the template that is an exact copy of the template. After we create the new object instance with all the info from the template, we can either use it as it is or we can modify it to fit our needs. In the following tutorial we will be creating a template and an object (actually 4 objects) that will be defined by the instructions in the template. Creating the templateThe structure of a template is as follows: begintemplate name code endtemplate name where name is the name of the template we want to create, and code is any program commands that we want the template to include. Here is code that will transform Thalamic3.hoc code into a code that takes advantage of a template (again bold-green text is deleted; highlighted text is added: load_file("nrngui.hoc") //******START TEMPLATE ************** begintemplate SThcell
proc init() { local i, me, child1, child2
.... // Connect trees to somas
C.1.b Defining the s to be created from the templateCreating new s from this template is straightforward. If we define an array of object variables: / Connect trees to somas //tells program to create 4 SThcells //creates object variables called STHcells[] to hold information about each
of 4 cells we can then create all four of our cells using the new command in a for loop:
for i = 0, nSThcells-1 {
Using this loop 4 cells have been created(nSThcells). They are identified as
Remember that the indexing in arrays begins with 0 and therefore the for loop begins with 0 and ends with 1 minus the number of s we hope to create. Each cell is a complete subthalamic as we had described at the end of B2. Creating realistic morphology.
C.1.c Setting the point process in all the cellsSo far we've defined the cell membrane processes but, according to the code from SubThalNucl.hoc, only 1 cell is being activated. Furthermore, in our new network it is unclear which cell, if any will be activated. Looking at the code it is clear that the "soma" section will be activated but in our current version, there is no "soma" section. The references to the somas of the various cells are done called by SThcells[0-4].soma. Therefore, the code for adding a point process (ICLamp()) must be changed/modified/added. In this case we will delete the old code as shown below objectvar electrodesoma electrode = new IClamp(0.5) soma electrode.del=100 soma electrode.dur=100 soma electrode.amp = 0.45 Then we will replace it with the following for loop: objectvar electrode[nSThcells] for i = 0, nSThcells-1 SThcells[i].soma { electrode[i] = new IClamp(0.5) electrode[i].del = 100 electrode[i].dur = 100 electrode[i].amp = 0.45 } Finally, we need to remember to set a default section so that graphing works: access SThcells[0].soma print v forall psection() tstop=300 Save and run programNow it is time to save and run the SubThalNuc1.hoc. This file should provide, with some opening of Graphs and rotating of images, the following graphs:
In order to see what is illustrated you will need to open the Graph>>Shape Plot and the Graph>> Voltage Axis. Within the Shape plot you will need to right-click, select 3D Rotate and use the left button to rotate the display. If you don't rotate it, all s will be in the same plane and it will look as if there is only 1 .
Summary:
Next: Connecting the s together AcknowledgementsLast modified on 10/29/04 by based on tutorial written by |
||
AcknowledgementsLast modified on 10/29/04 by based on tutorial written by |