;;takes an array of images filenames, samples, lines, and bands;;outputs new files all with the same number of lines and samples;;also outputs a file that it is the sum of all the imagespro resize, nimgs, names, ns, nl, nbnew_ns = min(ns)new_nl = min(nl)new_nb = min(nb)allims = fltarr(new_ns, new_nl)for i=0, nimgs-1 do begin	openr, un, /get, names(i)	curim = bytarr(nb(i), ns(i), nl(i))	readu, un, curim	allims(j,*,*) = allims + total(curim(*, 0:new_ns-1, 0:new_nl-1), 1);;	openw, oun, /get, STRING(names(i) + '.out');;	writeu, oun, curim(0:new_nb-1, 0:new_ns-1, 0:new_nl-1);;	close, oun;;	free_lun, oun	close, un	free_lun, unendforallims = FIX(allims/nimgs)openw, oun, /get, 'combined'writeu, oun, allimsclose, ounfree_lun, ounprint, 'new_ns', new_nsprint, 'new_nl', new_nlend