本来以为ROI只能存为roi之类的格式,结果为了存为分类影像还自己用IDL跑了结果,下面是roi转为tiff格式的程序:
PRO ROITOTIFF
filters = '*.txt'
inputfile = DIALOG_PICKFILE(TITLE = 'Please Select a ROI File' ,/READ, FILTER = filters)
IF inputfile EQ '' THEN RETURN
outputfile = FILE_DIRNAME(inputfile) + '\' + FILE_BASENAME(inputfile,'.txt') + '.tif'
outputlog = FILE_DIRNAME(inputfile) + '\' + FILE_BASENAME(inputfile,'.txt') + '_logs.txt'
str = ''
OPENR, 1, inputfile
;Read the first line, check if this is a valid file
READF, 1, str
IF ~(STRCMP(str, '; ENVI Output of ROIs', 21)) THEN BEGIN
CLOSE, 1
result = DIALOG_MESSAGE('This is not a valid ENVI ROI text file!', /INFORMATION)
RETURN
ENDIF
;Wirte LOG file
OPE