I have two images (TIFF)...
1) original_image
2) final_image
And I want that the final_image inherits the original_image map info.
But when I use the ENVI_SETUP_HEAD routine with the INHERIT option my final_image is shifted 8 pixels to the right in correspondence to the original_image.
The code I am using is more or less the following...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Get the size of the original image
ENVI_OPEN_FILE, original_image_path, r_fid = original_fid
ENVI_FILE_QUERY, original_fid, dims = o_dims, ns = o_ns, nl = o_nl, nb = o_nb
; Create a final image (with zeros) with the same size as the original image
final_image = INTARR(o_ns, o_nl)
; HERE I PUT SOME ONES IN THE FINAL IMAGE
; Here I save the image as a Tiff
fname = 'C:\final_image.tif'
WRITE_TIFF, fname, final_image
; Inherit information from the original image
pos = [0]
inherit = ENVI_SET_INHERITANCE(original_fid, o_dims, pos, /FULL)
; Enter the data into ENVI
ENVI_SETUP_HEAD, fname = fname, $
ns = o_ns, $ ; number of samples in the file.
nl = o_nl, $ ; number of lines in the file
nb = 1, $ ; number of bands in the file
interleave = 0, $ ; BSQ output
data_type = 1, $ ; 8 bits data
offset = 0, $ ; no offsets
inherit = inherit, $; file inheritance
/WRITE, /OPEN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Any ideas???
Best regards,
|