comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » merging bands
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: merging bands [message #76656 is a reply to message #76521] Sat, 18 June 2011 05:08 Go to previous message
Konstantinos is currently offline  Konstantinos
Messages: 29
Registered: April 2011
Junior Member
If i understand well what you want i ll try t assist you

PRO merge_files_forum
CD, 'c:\.........' ;full path of the directory you have your files
list_of_files_R=FILE_SEARCH('*R.tiff')
list_of_files_G=FILE_SEARCH('*G.tiff')
list_of_files_B=FILE_SEARCH('*B.tiff')
number_of_files=N_ELEMENTS(list_of_files_R)
image=MAKE_ARRAY(3, 1932, 1040)

FOR i=0, number_of_files-1 DO BEGIN
image_R=READ_TIFF(list_of_files_R[i])
image_G=READ_TIFF(list_of_files_G[i])
image_B=READ_TIFF(list_of_files_B[i])
image[0,*,*]=image_R[*,*]
image[1,*,*]=image_G[*,*]
image[2,*,*]=image_B[*,*]
;YOU CAN GIVE ANY FILENAME YOU WANT JUST GIVING YOU THIS FOR
EXAMPLE
filename=STRING(i)+'.tiff'
WRITE_TIFF, filename, image
ENDFOR
END

I think that this piece of code should work for you.
I know that this code IS NOT WRITTEN THE BEST WAY, and it is also very
BAD AND PRIMITIVE IDL WRITING

kostas
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Invoking functions by name
Next Topic: Re: Histoplot - yaxis range

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:46:55 PDT 2025

Total time taken to generate the page: 0.24068 seconds