Use this procedure to compute ROC curves, which compare a series of rule-image classification results for different threshold values with ground truth information. A probability of detection (Pd) versus probability of false alarm (Pfa) curve and a Pd versus threshold curve are reported for each selected class (rule band). ENVI Classic can calculate a ROC curve using either a ground truth image or using ground truth ROIs.
Syntax
ENVI_DOIT, 'ROC_CURVE_DOIT', CDIMS=array, CFID=file ID, CPOS=array [, GDIMS=array] [, GFID=file ID] [, GPOS=array] [, GT_PTR=array], MAX_THRESH=value, METHOD={0 | 1}, MIN_THRESH=value, /PLOT_THRESH, PPC=long integer, PPW=long integer [, RESULT=variable] [, ROI_IDS=value]
Keywords
CDIMS
Use this keyword to specify the spatial dimensions on which to perform the operation. CDIMS, CFID, and CPOS define the classification rule image used to compute the ROC curves. CDIMS is a five-element array of long integers with the following definitions:
- CDIMS[0]: A pointer to an open ROI; use only in cases where ROIs define the spatial subset. Otherwise, set to -1L.
- CDIMS[1]: The starting sample number. The first x pixel is 0.
- CDIMS[2]: The ending sample number
- CDIMS[3]: The starting line number. The first y pixel is 0.
- CDIMS[4]: The ending line number
CFID
Use this keyword to specify the file ID for the open classification rule image file. CDIMS, CFID, and CPOS define the classification rule image used to compute the ROC curves. CFID is the value returned from the keyword R_FID in the ENVI_OPEN_FILE procedure. CFID is a long integer with a value greater than 0. An invalid file ID has a value of -1.
CPOS
Use this keyword to specify an array of band positions, indicating the band numbers on which to perform the operation. CDIMS, CFID, and CPOS define the classification rule image used to compute the ROC curves. CPOS is an array of long integers, ranging from 0 to the number of bands minus 1.
GDIMS (optional)
Use this keyword to specify the spatial dimensions on which to perform the operation. GDIMS, GFID, and GPOS define the ground truth classification image used to compute the ROC curves. GDIMS is a five-element array of long integers with the following definitions:
- GDIMS[0]: A pointer to an open ROI; use only in cases where ROIs define the spatial subset. Otherwise, set to -1L.
- GDIMS[1]: The starting sample number. The first x pixel is 0.
- GDIMS[2]: The ending sample number
- GDIMS[3]: The starting line number. The first y pixel is 0.
- GDIMS[4]: The ending line number
If you do not set the keyword ROI_IDS, then you must set GDIMS, GFID, GPOS, and GT_PRT.
GFID (optional)
Use this keyword to specify the file ID for the open ground truth classification image file. GDIMS, GFID, and GPOS define the ground truth classification image used to compute the ROC curves. GFID is the value returned from the keyword R_FID in the ENVI_OPEN_FILE procedure. GFID is a long integer with a value greater than 0. An invalid file ID has a value of -1. If you do not set the keyword ROI_IDS, then you must set GDIMS, GFID, GPOS, and GT_PTR.
GPOS (optional)
Use this keyword to specify an array of band positions, indicating the band numbers on which to perform the operation. GDIMS, GFID, and GPOS define the ground truth classification image used to compute the ROC curves. GPOS is an array of long integers, ranging from 0 to the number of bands minus 1. If you do not set the keyword ROI_IDS, then you must set GDIMS, GFID, GPOS, and GT_PTR.
GT_PTR (optional)
Use this keyword to specify a link between the ground truth class and the corresponding rule image classes. For example, the ground truth class value (the actual pixel value of the ground truth classification image) GT_PTR[k] corresponds to the class created from the rule image band CPOS[k]. GT_PTR is an array of long integers with the same number of elements as CPOS. If you do not set the keyword ROI_IDS, then you must set GDIMS, GFID, GPOS, and GT_PTR.
MAX_THRESH
Use this keyword to specify the threshold maximum for classifying the rule images. The points per curve, as specified by PPC, are evenly distributed between MIN_THRESH and MAX_THRESH.
METHOD
Set this keyword equal to one of the following values to specify the method for classifying the rule images.
MIN_THRESH
Use this keyword to specify the threshold minimum for classifying the rule images. The points per curve, as specified by PPC, are evenly distributed between MIN_THRESH and MAX_THRESH.
PLOT_THRESH
Set this keyword to enable plotting the probability of detection (PD) versus threshold plot. The default is to only plot the ROC curves.
PPC
Use this keyword to specify the number of points per ROC curve. The points are evenly distributed between MIN_THRESH and MAX_THRESH. PPC is a long-integer value greater than or equal to 2.
PPW
Use this keyword to specify the maximum number of plots per plot window. PPW is a long-integer value greater than 0.
RESULT (optional)
Use this keyword to specify a named variable that contains the x,y data from the ROC curves. RESULT is a double-precision array of size [num_points, 2, num_classes]. The x and y values are calculated for each class as follows:
x = reform(result[*,0,i])
y = reform(result[*,1,i])
ROI_IDS (optional)
Use this keyword to specify the ground truth ROIs. ROI_IDS are the selected IDs of the ground truth ROIs returned from the function ENVI_GET_ROI_IDS. If you do not set ROI_IDS, then you must set GDIMS, GFID, and GPOS.
API Version
4.3