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

Home » Public Forums » archive » count number of pixels and write to a txt file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
count number of pixels and write to a txt file [message #90144] Sun, 01 February 2015 22:38 Go to previous message
beardown912 is currently offline  beardown912
Messages: 2
Registered: February 2015
Junior Member
Hello,

I've been banged my head and pulling out my hairs for last a couple of days, but I am still struggling. And I decided to get some help from you guys.

What I've been trying to is counting number of pixels meets a condition and write it into a text file with the file name. And I am dealing with about 20,000 image files.
I used 'where' function and it works fine in displaying while looping.
However, only the last value of pixel number and all file names are appended.
Below is what I've been reached. It looks very sloppy :)

------------------------------
pro filelist

filter = ['*.tif']
file = file_search(dialog_pickfile(PATH='C:\', filter=filter, get_path=outdir, /multiple_files), count=numbers)
FILE_MKDIR, outdir

FOR j=0, numbers-1 DO BEGIN

Image = read_tiff(file[j])

index = where(image ge 210, ct)

if ct GT 50000 then begin
openw, lun, outdir + 'test00.txt ', /get_lun
printf, lun, ct, file
close, lun
free_lun, lun
endif

ENDFOR
end
------------------------------------------------

Any tip would be greatly appreciated.

Thanks,
Kim
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: make_rt change viewplane behaviour
Next Topic: Re: Correlate and NAN

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

Current Time: Wed Oct 08 11:47:52 PDT 2025

Total time taken to generate the page: 0.00199 seconds