Last modified: December 2013

AHELP for CIAO 4.11 ChIPS v1


Context: regions


Retrieves the attribute value(s) of the region.


get_region(id, attribute)


The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attribute The name of the attribute to retrieve, such as '' or 'edge.color'.

The get_region command returns a structure containing all the attribute values of the region. To retrieve the value of a specific attribute, provide the attribute name and the id or ChipsId of the object.

Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id.

Please see the section "Region Preferences and Attributes" below the examples for a list of the region attributes.

To see if a region is hidden or visible, use the get_region_visible command.

Advanced Functions

The module of advanced ChIPS functions contains other commands for retrieving attribute values (refer to "ahelp chips" for information on loading the module):



Example 1

chips> add_region([.1,.1,.7,.9,.7], [.07,.95,.95,.65,.07],
" fill.color=salmon")
chips> print(get_region())
chips> print(get_region("reg1", "fill.color"))

A region is created and becomes current. Calling get_region with no argument returns all the attributes of the object. get_region is called a second time to return just the "fill.color" attribute.

Example 2

chips> add_region([.1,.1,.7,.9,.7], [.07,.95,.95,.65,.07],
" fill.color=salmon")
chips> add_region(3,.3,.3,.3, " fill.color=plum")
chips> print(get_region("reg1"))

Two regions are created. get_region is called with the id of the first region, returning all attributes.

Example 3

chips> id = ChipsId()
chips> id.region = "reg1"
chips> print(get_region(id))

A ChipsId structure is created and the id.region field is set to "reg1". get_region is called with the ChipsId.

Example 4

chips> ri = get_region()
chips> print(ri)

Retrieve a structure containing the attribute values of the current region and store the results in "ri". Print the contents of "ri".

Region Preferences and Attributes

The attributes associated with regions are given in the following table, where the "Set?" column refers to whether the attribute can be changed using the set_region() command. To change the region preference settings prepend "region." to the attribute name.

Attribute Description Options Default Set?
angle Angle, in degrees, at which the region is drawn -360.0 to 360.0 0.0 Yes
coordsys coordinate system for the region PIXEL, WINDOW_NORM, FRAME_NORM, PLOT_NORM, DATA see "ahelp coordsys" No
depth Integer value indicating region depth see the Depth section of "ahelp chipsopt" default Yes
edge.color region edge color name or hex; see the Color section of "ahelp chipsopt" green Yes stipple pattern used to draw the region edges see the Line Style section of "ahelp chipsopt" chips_solid Yes
edge.thickness Thickness of the region edge 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 Yes
fill.color region fill color name or hex; see the Color section of "ahelp chipsopt" green Yes Fill style for the region see the Fill Pattern section of "ahelp chipsopt" 0 (no fill) Yes
opacity Opacity of the region fill 0.0 to 1.0, inclusive, where 0 is fully transparent and 1 is fully opaque 0.5 Yes
stem stem used for region id An alpha-numeric character sequence that does not contain a space reg No


See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

add_region, current_region, delete_region, display_region, hide_region, move_region, set_region, shuffle_region
load_fill, set_current