divise image envi-idl [message #70971] |
Tue, 18 May 2010 07:58 |
tonino
Messages: 4 Registered: May 2010
|
Junior Member |
|
|
Hi all,
I am a very beginner in IDL
I try to write a batch to divise my image but apparently, the values
of the loop are wrong... could someone explain me what is wrong ?
thanks a lot
here is the code :
pro tuilage
ENVI, /RESTORE_BASE_SAVE_FILES
ENVI_BATCH_INIT
image = 'C:\Documents and Settings\Administrateur\Mes documents
\cooccurrence+1+2'
envi_open_file, image, r_fid=fidimage, /NO_REALIZE
if (fidimage eq -1) then begin
print, 'error nestor'
endif
envi_file_query, fidimage, dims = dimimage, NB=NBimage, NL=NLimage,
NS=NSimage
pos = lindgen(NBimage)
result = dblarr(NSimage/5, NLimage/2, NBimage)
for i = 0, (NSimage-NSimage/5), NSimage/5 do begin
for j = 0, (NLimage-NLimage/2), NLimage/2 do begin
result = image[i:i+((NSimage/5)-1),j:j+((NLimage/2)-1),
0:NBimage-1]
envi_write_envi_file, result, data_type=4
outname = STRCOMPRESS('C:\Documents and Settings\Administrateur
\Mesdocume\'+string(i/(NSimage/5))+string(j/(NLimage/2)),/RE MOVE_ALL)
openw, lun, outname, /Get_lun
close, lun
free_lun, lun
endfor
endfor
end
|
|
|