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

Home » Public Forums » archive » Re: Process series of image files?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Process series of image files? [message #53198] Thu, 29 March 2007 14:46
beardown911 is currently offline  beardown911
Messages: 21
Registered: March 2007
Junior Member
On Mar 29, 11:52 am, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>> ; Get all the input TIFF files in directory.
>> files = File_Search('*.tif', Count=count)
>
>> ; Process each file somehow...
>> FOR j=0,count-1 DO BEGIN
>> something, something, something
>
>> ; Write the file out with a changed name.
>> dir = File_DirName(file, /Mark_Directory)
>> basename = File_BaseName(file, '.tif')
>> outfile = dir + basename +'.processed.tif'
>> Write_Tiff, outfile, processedImage
>> ENDFOR
>
> Whoops! I better read the file in there somewhere or
> you will REALLY get confused. :-)
>
> FOR j=0,count-1 DO BEGIN
> image = Read_Tiff(file[j])
>
> do something, something, something
>
> ; Write the file out with a changed name.
> dir = File_DirName(file, /Mark_Directory)
> basename = File_BaseName(file, '.tif')
> outfile = dir + basename +'.processed.tif'
> Write_Tiff, outfile, processedImage
> ENDFOR
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

David,

Thank you so much.
I haven't tried yet though, but really appreciate your kind help.

Have a nice day,
Phil
Re: Process series of image files? [message #53211 is a reply to message #53198] Thu, 29 March 2007 09:52 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> ; Get all the input TIFF files in directory.
> files = File_Search('*.tif', Count=count)
>
> ; Process each file somehow...
> FOR j=0,count-1 DO BEGIN
> something, something, something
>
> ; Write the file out with a changed name.
> dir = File_DirName(file, /Mark_Directory)
> basename = File_BaseName(file, '.tif')
> outfile = dir + basename +'.processed.tif'
> Write_Tiff, outfile, processedImage
> ENDFOR

Whoops! I better read the file in there somewhere or
you will REALLY get confused. :-)

FOR j=0,count-1 DO BEGIN
image = Read_Tiff(file[j])

do something, something, something

; Write the file out with a changed name.
dir = File_DirName(file, /Mark_Directory)
basename = File_BaseName(file, '.tif')
outfile = dir + basename +'.processed.tif'
Write_Tiff, outfile, processedImage
ENDFOR

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Process series of image files? [message #53212 is a reply to message #53211] Thu, 29 March 2007 09:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
go cats writes:

> I have another question. I learned that dialog_pickfile() is useful to
> pick an input file, instead of modifying and save code. Is there a way
> to define output file name in thay way? I mean specifying user defined
> output file name, instead of modifying write_tiff every time.

This is, generally, what is meant by the term "programming". :-)

; Get all the input TIFF files in directory.
files = File_Search('*.tif', Count=count)

; Process each file somehow...
FOR j=0,count-1 DO BEGIN
something, something, something

; Write the file out with a changed name.
dir = File_DirName(file, /Mark_Directory)
basename = File_BaseName(file, '.tif')
outfile = dir + basename +'.processed.tif'
Write_Tiff, outfile, processedImage
ENDFOR

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 14 bit image in false color
Next Topic: Re: We have file_lines for lines in IDL. What about file_rows?

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

Current Time: Thu Oct 09 07:37:20 PDT 2025

Total time taken to generate the page: 1.04190 seconds