This routine is obsolete and has been replaced with the ENVIROI::PixelAddresses method.

This function returns the data associated with an ROI address.

If you have a large ROI and many bands in the POS array, then the memory requirements may exceed the capacity of your machine. One way to break up the problem is to request fewer bands in the POS array, process the data, and get the ROI for the next set of bands. To use less memory, only request one band at a time and loop on the number of bands.

The order of ROI locations within the returned array ADDR can be different when ENVI_GET_ROI_DATA is called with POS set to one band versus when it is called with POS set to more than one band. ADDR matches the order of the data in the returned array in either case (i.e., DATA[0] comes from location ADDR[0]). But the order of ADDR may be different for each case (i.e., ADDR1 may not match ADDR2).

Syntax


Result = ENVI_GET_ROI_DATA(ROI_ID [, ADDR=value], FID=file ID, POS=value)

Arguments


ROI_ID

This is a single ID returned from the function ENVI_GET_ROI_IDS.

Keywords


ADDR (optional)

Use this keyword to specify the addresses of each ROI data value returned from the function ENVI_GET_ROI. The returned data values match the corresponding input addresses.

FID

The file ID (FID) is a long-integer scalar with a value greater than 0. An invalid FID has a value of -1. The FID is provided as a named variable by any routine used to open or select a file. Often, the FID is returned from the keyword R_FID in the ENVIRasterToFID routine. Files are processed by referring to their FIDs. If you work directly with the file in IDL, the FID is not equivalent to a logical unit number (LUN).

POS

Use this keyword to specify the band position(s) to get ROI data for. If POS is a single element, the result is Result(npts). Otherwise, the result is Result(n_elements(POS), npts).