Personal tools
You are here: Home / cmgui / Wiki / Johns notes
Log in

Forgot your password?

Johns notes

Using the Scene Editor

I have been using the scene editor to display action potentials along one dimensional fibres and nerves. In order to do this I have read in the exnode and exelem files associated with the solution space (use gfx read node <filename> and gfx read elem <filename>) and also read in the .exelem file(s) that contain the potential fields.

Open the scene editor (gfx edit scene or use the graphics drop down menu) then select the g_element name that corresponds to the potential field (in the top list of the window)

In the 'Graphical element' tab, the dropdown box under 'General settings:' allows you to select lines, node_points etc. Select element_points and click add. Select the 'element_points..' option from the list below.

To display the grid points coloured with their potential:

1) Xi discretization mode: cell_corners (not really necessary but cell_centres gives an average of the corners located at the center of the element. This can be a problem if you are trying to view the gridpoint number) 2)Check the 'Native discretization field' boxand chose the field that you want to desplay (e.g. in my case potential)

3)Check the 'Data' box and select the desired field again.

This will now show all the gridpoints and give them a certain colour. Now go to the spectrum editor (gfx edit spectrum or from the graphics drop down menu) and select autorange and apply. This will now show the change in the gridpoint values graphically. (You can also change the range of the spectrum manually by typing in the boxes).

Editing glyph At the moment the gridpoints are only shown as points. In the scene editor go back to the 'element_points...' editing tab and in 'Glyph' select cylinder...> sphere. This changes the points into spheres. Their size can be changed in the 'Base glyph size' box. Just highlight all three values type in the new value (e.g. 0.2) and hit enter, it will fill itself in correctly.

Displaying CMGUI commands

Creating .com files is a much easier way to display graphics in CMGUI than doing it manually. For example, instead of changing the Scene Editor settings everytime you run CMGUI you can apply the changes you want and then use

'gfx li g_element scene <scene name> <g_element name> commands'

The scene name is the name that is displayed at the top left of the scene editor and the g_element name is the one that you modified from the top list in the scene editor.

Similarly 'gfx li spectrum <spectrum name> commands' give the commands necessar to perform the same changes to the spectrum (spectrum name is in the top left of the spectrum editor)

'gfx li window commands' for changing background colour, orientation of image etc.

By copying and pasting the commands into a .com file, the changes are done automatically when the .com file is run.

Creating an offset field

When displaying one dimensional nerve and muscle fibres it is often difficult to see the propergation of an action potential. One way around this is to scale the size of the glyphs by the value of the potential. Because the potential field ranges from -60 to 40mV (for example), a field that contains the potential values offset by 60 is required for easy scaling.

'gfx define field <new name> offset field <field name> offsets <#offset>'

where new name is the name of the new field that you are creating, field name is the name of the original field (e.g. potential) and #offset is the number with which the new field is offset (in this case 60).

Once this is done, in the scene editor go back to the 'element_points..' area and under the 'Base glyph size' box, check the 'Orientation/Scale' box. Then in the dropdown menu select the new field name. The reletive effect can be altered using the 'Scale factors' underneath. Also play with the base glyph size to get things right.