Pixel Information [message #10391] |
Wed, 26 November 1997 00:00  |
Jonathan Greenspon
Messages: 1 Registered: November 1997
|
Junior Member |
|
|
I am trying to figure out a method of getting IDL to look at a 640x480
image that I have equipment generating, and then take a certain pixel
(207,179 - for example) and save the infor on that pixel only.
Then I can plot out or run an FFT analysis on the values within that
point on a given day....
Any ideas?
|
|
|
Re: Pixel Information [message #10457 is a reply to message #10391] |
Tue, 02 December 1997 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
David Fanning wrote:
>
> Jonathan Greenspon (jon@eddyco.com) writes:
>
>> I am trying to figure out a method of getting IDL to look at a 640x480
>> image that I have equipment generating, and then take a certain pixel
>> (207,179 - for example) and save the infor on that pixel only.
>>
>> Then I can plot out or run an FFT analysis on the values within that
>> point on a given day....
>
> This has got to be a trick question. Oh, all right, I'll
> bite.
>
> How about this:
>
> pixelValues = FltArr(daysTotal)
> FOR eachimage=0,daysTotal-1 DO BEGIN
> image = OpenImage()
> pixelValues[eachimage] = image[207,179]
> ENDFOR
> Plot, pixelValues
If you will be doing this for many of the pixels repeatedly, then
you might want to create a 3D volume out of your 640x480 images:
ImgVol = intarr(640,480,Ndays) ; or whatever data-type
ImgVol(*,*,0) = Image1
ImgVol(*,*,1) = Image2 ...
and then you can pull out the values of a given pixel over time
very quickly with:
x = 207
y = 179
PixelValues = ImgVol(x,y,*)
plot, PixelValues
Of course you will need lots of memory for this approach, but it's
very fast once you create the 3D array.
I have a routine called MAK_VOL that creates a volume out of a list
of files (you provide a filespec with ? or *). You'll need to
replace the READ_IMG() function with your own function that reads
your particular images, but this would be a good place to start:
ftp://bial8.ucsd.edu pub/software/idl/share
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|