This routine only works with ENVI Classic display groups and cannot be used with the ENVI display or in code that starts the application with the ENVI function.

This function is used to create a new ROI and return its ROI ID. You can add points to the ROI using the procedure ENVI_DEFINE_ROI.

Syntax


Result = ENVI_CREATE_ROI([, COLOR=integer] [, FILL_MODE=integer] [, FILL_ORIEN=integer] [, FILL_SPACING=floating point] [, NAME=string], NL=value [, /NO_UPDATE], NS=value)

Keywords


COLOR (optional)

Use this keyword to specify the graphics color index of the ROI. The default value is 2.

FILL_MODE (optional)

Use this optional integer keyword to specify the IDL fill style for polygon ROIs. The default value is 1 (solid fill).

FILL_ORIEN (optional)

Use this optional integer keyword to specify the rotation of fill for polygon ROIs. This value must be greater than 1, and it is only used when the FILL_MODE value is greater than 1. The default value is 45.

FILL_SPACING (optional)

Use this optional floating-point keyword to specify the spacing of fill for polygon ROIs. This keyword is only used when FILL_MODE is greater than 1. The default value is 0.1.

NAME (optional)

Use this keyword to specify a string variable for the ROI name. The default string is New Region.

NL

Use this keyword to specify the ROI spatial line dimension tied to the ROI.

NO_UPDATE (optional)

Set this keyword to indicate that the newly created ROI should not appear in the ROI Tool dialog.

NS

Use this keyword to specify the ROI spatial sample dimension tied to the ROI.

Example


The following code, when placed in a program, creates a new ROI and adds a polygon to it using ENVI_DEFINE_ROI.

roi_id = envi_create_roi(color=4, name='Test roi', $
   ns=512, nl=512)
xpts = [100, 200, 200, 100, 100]
ypts = [100, 100, 200, 200, 100]
envi_define_roi, roi_id, /polygon, xpts=xpts, ypts=ypts

API Version


4.2