I have been using the code below to automate the process of calculating ROI stats for multiple ROI's in ENVI+IDL 4.8
envi_select,title='input filename',fid=fid,pos=pos
name=envi_pickfile(title='roi file',filter='*.roi')
envi_restore_rois,name
roi_ids=envi_get_roi_ids(fid=fid,roi_names=roi_names)
npts=1100
pts=fltarr(5,npts)
base=widget_auto_base(title='roi selection')
wm=widget_multi(base,list=roi_names,uvalue='list',/auto)
result=auto_wid_mng(base)
ptr=where (result.list eq 1, count)
result=dblarr(n_elements(pos))
openw,1,'stats_calc.txt'
for i=0L, count -1 do begin
for j=0L,n_elements(pos) -1 do begin
dims=[envi_get_roi_dims_ptr(roi_ids[ptr[i]]),0,0,0,0]
envi_stats_doit,fid=fid,dims=dims,pos=pos,comp_flag=0,$
report_flag=0,mean=mean,stdv=stdv,dmin=dmin,dmax=dmax
endfor
printf,1,roi_names[ptr[i]],dmin,dmax,mean,stdv,format="(A,2(F12.6),2(F14.6),2(F14.6),2(F14.6))"
endfor
close,1
end
however when I am using more than 750 ROI's I get the following error:
% Compiled module: $MAIN$.
% Out of range subscript encountered: ADDR.
% Execution halted at: ENVI_ROI_GET_ADDR
% ENVI_GET_ROI
% ENVI_STATS_DOIT
Any ideas why it stops to 750 and how I can fix that?
Thanks in advance
Dimitris
|