Re: Process series of image files? [message #53198] |
Thu, 29 March 2007 14:46 |
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  |
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  |
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.")
|
|
|