Shape Plot

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc or Python
Post Reply
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Shape Plot

Post by stephanmg »

Dear NEURON users,

i would like to create a Shape Plot of a .hoc file, but, i want to select manually a rectangular area which is visualized.

How can this be accomplished?

All the best,
Stephan
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Shape Plot

Post by ted »

stephanmg wrote:i want to select manually a rectangular area which is visualized.
If that's what you really want, it can be accomplished by a combination of zooming in on the region of interest and manually resizing the window that contains the image. The latter is done as usual for your particular OS. The former is done by
1. Putting the graph in "Zoom" mode. Click on the graph's menu box (upper left corner), expose the graph's secondary menu (move the cursor up to "View . . . "), then select "Zoom in/out".
2. Clicking anywhere on the graph (just to the right of the area of interest is a good place) and, while holding the (left) mouse button down, dragging to the right to zoom in or to the left to zoom out. If it becomes necessary to drag the ROI into the center of the graph, this may be done by clicking and dragging with the middle mouse button depressed; the two button "chord" may work if your mouse has only two buttons, or you may prefer to switch the graph to "Translate" mode by selecting that item from the secondary menu, after which you can click and drag while holding the left button down (or single button if you're a Mac user).

When you have things arranged as you like them, you may want to save the shape plot to a session file so you can recreate it whenever you like; if you don't know how to do this, see
I've used the NEURON Main Menu to construct and manage models. How can I save what I have done?
in the FAQ list https://www.neuron.yale.edu/neuron/faq/ ... -questions

If you are only interested in visualizing a particular subset of sections, the easiest thing to do is to create a SectionList that contains the sections of interest, then create a Shape that shows only the sections in that SectionList. For example--
start neurondemo
select Pyramidal
at the oc> prompt execute the following hoc statements:

Code: Select all

objref sl
sl = new SectionList()
dendrite_1[8] sl.subtree() // dendrite_1[8] is the root section of the apical field
objref sh
sh = new Shape(sl) // sh will show only the neurites in the apical field
If you don't know the names of the sections you are interested in, use
NEURON Main Menu / Tools / Distributed Mechanisms / Viewers / Shape name
Click on a section in the shape plot -> it turns red and its name (in the scrollable list) is highlighted
Click on a name in the scrollable list -> the name is highlighted and the section in the shape plot turns red
stephanmg
Posts: 68
Joined: Tue Jul 03, 2012 4:40 am

Re: Shape Plot

Post by stephanmg »

Is there a way to select a point by its 3D coordinates? Like selecting (20,30,10) in the Shape Plot and then centering it? I did not find a way to do this.

All the best,
Stephan
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Shape Plot

Post by ted »

Use the Shape plot's "Set View" function, but be careful not to change the aspect ratio or the image will be distorted.

Click on the Shape plot's menu box and hold mouse button down
drag cursor up slightly so that the secondary menu appears
then drag to the right to reveal the secondary menu
and select "Set View".

You will see an "X size" window that presents an edit field that contains the current view's minimum and maximum x coordinates, e.g.
-523.704 547.706
Note their values. Let's call these xmin0 and xmax0.
Click in the edit field and change them to whatever you like--values that specify a range that contains the x coordinate of your point of interest would be appropriate.
When you are satisfied with the values you have entered (let's call these xmin1 and xmax1), click on Accept.

You will now see a "Y size" window that presents the current view's minimum and maximum y coordinates, e.g.
-228.056 831.661
Note their values. Let's call these ymin0 and ymax0.
Now enter values that span the y coordinate of your point of interest; let's call these ymin1 and ymax1.
To prevent distortion of the image, you must ensure that
(ymax1-ymin1) = (ymax0-ymin0)*(xmax1-xmin1)/(xmax0-xmin0)
Click on Accept when you are satisfied with the values you entered.
Post Reply