If the file was created in ENVI and has an associated *.hdr file it isn't a true TIFF file. What I would suggest it renaming the file extension to something more commonly associated with ENVI file formats such as *.dat or *.img. (*.tif extensions should only be used if you are actually using a tiff writing tool). So what you would have then would be for example: 'myndvifile.dat' and 'myndvifile.hdr'. Do not put these files in separate directories. They must always be together for ENVI to open the image file correctly.
That said ENVI image files are binary files which is why you can open them with the 'read_binary' function. There is another way to open them. Consider the following pseudocode:
filename='C:\whateverdir\myndvifile.dat'
;read_image,filename
openr, lun, filename, /get_lun
;set up array to put image data into.(samples, lines)
pic=fltarr(512, 512)
readu, lun, pic
;How IDL reads the image
window, 1, xsize=512, ysize=512, title='IDL Image'
;loadct, 39
tvscl, pic
; Change the way IDL reads the image so it's
;how ENVI would display it
window, 2, xsize=512, ysize=512, title='Corrected IDL Image'
tvscl,reverse(pic,2)
|