next up previous contents
Next: Generating a low level Up: Commands for working with Previous: Finding objects from a

Executing macros according to a selection within a graphic structure

 

runevent Find a graphical object for a given point and run a macro
<graphic> name of the graphic structure
-mac <macro>; macro and its parameters
< tex2html_wrap_inline10510 > < tex2html_wrap_inline10512 > ... < tex2html_wrap_inline10514 > < tex2html_wrap_inline10516 > (x, y) pairs

This command executes the specified macro for all the objects inside a region defined with ( tex2html_wrap_inline10532 , tex2html_wrap_inline10534 ) points. If only one point has been specified, then an object closest that point is located. If several points have been specified, those points are interpreted as corner points of a region and all objects inside that region are located. Located objects are converted into the identifiers of the owners of the objects, and then for each identifier the macro is executed in the following manner:

runcmd <macro> <graphic> <id>

The objects are located from a low level image and, thus, the specified coordinates are typically within the space tex2html_wrap_inline10490 . In practice, the points for this procedure are received from mouse events.

Note that after the <macro> name you must put a `;'. Thus you can also specify additional parameters for the macro.

Example: A graphic structure has been created and layer 2 selected to be displayed. Then the topmost object for point (0.2, 0.2) is located and macro selectNeuron is executed.

...
NDA> mkgrp grp1 -s s1
NDA> layer grp1 -l 2
...
NDA> runevent grp1 -mac selectNeuron; 0.2 0.2

The macro selectNeuron can select neurons into a classified data (grouping of the neurons) as follows:

...
addcld -c $1grp
addcld -c $1grp -cl $1grp.sel
updcld -cl $1grp.sel $2
...


next up previous contents
Next: Generating a low level Up: Commands for working with Previous: Finding objects from a

Anssi Lensu
Tue Jul 23 11:58:18 EET DST 2002