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

Home » Public Forums » archive » Re: rejecting a few pixel values from an array of pixel values
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: rejecting a few pixel values from an array of pixel values [message #70077] Sat, 13 March 2010 07:55 Go to previous message
Robert Moss, PhD is currently offline  Robert Moss, PhD
Messages: 29
Registered: November 2006
Junior Member
On Mar 13, 10:01 am, sid <gunvicsi...@gmail.com> wrote:
> Hi,
>    I am having an image array with 1024*1024 pixel values with pixel
> values ranging from 1.39 to 0.03. Now I need only pixel values ranging
> from 1.1 to 0.8, so please do suggest me what method to follow to get
> only the pixel values of my interest, also suggest if any looping can
> be done for this kind of job.
> regards
> sid

No looping is required. Briefly you probably want the WHERE function
or the HISTOGRAM function, depending on what you plan on doing. As an
example (by no means intended to be the most clever or shortest) you
could do the following:

;; Assume zero can be used as missing data
;; mask the data over 1.1
hi = WHERE( image GT 1.1, nhi )
IF nhi GT 0 THEN image[ hi ] = 0
;; mask the data less than 0.8
lo = WHERE( image LT 0.8, nlo )
IF nlo GT 0 THEN image[ lo ] = 0

;;at this point only pixels in image that are non-zero are between 0.1
and 1.1 inclusive

If you just want statistics on those pixels, skip all that and use
histogram
h = HISTOGRAM( image, MIN = 0.8, MAX = 1.1, BINSIZE = 0.01 )

r
[Message index]
 
Read Message
Read Message
Previous Topic: Re: re-create a widget
Next Topic: Re: how to display on the unix system

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

Current Time: Mon Dec 01 23:51:15 PST 2025

Total time taken to generate the page: 0.80322 seconds