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

Home » Public Forums » archive » Re: reading pixels from images from automated XYpositions
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: reading pixels from images from automated XYpositions [message #39007 is a reply to message #38994] Wed, 14 April 2004 16:02 Go to previous message
Yunxiang Zhang is currently offline  Yunxiang Zhang
Messages: 19
Registered: October 2003
Junior Member
I think you'd better explain in detail the definition of your pos. I can't
understand it from your code. But I think I may have a similiar question
of how to extract features from an image.

For example, let's define a 7X7 pixels area a molecule. And I have all N
molecules' positions stored in a 2XN array pos. Thus, molecule No. i will
be,

Image[pos[0,i]-3:pos[0,i]+3,pos[1,i]-3:pos[1,i]+3]

which is a 7X7 data. But if if I want to extract all the molecules at the
same time without using a loop. Then I got,

molecules=Image[pos[0,*]-3:pos[0,*]+3,pos[1,*]-3:pos[1,*]+3]

% Expression must be a scalar or 1 element array in this context: <INT
Array[1, N]>.

Can anybody show me how to do this properly?


Thanks!
Yunxiang


On Wed, 14 Apr 2004, Thomas Nehls wrote:

> Hi folks,
>
> I want to get information(mean, stddev, median) about the values of
> certain pixels(7x7 pixels areas) from an image.
> The according XY positions should be read from a file, where a list of
> positions is given.
>
> This is, what I thought could work:
>
>> PRO input,x
>>
>> FOR n=0,x-1 do grey_scale_value,n
>> END
>>
>> PRO grey_scale_value, n,x
>> file = DIALOG_PICKFILE(/READ)
>> img = READ_TIFF(file)
>> positions = DIALOG_PICKFILE(/READ)
>> pos =bytarr(3,6)
>> pos = READ_SYLK(positions,/ARRAY)
>> pixels1 = img[0,23:26,35:38]
>> pixels2 = img[0,(pos[1]-3 where pos[0]=n):(pos[1]+3 where pos[0]=n),(pos[2]-3 where pos[0]=n):(pos[2]+3 where pos[0]=n)]
>>
>> OPENW,1,'greyscale_data.dat',/APPEND
>> PRINTF,1, (n+1),mean(pixels2),stddev(pixels2),median(pixels2)
>> CLOSE,1
>> END
>
> first I tried pixels1, the scheme works, but I think I used the 'where'
> command in the wrong way...
> Do you have a hint for me?
> Thanks
> Tom
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Yes, probably, you're right
Next Topic: Re: set default set of sub-bands in envi_select

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

Current Time: Wed Oct 08 15:55:24 PDT 2025

Total time taken to generate the page: 0.00542 seconds