There is no documented way to programmatically access the ROI Separability tool in ENVI. Below is a sample program that will show you how to get what you need, but it comes with a few caveats. The routine (envi_roi_separability_doit) is 100% undocumented, which means that it is not covered by technical support. In other words, it may change or disappear at any time, without warning. If this change in status breaks code you have developed that relies on the routine, you are on your own. Also, there is currently no way to bypass the report window and pass the separability values directly to a text file. A large batch job might end up generating many, many report windows. You will have to manually export the text to ASCII if that is your end goal.
=====================================
pro roi_sep_test
compile_opt idl2
;Open input file and generate a pos array
input_file = dialog_pickfile(title='Select Input File')
envi_open_file, input_file, r_fid=input_fid
envi_file_query, input_fid, nb=nb
pos = lindgen(nb)
;Remove all ROIs currently open
roi_cleanup = envi_get_roi_ids()
envi_delete_rois, roi_cleanup
;Open ROI file and retrieve ROI IDs
roi_file = dialog_pickfile(title='Select Associated ROI File')
envi_restore_rois, roi_file
input_rois = envi_get_roi_ids()
;Returns separability report window for selected ROIs
envi_roi_separability_doit, fid=input_fid, pos=pos, roi_ids=input_rois
end
|