A copy of this file is also available in the \examples\tasks\baseclassexample folder of the ENVI installation path.
PRO ENVIImageThresholdExample, INPUT_RASTER=inputRaster, $
OUTPUT_RASTER=outputRaster, $
OUTPUT_URI=outputRasterURI, $
_REF_EXTRA=refExtra
COMPILE_OPT IDL2, hidden
inputData = inputRaster.GetData()
outputData = IMAGE_THRESHOLD(inputData, _EXTRA=refExtra)
outputRaster = ENVIRaster(outputData, URI=outputRasterURI)
outputRaster.Save
END