X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 01 Aug 2007 01:51 PM by  anon
Read/write associated DEM file name?
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
01 Aug 2007 01:51 PM
    So am I missing something, or can you not programmatically read or write the name of an associated DEM (the 'dem file' and 'dem band' settings) to a header file? If this isn't possible, any chance of getting it into ENVI 4.4? Jeff

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    01 Aug 2007 01:51 PM
    Hi Jeff, There is a way, its just not exposed to users because it uses an object reference (so use at your own risk!). In order to associate a DEM to an image programmatically, you need to use the object reference, o_dem. This "object" holds a FID, POS, and DIMS in a single entity rather than making them separate. Here is an example: ========================== pro associate_dem ;open and image and DEM file image = 'bhtmref.img' dem = 'bhdemsub.img' envi_open_file, image, r_fid=ifid, /no_realize envi_open_file, dem, r_fid=dfid, /no_realize ;query the files - the o_dem object is always valid envi_file_query, ifid, o_dem=o_dem envi_file_query, dfid ;set properties of o_dem o_dem->setproperty, fid=dfid, pos=0L ;create the new header with the association envi_write_file_header, ifid ;if the file is open, you will need to remove it ;and load the new image with the new header envi_file_mng, id=ifid, /remove envi_file_mng, id=dfid, /remove envi_open_file, image, r_fid=new_fid, /no_realize end
    You are not authorized to post a reply.