Place dot on on shape plot using .hoc code

The basics of how to develop, test, and use models.
Post Reply
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Place dot on on shape plot using .hoc code

Post by Corinne »

I am placing synapses on a realistic dendritic morphology via .hoc code for example:

Code: Select all

objref syn1
access dend[49]
syn1 = new AlphaSynapse(.928571) // place a synapse
//syn1 = new AlphaSynapse(0.642857)
syn1.get_loc()
syn1.onset = 1 // ms
syn1.tau = 5 // ms
syn1.gmax = .001 // uS
syn1.e = 0 // mV
Then I am making a PlotShape to see the voltage throughout the dendrite. On the PlotShape I would like to place a marker where I place each synapse. Is there a way to do this via .hoc code?
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Place dot on on shape plot using .hoc code

Post by Corinne »

Oh, and is there also a way to put a label by the dot that says the location such as "dend[49](0.64)"

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

Re: Place dot on on shape plot using .hoc code

Post by ted »

Read about the Shape class and its methods. I see that this can hard to find in the Programmer's Reference because the root "Shape" is part of many keywords. The easiest way to find it is in the quick index http://www.neuron.yale.edu/neuron/stati ... rence.html where there is a cluster of keywords at the very top. "Shape" is the one you want. If you scroll down into the body of the quick index, or if you use the alphabetical index, the link is called Shape-classes.

The pertinent item in the documentation of the Shape class is "point_mark()". To use this, you'll have to create an instance of a point process that is attached to the model at the location of interest--just use an IClamp with its amp parameter equal to 0 (the default value).

The Shape class has many other interesting methods that you may find useful.
is there also a way to put a label by the dot that says the location such as "dend[49](0.64)
The Shape class's label() method can print strings on the graph canvas. The only problem is discovering the coordinates of where to place it on the canvas. A crude but effective way to do this is
1. print the string to the middle of the canvas
2. select the Shape's "Move label" and drag the label to the desired location
3. save just this graph to a ses file
4. examine the ses file to discover the coordinates
5. revise your hoc code so that it uses these coordinates
Post Reply