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 #76644 is a reply to message #76521] Mon, 20 June 2011 07:52 Go to previous messageGo to previous message
beardown911 is currently offline  beardown911
Messages: 21
Registered: March 2007
Junior Member
On Jun 18, 7:08 am, Konstantinos <moonlightsha...@hotmail.gr> wrote:
> 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

Hi Kostas,

Thank you so much for your code.
It worked. I just modified the writing tiff part using file "basename"
function.

Thanks again and have a nice day,
Kim
[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: Fri Oct 10 09:09:07 PDT 2025

Total time taken to generate the page: 0.04428 seconds