X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05 Aug 2007 05:27 PM by  anon
import generic format-ASCII images
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
05 Aug 2007 05:27 PM
    Hi, i have to import a number of ASCII .txt files and save them as ENVI standard images, but I can not found any IDL script able to do this; do you know which is the code ENVI uses to to open generic format-ASCII data ? thanks marco

    Deleted User



    New Member


    Posts:
    New Member


    --
    05 Aug 2007 05:27 PM
    I believe that ENVI's idea of "generic format ASCII images" is a grid of pixel values that are stored as whitespace- or comma-delimited number strings. For example, an ASCII representation of a 400 x 300 image would be a file with 300 lines of 400 "columns" of number strings. If I am right on this, then simple IDL code for reading such a file and displaying it as an IDL Direct Graphics image could be as simple as this: IDL> file = 'ascii_image.txt' IDL> image_data_struct = read_ascii(file) IDL> help, image_data,_struct /STRUCT ;** Structure , 1 tags, length=36, data length=36, refs=1: ; FIELD1 FLOAT Array[400, 300] IDL> image_data = image_data_struct.field1 IDL> window, XSIZE=400, YSIZE=300 IDL> tvscl, image_data James Jones
    You are not authorized to post a reply.