namrata27 wrote:I would like to generate the shape plot using the code, which I create using GUI. However the session file saved for this GUI session doesnt produce comparable results.
Yes, it is easy to make a graph that shows the shape of the cell rendered with a color scheme that reflects the value of a range variable--
NEURON Main Menu / Graph / Shape plot
creates a new Shape window,
then click on the Shape window's menu box (in its left upper corner) and select "Shape plot" from the popup menu
and the result is a false color depiction of the cell's branched architecture. By the way, this false color graph is actually an instance of the PlotShape class.
All well and good. BUT if you save the Shape plot to a session file, then read that session file, you get an ordinary Shape window with all sections drawn in black, no color scale, and the cell shape remains black throughout the simulation. You _could_ click on the Shape window's menu box and select "Shape plot" again, but since you're writing code you can just take advantage of the exec_menu method, a feature of the Graph and Shape classes that is equivalent to selecting one of the items in the graph's menu--see
http://www.neuron.yale.edu/neuron/stati ... #exec_menu
For example, if you used the GUI to set up your false color plot, and saved the GUI to a session file called plotshape.ses, you can
Code: Select all
// the next line assumes that there is only one PlotShape in the session file
PlotShape.exec_menu("Shape Plot") // this enables the "false color" feature
If you wrote your own hoc code to create a PlotShape, it would look something like this:
Code: Select all
ps = new PlotShape()
ps.variable("v") // when fully configured, will show membrane potential in color
fast_flush_list.append(ps) // so ps will be updated during a simulation
ps.exec_menu("View = plot") // makes sure the entire cell fits in the window
ps.exec_menu("Shape Plot") // this enables the "false color" feature
// if you expect v to lie in the range low..high and need to adjust the mapping of v to color
I would like to create the shape plot after some giving time t(ms) for example after 5000ms.
I'll answer this separately.