comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Save ENVI stretched file as TIFF file in ENVI
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Save ENVI stretched file as TIFF file in ENVI [message #79291] Tue, 14 February 2012 05:56
titan is currently offline  titan
Messages: 59
Registered: March 2006
Member
Hi all,
I know that my question is not so difficult but I'm not able to find
where is the problem: I'm trying to save an image as tiff file after
stretching it. the original image is the result of a layer stacking.
in the following you can see the code.



ENVI_DOIT, 'ENVI_LAYER_STACKING_DOIT', FID=out_img_RGB_fid,
DIMS=out_img_RGB_dims,INTERP=0, OUT_BNAME=out_img_RGB_outbname,$
OUT_DT=1,
OUT_PROJ=ch01_fname_proj_info,
OUT_PS=ch01_fname_ps,POS=out_img_RGB_pos,$
/IN_MEMORY,
R_FID=out_img_RGB_r_fid

out_img_RGB_data=BYTARR(4400,3300,3)
out_img_RGB_data_RED=ENVI_GET_DATA(FID=out_img_RGB_r_fid,POS =0,
DIMS=out_img_RGB_dims)
out_img_RGB_data_GREEN=ENVI_GET_DATA(FID=out_img_RGB_r_fid,P OS=1,
DIMS=out_img_RGB_dims)
out_img_RGB_data_BLUE=ENVI_GET_DATA(FID=out_img_RGB_r_fid,PO S=2,
DIMS=out_img_RGB_dims)

out_img_RGB_data(*,*,0)=out_img_RGB_data_RED
out_img_RGB_data(*,*,1)=out_img_RGB_data_GREEN
out_img_RGB_data(*,*,2)=out_img_RGB_data_BLUE
out_img_RGB_data_band_names=['R_equaliz', 'G_equaliz', 'B_equaliz']
out_img_RGB_data_scaledBand_stretch = ENVI_DEFAULT_STRETCH_CREATE(/
EQUALIZE)
out_img_RGB_data_size=SIZE(out_img_RGB_data)
out_img_RGB_data_ns=out_img_RGB_data_size(1)
out_img_RGB_data_nl=out_img_RGB_data_size(2)
out_img_RGB_data_nb=out_img_RGB_data_size(3)
out_img_RGB_data_name='test_equaliz_'+orig_fname
out_img_RGB_data_def_bands=[0,1,2]

ENVI_WRITE_ENVI_FILE, out_img_RGB_data, DATA_TYPE=1,
NS=out_img_RGB_data_ns, NL=out_img_RGB_data_nl,
nB=out_img_RGB_data_nb,OFFSET=0,DEF_BANDS=out_img_RGB_data_d ef_bands,$
PIXEL_SIZE=ch01_fname_ps,
MAP_INFO=ch01_map_info_create,
DEF_STRETCH=out_img_RGB_data_scaledBand_stretch,$
BNAMES=out_img_RGB_data_band_names, OUT_NAME=path
+out_img_RGB_data_name, R_FID=out_img_RGB_data_r_fid ;
ENVI_FILE_QUERY, out_img_RGB_data_r_fid, DIMS=out_img_RGB_data_dims

out_img_RGB_data_tiff_name='test_equaliz_'+orig_fname+'.tif'
out_img_RGB_data_pos=[0, 1, 2]

ENVI_OUTPUT_TO_EXTERNAL_FORMAT, FID=out_img_RGB_data_r_fid,
DIMS=out_img_RGB_data_dims, POS=out_img_RGB_data_pos, OUT_NAME=path
+out_img_RGB_data_tiff_name, OUT_BNAME=out_img_RGB_data_band_names,/
TIFF

My problem is that even if as FID I'm passing the FID of the stretched
image (out_img_RGB_data_r_fid) to be saved as tiff, I found that the
tiff image is the one obtained with the layer stacking and not the
stretched one!!
could anyone please help me??

thanks
[Message index]
 
Read Message
Previous Topic: Non-persistent object, persistent headache
Next Topic: cgImage Update

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 16:24:54 PDT 2025

Total time taken to generate the page: 1.11982 seconds