Shape Plot Query

Anything that doesn't fit elsewhere.
Post Reply
namrata27

Shape Plot Query

Post by namrata27 »

Hello

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.

Secondly I would like to create the shape plot after some giving time t(ms) for example after 5000ms.

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

Re: Shape Plot Query

Post by ted »

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

load_file("plotshape.ses")
// the next line assumes that there is only one PlotShape in the session file
PlotShape[0].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

objref ps
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
// ps.scale(low,high)
I would like to create the shape plot after some giving time t(ms) for example after 5000ms.
I'll answer this separately.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Shape Plot Query

Post by ted »

namrata27 wrote:I would like to create the shape plot after some giving time t(ms) for example after 5000ms.
This can be done with the strategy describe in
Using events to implement "interrupts"
viewtopic.php?f=28&t=2769
Specifically, in proc userinthandler() just change this statement

Code: Select all

  print "replace this with what you want to happen when an interrupt occurs
to this

Code: Select all

  // flush (update) graphs on the fast_flush_list
  flushPlot()
  continue_dialog("interrupt!")
(I'm assuming that you have appended the PlotShape to the fast flush list). The continue_dialog() call pops up a window with a button labeled "interrupt!" and stops program execution; you have to click on the "interrupt!" button to allow the simulation to proceed. This is handy for development and debugging; you can comment out the continue_dialog line if you just want the program to race ahead without waiting for user action.
Post Reply