X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 Feb 2007 07:53 PM by  anon
generating a 3D array of .tiff images from a set of several separate .tiff images for use in mpeg creation
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 Feb 2007 07:53 PM
    Hello, I have three sets of 20 previously generated .tiff files (400x300 pixels each). I would like to stack them into three 3D array files so that I can create three mpegs, however I'm running into problems, specifically I think I am running out of logical units. I'm rather new to IDL and I think this is a relatively simple problem to fix, probably something wrong with the syntax. Here is what I have so far to generate the first of the three sets: CD, 'C:\Documents and Settings\Owner\Desktop\IDL_Project\si' list = FILE_SEARCH('*.tiff',COUNT = count,/NOSORT) cube_si=FINDGEN(400,300,count) FOR k = 0,count-1 DO BEGIN file_si = list(k) OPENR, lun, file_si, /get_lun file_si=cube_si(*,*,k) ENDFOR CLOSE, lun Thank you for any help, I apologize if this is rather basic, I am new to IDL and am having a hard time sifting through the IDL help files to pinpoint the answer to this!!

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Feb 2007 07:53 PM
    If you are running out of 'lun's, then the issue will probably be solved by moving your "CLOSE, lun" call into your loop. I, personally, use FREE_LUN, but I think either CLOSE or FREE_LUN will accomplish the same in the below rewrite of your code. Nevertheless, I think that tip is meaniningless, if the files in your 'list' array are TIFF's. In that case, you would be using READ_TIFF to read them, and READ_TIFF does not require any OPENR calls or 'lun' file descriptors. The rewrite below of your loop shows the proper approach to reading TIFF's. Thus: ... FOR k = 0, count-1 DO BEGIN image2D = READ_TIFF(list(k)) ; This line assumes images are 2D grayscale cube_si[0,0,k] = image2D ENDFOR The syntax "cube_si[*,*,k] = image2D" also works, and is more typical in existing IDL code, but it is not quite as efficient as "cube_si[0,0,k] = image2D". James Jones
    You are not authorized to post a reply.