This routine is obsolete and has been replaced by ENVIUI::SelectInputData.
This routine produces a widget that prompts you to select a file from those that have already been opened. ENVI_SELECT produces ENVI Classic’s Input Selection Dialog by File/Band, including buttons for spatial and spectral subsetting and for choosing a mask band. This routine also incorporates the functionality of ENVI_PICKFILE because the widget includes a button to open ENVI-format files from disk. ENVI_SELECT not only returns an FID for the selected file, but also the DIMS and POS variables that will likely be required for further processing.
Syntax
ENVI_SELECT [, /BAND_ONLY] [, DIMS=variable] [, FID=variable] [, /FILE_ONLY] [, FILE_TYPE=integer] [, /MASK] [, M_FID=variable] [, M_POS=variable] [, /NO_DIMS] [, /NO_SPEC] [, POS=variable] [, /ROI] [, TITLE=string]
Keywords
BAND_ONLY
Set this keyword to disable selection of files using the Input File toggle button and to only allow band selection.
DIMS
Use this optional keyword to specify a named variable that contains the spatial dimensions of the file.
FID
Use this keyword to specify a named variable that will contain the file ID of the selected file when the OK button is selected. If FID[0] = -1, the Cancel button was selected and the user should take the appropriate action.
FILE_ONLY
Set this keyword to disable selection of single bands using the Input band toggle button and only allow file selection.
FILE_TYPE
Set this keyword to an integer value specifying the allowable file type. Only files with matching types are considered valid. See ENVI_FILE_TYPE for details on how to determine the integer value of a file type.
MASK
Set this keyword to allow selection of a mask.
M_FID
Use this keyword to specify a named variable that will contain the file ID of the selected mask file. To enable mask selection, you must set the MASK keyword.
M_POS
Use this keyword to specify a named variable that will contain the band position of the selected mask. To enable mask selection, you must set the MASK keyword.
NO_DIMS
Set this keyword to disable spatial subsetting.
NO_SPEC
Set this keyword to disable spectral subsetting.
POS
Use this keyword to specify a named variable that will contain an array holding the bands selected.
ROI
Set this keyword to allow ROI subsetting. The array element DIMS[0] contains the ROI pointer.
TITLE
Use this keyword to specify the string used in the title bar of the File Selection dialog window.
Example
This example shows how to select a file or band and return the FID, DIMS, and POS information. This is typically the simplest use of ENVI _SELECT. Also, if you click the Cancel button (FID[0] = -1), then return from the current user procedure as shown below.
ENVI_SELECT, fid=fid,dims=dims,pos=pos
if (fid[0] eq -1) then return
The following example allows you to select a single classification band with no spatial subset. The FILE_TYPE keyword set to “Classification” only allows you to select a classification band and issues a warning on attempts to select non-classification data. You can use the keyword FILE_TYPE keyword with any file type, not just classification images. The BAND_ONLY and NO_DIMS keywords limit you to only allow a single band with no spatial subset. The returned file ID and band number are retrieved with the FID and POS keywords, respectively. Use the keyword TITLE to set the dialog title bar to "Classification Input File."
ftype = ENVI_FILE_TYPE('Classification')
ENVI_SELECT, fid=fid, pos=pos, /band_only, $
/no_dims, file_type=ftype, $
title='Classification Input File'
if (fid[0] eq -1) then return